On 03/15/2015 08:28 AM, Yitao Jiang wrote:
Hi,guys
I wanna to get the disk snapshot size, but found nothing libvirt commands
related,except qemu-img.
I create two disk snapshots, but nothing return its' size
[root@cskvm01 qcow2]# qemu-img info
/mnt/e6758700-af68-3c06-ade3-53f5f9b93507/e2cf6551-0d2c-4382-a86c-8ba633954ff2
image:
/mnt/e6758700-af68-3c06-ade3-53f5f9b93507/e2cf6551-0d2c-4382-a86c-8ba633954ff2
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 1.0G
cluster_size: 65536
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 4fc42d73-8257-42bd-8807-81700fd3c689 0 2015-03-15 21:05:55
01:05:53.583
2 2fd6aeab-cb26-446d-b1c6-e8d70d33f651 0 2015-03-15 21:50:35
00:00:00.000
qemu-img info only reports the amount of storage tied up in the memory
portion of an internal snapshot. If you take an internal snapshot when
the guest is not running, then there is no memory state, so the size is
correctly 0. There is currently no way to access the amount of the qcow2
file that is tied up by a given internal snapshot and which would be
freed if that snapshot is deleted, but adding such a metric would be a
job for the qemu list, and not anything libvirt can do without qemu's help.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org