VMware Horizon Community
mohd1024
Contributor
Contributor

How to retrieve the VM disk size?

Hello All,

How can I retrieve the disk size of a virtual machine using vertual center web service in c# or java?

Thank you.

0 Kudos
1 Reply
davlloyd
Hot Shot
Hot Shot

Yes, if you follow the following logic

1) obtain the ManagementObject for the guest device

2) Retrieve the 'config' property from the mo ref

3) Cast the property value to a 'VirtualMachineConfigInfo' object

4) Retrieve the enumeration collection of the hardware.device method of the cast 'VirtualMachineConfigInfo' object

5) Enumerate through collection for 'VirtualDisk' objects and retrieve the property 'capacityInKB'

That is the long winded way or just parse the VMDK files.

0 Kudos