このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 03 Zed editor 設定 [Windowsでビルド]
- 09 ↷ 50_dialy:2025:09:09 から 50_dialy:2025:09:08 へページを名称変更しました。
- 06 ↷ 50_dialy:2025:06 から 50_dialy:2025:09:06 へページを移動しました。
最近の更新
内部スナップショットは、10 qcow2バクアップ 内部スナップショット(internal)
root@hvdev1001:~# virsh domblklist testvm Target Source ------------------------------------------------ vda /var/lib/libvirt/images/testvm.qcow2 sda -
root@hvdev1001:~# virsh snapshot-create-as testvm --name testsnap --no-metadata --disk-only Domain snapshot testsnap created
root@hvdev1001:~# virsh domblklist testvm Target Source --------------------------------------------------- vda /var/lib/libvirt/images/testvm.testsnap sda -
# virsh dumpxml testvm
.
.
.
<disk type=039;file039; device=039;disk039;>
<driver name=039;qemu039; type=039;qcow2039;/>
<source file=039;/var/lib/libvirt/images/testvm.testsnap039; index=039;3039;/>
<backingStore type=039;file039; index=039;2039;>
<format type=039;qcow2039;/>
<source file=039;/var/lib/libvirt/images/testvm.qcow2039;/>
<backingStore/>
</backingStore>
<target dev=039;vda039; bus=039;virtio039;/>
<alias name=039;virtio-disk0039;/>
<address type=039;pci039; domain=039;0x0000039; bus=039;0x03039; slot=039;0x00039; function=039;0x0039;/>
</disk>
.
.
# qemu-img info /var/lib/libvirt/images/testvm.qcow2
image: /var/lib/libvirt/images/testvm.qcow2
file format: qcow2
virtual size: 25 GiB (26843545600 bytes)
disk size: 4.16 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
refcount bits: 16
corrupt: false
# cp /var/lib/libvirt/images/testvm.qcow2 /backups/
容量の節約には圧縮しとく方法もある。
※コンバートには時間がかかります。
# qemu-img convert -c -f qcow2 -O qcow2 /var/lib/libvirt/images/testvm.qcow2 /backups/testvm.qcow2.bk
# qemu-img info /var/lib/libvirt/images/testvm.qcow2
image: testvm.qcow2
file format: qcow2
virtual size: 100 GiB (107374182400 bytes)
disk size: 12.9 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
refcount bits: 16
corrupt: false
# qemu-img info /backups/testvm.qcow2.bk
image: testvm.qcow2.bk
file format: qcow2
virtual size: 100 GiB (107374182400 bytes)
disk size: 6.88 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
# ll -h /backups/testvm.qcow2.bk
-rw-r--r-- 1 root root 6.9G Apr 28 07:55 /backups/testvm.qcow2.bk
※注意 –base –topはフルパスじゃないとエラーになります。
root@hvdev1001:~# virsh blockcommit testvm vda --base /var/lib/libvirt/images/testvm.qcow2 --top /var/lib/libvirt/images/testvm.testsnap --wait --verbose --pivot Block commit: [100 %] Successfully pivoted
root@hvdev1001:~# virsh domblklist testvm Target Source ------------------------------------------------ vda /var/lib/libvirt/images/testvm.qcow2 sda -
# virsh dumpxml testvm
.
.
.
<disk type=039;file039; device=039;disk039;>
<driver name=039;qemu039; type=039;qcow2039;/>
<source file=039;/var/lib/libvirt/images/testvm.qcow2039; index=039;2039;/>
<backingStore/>
<target dev=039;vda039; bus=039;virtio039;/>
<alias name=039;virtio-disk0039;/>
<address type=039;pci039; domain=039;0x0000039; bus=039;0x03039; slot=039;0x00039; function=039;0x0039;/>
</disk>