2017-01-19 2 views
1

esxiホストをメンテナンスモードにしてから、何らかの操作を行ってからメンテナンスモードを終了するようなピースコードを作成しようとしました。 がメンテナンスモードにESXiホストを置くために私はpysphereのコードを持って、そのは.MYコードをされて失敗している、メンテナンスモードを終了するには、しかし 作業そのエラーメッセージ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がvmwareによってサポートされている最新のAPIであることを知っています。誰かが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から十分に文書化し、アクティブなオープンソースプロジェクトであるので、あなたはdefinetely得ようとしている

は、メンテナンスモードに入りますそれらのための良いサポート。

これを調べることをおすすめします。 Vsphereで可能なすべての操作は、pyvmomiを使って行うことができます。ここで

は、メソッドのすべてのリストです: http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.wssdk.apiref.doc/index-methods.html

それを試してみるとそれが動作するかどうか私に教えてください。 pyvmomiを開始する

サンプル:downvoterへ http://vmware.github.io/pyvmomi-community-samples/

+0

.. uがdownvoteする理由を言及する必要があります。盲目的にそれをして、他の人を抑えなさい。 – undefined

関連する問題