VMware {code} Community
sajuptpm
Contributor
Contributor

vcenter: Sometime host.config returning object of VirtualMachineConfigInfo

Hi,

Sometime getting wrong object while trying to access config property of host in a vcenter.

network = host_mob.config.network
AttributeError: VirtualMachineConfigInfo instance has no attribute 'network


DEBUG======host_mob====== <psphere.managedobjects.HostSystem object at 0x7f699149d850>
DEBUG=====host_mob.name==== 192.168.0.134
0 Kudos
2 Replies
sajuptpm
Contributor
Contributor

I added 2 hosts (192.168.0.113 and 192.168.0.134) on vcenter 192.168.0.114.

ERROR: host.config of 192.168.0.134 returning VirtualMachineConfigInfo instead of HostConfigInfo

Code

##########

print "DEBUG======self.client.server======", self.client.server
print "DEBUG======host_mob======", host_mob, host_mob._mo_ref.value
print "DEBUG=====host_mob.name====", host_mob.name

print "DEBUG=====host_mob====", host_mob.__class__.__name__
print "DEBUG=====summary====", host_mob.summary.__class__.__name__
print "DEBUG=====config====", host_mob.config.__class__.__name__

OUTPUT

###############

DEBUG======self.node_proxy.client.server====== 192.168.0.114

DEBUG======host_mob====== <psphere.managedobjects.HostSystem object at 0x7f2acd616d10> host-5602

DEBUG=====host_mob.name==== 192.168.0.113

DEBUG=====host_mob==== HostSystem

DEBUG=====summary==== HostListSummary

DEBUG=====config==== HostConfigInfo

DEBUG======self.node_proxy.client.server====== 192.168.0.114

DEBUG======host_mob====== <psphere.managedobjects.HostSystem object at 0x7f2b1c2cc550> host-5617

DEBUG=====host_mob.name==== 192.168.0.134

DEBUG=====host_mob==== HostSystem

DEBUG=====summary==== HostListSummary

DEBUG=====config==== VirtualMachineConfigInfo

0 Kudos
sajuptpm
Contributor
Contributor

Hi,

I could reproduce same issue using thread.

Please check attached files.

Thanks,

0 Kudos