特别是,我正在使用python和vmware-vsphere使虚拟机创建/开机等自动化。我知道如何打印虚拟机的属性,但是,我仍然无法调用任何方法,因为我不知道如何打印。
这是我遇到问题的代码片段:
for vm in virtual_machines:
print "VM: "+vm[ name ]+" ("+vm[ runtime.powerState ]+") ",
if hasattr(vm[ guest ], ipAddress ):
print vm[ guest ].ipAddress,
if vm[ runtime.powerState ] == poweredOn :
print RAM: +str(vm[ summary.quickStats ].distributedMemoryEntitlement)+ MB, CPU: +str(vm[ summary.quickStats ].distributedCpuEntitlement)+ MHz ,
if vm[ name ] == VIRT_VZ_114 :
# This is the trouble maker, it says types mismatch "suds.TypeNotFound: Type not found: guest "
client.service.PowerOnVM_Task(mo_VirtualMachine,vm)
print
如何正确调用方法?