[libvirt] Virtual disk size associated with a Domain

Hello, Is there any way to fetch the size of all the virtual disks associated with a Domain?? I could not find one in the libvirt API., I tried using 'virStorageVol' and 'virStoragePool', but they returned null objects. Also I fetched 'virDomainBlockStats', but did not understand the information returned. i.e. 'rd_bytes' and 'wr_bytes'. Can we use this info for calculating the disk sizes? Any method for finding this is welcome. using virt or xm or virsh command line tools also. Also, What does the size of the "img" file for a Domain represent? Is it the disc size? Please help. Thanks and Regards Sagar Barve

On Fri, Jun 11, 2010 at 06:09:19PM +0900, IKI-サガル バルウェ wrote:
Hello,
Is there any way to fetch the size of all the virtual disks associated with a Domain??
I could not find one in the libvirt API., I tried using 'virStorageVol' and 'virStoragePool', but they returned null objects. Also I fetched 'virDomainBlockStats', but did not understand the information returned. i.e. 'rd_bytes' and 'wr_bytes'. Can we use this info for calculating the disk sizes?
In 0.8.1 we added a virDomainGetBlockInfo API that will give you this data directly.
Also, What does the size of the "img" file for a Domain represent? Is it the disc size?
virDomainGetBlockInfo gives both several sizes - see the header file comments for a description of what each means. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
IKI-サガル バルウェ