[libvirt-users] how to get disk snapshot size

Eric Blake eblake at redhat.com
Mon Mar 16 15:07:39 UTC 2015


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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150316/97bf5a42/attachment.sig>


More information about the libvirt-users mailing list