Is there a method in the sdk which lists out all the VMs on an esx host ?
You just need to get a reference to a HostSystem and it has an array property called vm http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.HostSystem.html which gives you an array reference to all the VMs on that particular host.
Here is a Perl script sample that shows how to retrieve all VMs for a specific host and some attributes of the VM:
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
You just need to get a reference to a HostSystem and it has an array property called vm http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.HostSystem.html which gives you an array reference to all the VMs on that particular host.
Here is a Perl script sample that shows how to retrieve all VMs for a specific host and some attributes of the VM:
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Is there any Equalent of " find_entity_views " in C# SDK ?
Yes, find_entity_views is just a Perl subroutine that uses RetrieveProperties() http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vmodl.query.PropertyColle...
If you're interested to see how this is implemented, take a look at some of the VMware Perl Modules that were written at /usr/lib/perl5/5.8.8/VMware if you have vCLI installed and specifically VICommon.pm which contains the subroutine definition. You definitely can write one for C# using the vSphere SDK
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
The AppUtil class provided in the sample sdk has the function getdescendentmoref() which fetches the ManagedObjectReferences to all the VMs on the host.