lundi 11 juillet 2016

pyMomi vim.HbrManager.ReplicationVmInfo

So I pretty new to python. However I want to use the python module pyMomi to get the replication info of VM in VMware using the class vim.HbrManager.ReplicationVmInfo

I've got a basic script (see below) to start with and I can print out the class but I don't know how print out this information for a particular vm

Any help would be great.

from pyVmomi import vim, vmodl
from pyVim.connect import SmartConnect, Disconnect


vc = None

vcenter_host = "vcenter"
vcenter_port = 443
vcenter_username = "user"
vcenter_password = "password"

try:
    vc = SmartConnect(host=vcenter_host, user=vcenter_username, pwd=vcenter_password, port=vcenter_port)

except IOError as e:
    print "I/O error({0}): {1}".format(e.errno, e.strerror)
    print ''

vm = vim.vm.Summary
rep = vim.HbrManager.ReplicationVmInfo

print rep()
print vm()

Aucun commentaire:

Enregistrer un commentaire