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
As $title, DVPG created by vcsim does not have 'PortKeys' as mentioned in documentation.
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()
dvpg=get_obj(content, [vim.dvs.DistributedVirtualPortgroup], 'DC0_DVPG0')
printdvpg.configprintdvpg.portKeys
Traceback -
python portgroup.py
(vim.dvs.DistributedVirtualPortgroup.ConfigInfo) {
dynamicType = <unset>,
dynamicProperty = (vmodl.DynamicProperty) [],
key = 'dvportgroup-14',
name = 'DC0_DVPG0',
numPorts = 0,
distributedVirtualSwitch = 'vim.DistributedVirtualSwitch:distributedvirtualswitch-10',
defaultPortConfig = <unset>,
description = <unset>,
type = '',
policy = <unset>,
portNameFormat = <unset>,
scope = (vim.ManagedEntity) [],
vendorSpecificConfig = (vim.dvs.KeyedOpaqueBlob) [],
configVersion = <unset>,
autoExpand = <unset>,
vmVnicNetworkResourcePoolKey = <unset>,
uplink = <unset>
}
Traceback (most recent call last):
File "portgroup.py", line 39, in <module>
print dvpg.portKeys
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
The text was updated successfully, but these errors were encountered:
Akasurde
changed the title
vcsim: DistributedVirtulaPortgroup does not have Portkeys
vcsim: DistributedVirtualPortgroup does not have Portkeys
Jan 4, 2018
As $title, DVPG created by vcsim does not have 'PortKeys' as mentioned in documentation.
Here is reproducer -
Traceback -
The text was updated successfully, but these errors were encountered: