Hi All,
I'm using the latest release of VIX API to power on VMs on an ESX server. I'm working with C# in Visual Studio 2012 and currently, I power on the VM using the following code:
VMWareVirtualMachine virtualClientMachine = host.Open(vmMachinePath, 2100);
While this works, I think it's better to instead be able to power on the VM when you know the VM name and not the path. So, how can I get the VM path to the vmx file when I know the name of the VM? For example, if my VM on the ESX server is called WIN7GERMAN, how do I then get the path and pass this to the host.Open function?
Thanks for any help or code.
John
VM names are not unique, which is why this isn't supported.
You can use VixHost_FindItems() and search for the undocumented VIX_PROPERTY_FOUND_ITEM_NAME property and use the associated VIX_PROPERTY_FOUND_ITEM_LOCATION to get the value to pass to VixHost_OpenVM(). You'll have to deal with any duplicate names however ![]()
VM names are not unique, which is why this isn't supported.
You can use VixHost_FindItems() and search for the undocumented VIX_PROPERTY_FOUND_ITEM_NAME property and use the associated VIX_PROPERTY_FOUND_ITEM_LOCATION to get the value to pass to VixHost_OpenVM(). You'll have to deal with any duplicate names however ![]()
That's a pity. It's not ideal to pass paths each time I want to power on a VM but if that's the best way, then so be it.
Thanks for the helpful explanation.
John
