vCenter

 View Only
  • 1.  vCenter API - Get consumed vmdk space

    Posted Dec 02, 2022 04:37 PM

    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



  • 2.  RE: vCenter API - Get consumed vmdk space

    Posted Dec 04, 2022 06:08 PM

    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.