模組名稱: pysphere
安裝:
#easy_install pysphere
操作:
from pysphere import VIServer
Server=VIServer()
Server.connect("ip","username","password")
#如果是連結vmware server 則使用8333 port
#Server.connect("ip:8333","username","password")
#列出所有的vm guest os
all_server=server.get_registered_vms()
for serverpath in all_server:
vm=server.get_vm_by_path(server path)
#列出guest os的所有參數
vm.get_properties()
#取出特定的guest os參數數值
vm.get_property("hostname")
沒有留言:
張貼留言