在 ESXi 主機上具有許多傳輸節點和虛擬機器的大型環境中,ESXi 主機上執行的 NSX 代理程式在與 NSX Manager 通訊時可能會逾時。

問題

某些作業 (例如虛擬機器 vnic 嘗試附加至邏輯交換器) 會失敗。 /var/run/log/nsx-opsagent.log 包含如下的訊息:
level="ERROR" errorCode="MPA41542"] [MP_AddVnicAttachment] RPC call [0e316296-13-14] to NSX management plane timout
2017-05-15T05:32:13Z nsxa: [nsx@6876 comp="nsx-esx" subcomp="NSXA[VifHandlerThread:-2282640]" tid="1000017079" level="ERROR" errorCode="MPA42003"] [DoMpVifAttachRpc] MP_AddVnicAttachment() failed: RPC call to NSX management plane timout

原因

在大型環境中,部分作業可能花費的時間比平時要長,並因為超過預設逾時值而失敗。

解決方案

  1. 增加 NSX 代理程式逾時值 (秒)。
    1. 在 ESXi 主機上,使用下列命令停止 NSX Ops Agent:

      NSX 2.3 或更新版本上:

      /etc/init.d/nsx-opsagent stop

      NSX 2.1 或先前版本上:

      /etc/init.d/nsxa stop
    2. 編輯檔案 /etc/vmware/nsx-opsagent/nsxa.json,並變更 vifOperationTimeout 的值,例如從 25 秒變更為 55 秒。
      "mp" : {
          /* timeout for VIF operation */
          "vifOperationTimeout" : 25,
      備註: 此逾時值必須小於您在步驟 2 中設定的 hostd 逾時值。
    3. 使用下列命令啟動 NSX Ops Agent:
      /etc/init.d/nsx-opsagent start
  2. 增加 hostd 逾時值 (秒)。
    1. 在 ESXi 主機上,使用下列命令停止 hostd 代理程式:
      /etc/init.d/hostd stop
    2. 編輯檔案 /etc/vmware/hostd/config.xml。在 <opaqueNetwork> 下,取消 <taskTimeout> 項目的註解並變更值,例如從 30 秒變更為 60 秒。
      <opaqueNetwork>
          <!-- maximum message size allowed in opaque network manager IPC, in bytes. -->
          <!-- <maxMsgSize> 65536 </maxMsgSize> -->
          <!-- maximum wait time for opaque network response -->
          <!-- <taskTimeout> 30 </taskTimeout> -->
    3. 使用下列命令啟動 hostd 代理程式:
      /etc/init.d/hostd start