在4个虚拟机中,我尝试了两次,但始终失败,尽管应该是IMO
任何帮助将不胜感激。
谢谢!
从pyVim.connect导入SmartConnect 导入ssl
s = ssl.SSLContext(ssl.PROTOCOL_SSLv23) # For VC 6.5/6.0
s=ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
vc_fqdn = <enter_vc_fqdn>
user_name = <enter_user_with_appropriate_permissions>
password = <password>
vc_connect = SmartConnect(host=vc_fqdn, user=user_name,
pwd=password,sslContext=s)
vm = None
search_index = vc_connect.content.searchIndex
vm = search_index.FindByDns(dnsName = "<FQDN>", vmSearch = True)