使用pysphere模块
利用vmware提供的web service sdk
参考: http://www.ibm.com/developerworks/cn/cloud/library/1303_jinhui_scevsphere/index.html
代码如下显示
利用vmware提供的web service sdk
参考: http://www.i
代码如下显示
from pysphere import VIServer, MORTypes, VIProperty
from pysphere.resources import VimService_services as VI
from __future__ import division
HOST="xxx.xxx.xxx.xxx"
USER="root"
PASSWORD="*****"
s = VIServer()
s.connect(HOST, USER, PASSWORD)
hosts = s.get_hosts()
#pri