You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to list the snapshots of VM, when no snapshot exists for given VM.
Here is reproducer -
frompyVim.connectimportSmartConnect, DisconnectimportsslimportatexitfrompyVmomiimportvimdefconnect():
context=ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context.verify_mode=ssl.CERT_NONEsi=SmartConnect(host='0.0.0.0', user='user', pwd='pass', port=443, sslContext=context)
atexit.register(Disconnect, si)
content=si.RetrieveContent()
returncontentdefget_obj(content, vimtype, name):
""" Return an object by name, if name is None the first found object is returned """obj=Nonecontainer=content.viewManager.CreateContainerView(
content.rootFolder, vimtype, True)
forcincontainer.view:
ifname:
ifc.name==name:
obj=cbreakelse:
obj=cbreakcontainer.Destroy()
returnobjcontent=connect()
vm=get_obj(content, [vim.VirtualMachine], 'DC0_H0_VM0')
print(vm.snapshot)
I get traceback like -
python snapshot.py
Traceback (most recent call last):
File "snapshot.py", line 7, in <module>
print(vm.snapshot)
File "/Volumes/data/src/ansible/venv4/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 574, in __call__
return self.f(*args, **kwargs)
File "/Volumes/data/src/ansible/venv4/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 394, in _InvokeAccessor
return self._stub.InvokeAccessor(self, info)
File "/Volumes/data/src/ansible/venv4/lib/python2.7/site-packages/pyVmomi/StubAdapterAccessorImpl.py", line 43, in InvokeAccessor
objectContent = result.objects[0]
IndexError: list index out of range
I am unable to list the snapshots of VM, when no snapshot exists for given VM.
Here is reproducer -
I get traceback like -
govcsim trace =
The text was updated successfully, but these errors were encountered: