VMware Cloud Community
mmoretDMP
Contributor
Contributor

vCenter API - Get consumed vmdk space

Hi all,

Just a quick question. I have been searching and googling, but unable to find a solution.
Is there an easy way to get the consumed / In use disk space of a VM through the vCenter API?

Thanks!

Martijn

Reply
0 Kudos
1 Reply
maksym007
Expert
Expert

Take a look at the HostDatastoreBrowswer object: HostDatastoreBrowser

The SearchDatastore_Task will return a results object which contains a FileInfo object with properties on the file. You can use this same method to get files that aren't associated with a VM.

Reply
0 Kudos