Hello,
in a pyVmomi script I do get all VMs objects using following snippet code:
[...]
content = vc[vcenter]["si"].RetrieveContent()
objview = content.viewManager.CreateContainerView(content.rootFolder, [vim.VirtualMachine], True)
vmList = objview.view
objview.Destroy()
[...]
then I save in a file all the vmPathName informations (ie: vmList[0].summary.config.vmPathName).
Later the script need to locate back the vim.VirtualMachine object from the vmPathName information available in the saved file.
For this I plan to use SearchIndex.FindByDatastorePath but it requires to specify the datacenter information as well.
The issue is therefore how to derive the datacenter information for the given vim.VirtualMachine object and store it accordingly along with the vmPathName.
Unfortunately I've been unable to derive datacenter information from the vim.VirtualMachine object....
Any help/suggestion is really appreciated!
Thx,
A.