PyVim

PyVim主要用于连接到 Service Instance

import atexit
from pyVim import connect

// Connect to Server
If  args.disable_ssl_verification:   //no check SSL certification
          service_instance=connect.SmartConnectNoSSL(host=args.host,
                                                   user=args.user,
                                                   pwd=args.password,
                                                   port=int(args.port))
else:   //check SSL certification
        service_instance=connect.SmartConnect(host=args.host,
                                         user=args.user,
                                         pwd=args.password,
                                         port=int(args.port))

// Disconnect from Server
atexit.register(connect.Disconnect,service_instance)

 

posted @ 2017-08-26 18:13  Vincen_shen  阅读(1847)  评论(1编辑  收藏  举报