카테고리 없음

pyVmomi 1 : 설치 및 vCenter 커넥션 호출

시작의 의미 2021. 4. 16. 22:10

pyVmomi 정의

 

VMware vSphere(vCenter, ESXi)를 관리하기 위한 파이썬 API용 Python SDK

 

pyVmomu 설치 방법

cmd

pip install pyvmomi

 

pyVmomi sample scripts

python

git clone https://github.com/vmware/pyvmomi-community-samples.git

 

pyVmomi : get vCenter connecting

 

def connect_vcenter(vCenter_ip, vCenter_id, vCenter_pw):

si = connect.SmartConnectNoSSL(host=vCenter_ip, user=vCenter_id, pwd=vCenter_pw, port=443)

 

atexit.register(connect.Disconnect, si)

return si

 

def main():

vCenter_ip = input("insert vCenter_ip: ")

vCenter_id = input("insert vCenter_id: ")

vCenter_pw = input("insert vCenter_pw: ")

 

si = connect_vcenter(vCenter_ip, vCenter_id, vCenter_pw)

 

si.close()

 

if __name__ == '__main__':

main()