VMware {code} Community
sjacobs
Contributor
Contributor

Display ESX hosts and VM's

I'm a newbie to the VMWare SDK, and checked the .NET samples, looking for sample code to display all ESX hosts and their contained VM's, but could not find anything. Can anyone point me in the right direction?

Thanks,

Sam

0 Kudos
1 Reply
dmhaynes
Enthusiast
Enthusiast

You can use the getDecendentMoRefs() method of ServiceUtil to find all the ManagedObjectReferences of a particular type (i.e. VirtualMachine or HostSystem).

If you want to document the relationships between the two, you will need to use getObjectProperties in the same package to obtain the appropriate property for your report.

0 Kudos