2017-01-19 17 views
1

esxi 호스트를 유지 관리 모드로 설정 한 다음 작동을 수행하고 유지 관리 모드를 종료하는 피스 피어 코드를 작성하려고했습니다. 유지 보수 모드로 ESXi 호스트를 넣으려면 내가 pysphere의 코드를 가지고와는 누군 코드입니다 실패 유지 보수 모드를 종료합니다 그러나 작업 그것의 오류 메시지가pysphere 또는 pyvomi에서 esxi의 유지 보수 모드를 종료하는 방법

Got None for nillable(False), minOccurs(1) element (urn:vim25,timeout), <ns1:ExitMaintenanceMode_Task xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:ns1="urn:vim25" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ExitMaintenanceModeRequestType"><ns1:_this>host-30</ns1:_this></ns1:ExitMaintenanceMode_Task> 

수있는 사람과 실패

def exit_maintenance_mode(host): 
    try : 
      host = host_mor(host) 
      request=VI.ExitMaintenanceMode_TaskRequestMsg() 
      _this = request.new__this(host) 
      _this.set_attribute_type(host.get_attribute_type()) 
      request.set_element__this(_this) 
      task = server._proxy.ExitMaintenanceMode_Task(request)._returnval 
      return VITask(task,server) 
    except Exception,e: 
      logger.console(e) 

이것을 구현하는 방법을 제안

나는 pyvmomi가 최신 API 인 vmware를 지원한다는 것을 알고 있습니다. 그렇다면 누구나 pyvmomi에서 이것을 구현하는 방법도 유용 할 것입니다.

답변

0

확인해 봤습니까?

유지 관리 모드를 입력 :

http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.wssdk.apiref.doc/vim.Datastore.html?path=4_2_0_2_5_5_0#enterMaintenanceMode

종료 유지 관리 모드 : http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.wssdk.apiref.doc/vim.Datastore.html?path=4_2_0_2_5_5_1#exitMaintenanceMode

pyvomi은 잘 문서화 및 VMware의 적극적인 오픈 소스 프로젝트, 그래서 너 확실히 얻을려고하고있다 그들에게 좋은 지원.

이 내용을 살펴 보시기 바랍니다. Vsphere를 통해 가능한 모든 작업은 pyvmomi를 사용하여 수행 할 수 있습니다. http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.wssdk.apiref.doc/index-methods.html

밖으로 그것을 시도하고 작동하는지 알려 주시기 바랍니다 : 여기에

는 방법의 모든 목록입니다.

샘플 pyvmomi 시작합니다 : http://vmware.github.io/pyvmomi-community-samples/

+0

downvoter에 .. 유 downvote하는 이유를 언급해야한다. 맹목적으로 그렇게하지 마십시오. – undefined