请注意:本网站包含无障碍系统。 按 Control-F11 将网站调整为使用屏幕阅读器的视障人士;按 Control-F10 打开辅助功能菜单。

AHV主機網絡

AHV主機網絡

AHV主機網絡

這份文件為翻譯程式自動翻譯結果,請點選以下連結流灠英文版文件內容。

描述

Nutanix 支援入口網站上的文件介紹了 AHV 網路。

解決方案

注意:請勿在使用者 VM 或 CVM 介面(vnet 介面)上使用任何這些命令。

涵蓋的主題:

開放 vSwitch 配置

Nutanix AHV 主機預先設定了 Open vSwitch。 “ovs-vsctl show”指令將列印 Open vSwitch 配置的概述:

 [root@ahv ~]#  ovs-vsctl show e0d89b99-335d-417f-9fd1-4a0cb8db711e    Bridge "br0"        Port "br0"            Interface "br0"                type: internal        Port "vnet0"            Interface "vnet0"        Port "bond0"            Interface "eth2"            Interface "eth1"            Interface "eth0"    ovs_version: "1.10.0"

有一個名為“br0”的網橋,有多個連接埠。

  • 連接埠「br0」是網橋 br0 上的內部介面。這是AHV主機的外部管理介面。
  • 連接埠「vnet0」是 CVM(控制器 VM)使用的虛擬介面連接埠。
  • 連接埠「bond0」或連接埠「br0-up」是包含來自 AHV 主機的多個實體介面的綁定連接埠。

注意:在 AOS 5.5 中,引入了橋鏈,因此,您可以在「ovs-vsctl show」輸出中看到更多橋。
[回到頂部]

管理_ovs實用程序

Nutanix 提供了一個名為「manage_ovs」的實用程序,該實用程式安裝在每個 CVM 上,用於管理 AHV 主機上的 Open vSwitch 配置。有關使用的詳細信息,請參閱“manage_ovs --helpshort”輸出。

AOS 5.10.2 的輸出範例:

 nutanix@cvm$ manage_ovs --helpshort USAGE: manage_ovs [flags] Where is one of the following: show_bridges: Shows a list of the uplink bridges. show_interfaces: Shows a list of host physical interfaces. show_uplinks: Shows the current uplink configuration for the OVS bridge. update_uplinks: Updates the uplink configuration for the OVS bridge. enable_bridge_chain: Enables bridge chaining on the host. disable_bridge_chain: Disables bridge chaining on the host. create_single_bridge: Adds one OVS bridge to the host. delete_single_bridge: Removes one OVS bridge from the host. The update_uplinks action requires the --interfaces flag, which indicates the desired set of uplinks for the OVS bridge. The script will remove any existing uplinks from the bridge, and replace them with the specified set of uplinks on a single bonded port. flags: /usr/local/nutanix/cluster/bin/manage_ovs: --bond_mode: Bond mode to use: active-backup, balance-slb, or balance-tcp (default: 'active-backup') --bond_name: Bond name to use --bridge_name: Openvswitch on which to operate (default: '') --[no]dry_run: Just print what would be done instead of doing it (default: 'false') --[no]enable_vlan_splinters: Enable VLAN splintering on uplink interfaces (default: 'true') --[no]force: Reconfigure the bridge even if the the set of uplinks has not changed (default: 'false') -?,--[no]help: show this help --[no]helpshort: show usage only for this module --[no]helpxml: like --help, but generates XML output --host: Host on which to operate (default: '192.168.5.1') --interfaces: Comma-delimited list of interfaces to configure as bridge uplinks, or a keyword based on the NIC speed: all, 100g, 40g, 10g, 1g, etc. --[no]json: Output in json format. (default: 'false') --lacp_fallback: If LACP negotiation fails, set the bond_mode to active-backup: true, false (default: 'true') --lacp_mode: LACP mode for the uplink bond: off, slow, or fast (default: 'off') --mtu: Maximum transmission unit (an integer) --num_arps: Number of gratuitous ARPs to send on the bridge interface after updating uplinks (default: '3') (an integer) --[no]prevent_network_loop: Enables network loop prevention when bridge chain is enabled. (default: 'false') --[no]require_link: Require that at least one uplink has link status (default: 'true') 
  nutanix@cvm$ manage_ovs --helpshort USAGE: manage_ovs [flags] Where is one of the following: show_bridges: Shows a list of the uplink bridges. show_interfaces: Shows a list of host physical interfaces. show_uplinks: Shows the current uplink configuration for the OVS bridge. update_uplinks: Updates the uplink configuration for the OVS bridge. enable_bridge_chain: Enables bridge chaining on the host. disable_bridge_chain: Disables bridge chaining on the host. create_single_bridge: Adds one OVS bridge to the host. delete_single_bridge: Removes one OVS bridge from the host. The update_uplinks action requires the --interfaces flag, which indicates the desired set of uplinks for the OVS bridge. The script will remove any existing uplinks from the bridge, and replace them with the specified set of uplinks on a single bonded port. flags: /usr/local/nutanix/cluster/bin/manage_ovs: --bond_mode: Bond mode to use: active-backup, balance-slb, or balance-tcp (default: 'active-backup') --bond_name: Bond name to use --bridge_name: Openvswitch on which to operate (default: '') --[no]dry_run: Just print what would be done instead of doing it (default: 'false') --[no]enable_vlan_splinters: Enable VLAN splintering on uplink interfaces (default: 'true') --[no]force: Reconfigure the bridge even if the the set of uplinks has not changed (default: 'false') -?,--[no]help: show this help --[no]helpshort: show usage only for this module --[no]helpxml: like --help, but generates XML output --host: Host on which to operate (default: '192.168.5.1') --interfaces: Comma-delimited list of interfaces to configure as bridge uplinks, or a keyword based on the NIC speed: all, 100g, 40g, 10g, 1g, etc. --[no]json: Output in json format. (default: 'false') --lacp_fallback: If LACP negotiation fails, set the bond_mode to active-backup: true, false (default: 'true') --lacp_mode: LACP mode for the uplink bond: off, slow, or fast (default: 'off') --mtu: Maximum transmission unit (an integer) --num_arps: Number of gratuitous ARPs to send on the bridge interface after updating uplinks (default: '3') (an integer) --[no]prevent_network_loop: Enables network loop prevention when bridge chain is enabled. (default: 'false') --[no]require_link: Require that at least one uplink has link status (default: 'true')
   
   nutanix@cvm$ manage_ovs --helpshort USAGE: manage_ovs [flags] Where is one of the following: show_bridges: Shows a list of the uplink bridges. show_interfaces: Shows a list of host physical interfaces. show_uplinks: Shows the current uplink configuration for the OVS bridge. update_uplinks: Updates the uplink configuration for the OVS bridge. enable_bridge_chain: Enables bridge chaining on the host. disable_bridge_chain: Disables bridge chaining on the host. create_single_bridge: Adds one OVS bridge to the host. delete_single_bridge: Removes one OVS bridge from the host. The update_uplinks action requires the --interfaces flag, which indicates the desired set of uplinks for the OVS bridge. The script will remove any existing uplinks from the bridge, and replace them with the specified set of uplinks on a single bonded port. flags: /usr/local/nutanix/cluster/bin/manage_ovs: --bond_mode: Bond mode to use: active-backup, balance-slb, or balance-tcp (default: 'active-backup') --bond_name: Bond name to use --bridge_name: Openvswitch on which to operate (default: '') --[no]dry_run: Just print what would be done instead of doing it (default: 'false') --[no]enable_vlan_splinters: Enable VLAN splintering on uplink interfaces (default: 'true') --[no]force: Reconfigure the bridge even if the the set of uplinks has not changed (default: 'false') -?,--[no]help: show this help --[no]helpshort: show usage only for this module --[no]helpxml: like --help, but generates XML output --host: Host on which to operate (default: '192.168.5.1') --interfaces: Comma-delimited list of interfaces to configure as bridge uplinks, or a keyword based on the NIC speed: all, 100g, 40g, 10g, 1g, etc. --[no]json: Output in json format. (default: 'false') --lacp_fallback: If LACP negotiation fails, set the bond_mode to active-backup: true, false (default: 'true') --lacp_mode: LACP mode for the uplink bond: off, slow, or fast (default: 'off') --mtu: Maximum transmission unit (an integer) --num_arps: Number of gratuitous ARPs to send on the bridge interface after updating uplinks (default: '3') (an integer) --[no]prevent_network_loop: Enables network loop prevention when bridge chain is enabled. (default: 'false') --[no]require_link: Require that at least one uplink has link status (default: 'true')
   
  nutanix@cvm$ manage_ovs --helpshort USAGE: manage_ovs [flags] Where is one of the following: show_bridges: Shows a list of the uplink bridges. show_interfaces: Shows a list of host physical interfaces. show_uplinks: Shows the current uplink configuration for the OVS bridge. update_uplinks: Updates the uplink configuration for the OVS bridge. enable_bridge_chain: Enables bridge chaining on the host. disable_bridge_chain: Disables bridge chaining on the host. create_single_bridge: Adds one OVS bridge to the host. delete_single_bridge: Removes one OVS bridge from the host. The update_uplinks action requires the --interfaces flag, which indicates the desired set of uplinks for the OVS bridge. The script will remove any existing uplinks from the bridge, and replace them with the specified set of uplinks on a single bonded port. flags: /usr/local/nutanix/cluster/bin/manage_ovs: --bond_mode: Bond mode to use: active-backup, balance-slb, or balance-tcp (default: 'active-backup') --bond_name: Bond name to use --bridge_name: Openvswitch on which to operate (default: '') --[no]dry_run: Just print what would be done instead of doing it (default: 'false') --[no]enable_vlan_splinters: Enable VLAN splintering on uplink interfaces (default: 'true') --[no]force: Reconfigure the bridge even if the the set of uplinks has not changed (default: 'false') -?,--[no]help: show this help --[no]helpshort: show usage only for this module --[no]helpxml: like --help, but generates XML output --host: Host on which to operate (default: '192.168.5.1') --interfaces: Comma-delimited list of interfaces to configure as bridge uplinks, or a keyword based on the NIC speed: all, 100g, 40g, 10g, 1g, etc. --[no]json: Output in json format. (default: 'false') --lacp_fallback: If LACP negotiation fails, set the bond_mode to active-backup: true, false (default: 'true') --lacp_mode: LACP mode for the uplink bond: off, slow, or fast (default: 'off') --mtu: Maximum transmission unit (an integer) --num_arps: Number of gratuitous ARPs to send on the bridge interface after updating uplinks (default: '3') (an integer) --[no]prevent_network_loop: Enables network loop prevention when bridge chain is enabled. (default: 'false') --[no]require_link: Require that at least one uplink has link status (default: 'true')
 

AOS 5.19 或更高版本

可以使用 Prism Element 或 Prism Central UI 管理主機網路配置。 有關虛擬交換器的更多信息,請參閱關於虛擬交換機一章。有關如何管理虛擬交換器的信息,請參閱建立或更新虛擬交換器一章。
[回到頂部]

附加資訊

新增或移除 CVM 和 AHV 主機的 VLAN 標記的步驟

透過使用 IPMI 連接到主機並開啟遠端控制台來執行所有 AHV 主機和 CVM 網路變更。在實體交換器層級進行 VLAN 變更而不按照這些步驟協調主機變更可能會導致 CVM 存取和連線問題,並可能導致 UVM 停機,並且在 VLAN 配置完成之前無法從 Prism Central 或 Prism Element 存取叢集或解決任何不匹配問題。建議在維護模式下一次對一個主機/CVM/上行鏈路綁定/交換器連接埠執行此類更改,完成單一主機/CVM 並使其重新聯機,然後再移至下一個主機/CVM。請參閱KB4639 -如何將 CVM 和主機置於維護模式
另請參閱: AHV 管理指南/ 使用 Open vSwitch 進行第 2 層網路管理/ VLAN 配置

若要變更 AHV 主機上的 VLAN,請執行下列命令:

 [root@ahv ~]# ovs-vsctl set port br0 tag=<vlan tag>

注意:確保您更新的是br0 ,而不是 br0-up 或 bond0 連接埠。如果 VLAN 指派給 br0-up 或 bond0,則 CVM 和主機可能會失去網路連線。如果 VLAN 已指派給 br-up 或 bond0,請執行下列命令將其刪除:

 [root@ahv ~]# ovs-vsctl remove port br0-up tag <vlan tag>

使用“ovs-vsctl show”指令驗證變更。正確的配置應該如下所示:

 [root@ahv ~]# ovs-vsctl show ... Bridge "br0" ... Port "br0-up" Interface "eth2" Interface "eth3" Port "br0" tag: 1234 <<<<< Correct vlan tag location for AHV host Interface "br0" type: internal ...

若要變更 CVM 上的 VLAN,請使用您要設定的 VLAN 標記(標記為 X)執行下列命令:

 nutanix@cvm$ change_cvm_vlan <vlan tag>

注意:請勿從 AHV 主機使用 ovs-vsctl 指令為 CVM(在 vnet0 上)設定 VLAN 標記。請改為使用 CVM 中的change_cvm_vlan 指令。

若要從 AHV 主機上移除 VLAN 標記,請在開啟遠端控制台後執行下列命令:

 [root@ahv ~]# ovs-vsctl set port br0 tag=0

若要從 CVM 中刪除 VLAN 標記,請依照下列步驟操作:

  • 透過遠端控制台登入AHV主機
  • 從主機透過 SSH 連接到 CVM(始終透過 SSH 連接到 192.168.5.254 位址):
     [root@ahv ~]# ssh nutanix@192.168.5.254
  • 在雲端伺服器上執行以下命令:
     nutanix@cvm$ change_cvm_vlan --remove

[回到頂部]

LACP配置

請遵循KB-3263如何在 AHV 中啟用、停用和驗證 LACP。

如何找到主機網路卡的 MAC 位址

  • 在 AHV 主機上執行下列命令:
 [root@ahv ~]# ethtool -P <interface>

範例輸出:

 [root@ahv ~]# ethtool -P eth3 Permanent address: 00:25:90:cb:39:27
  • 在 AHV 主機上執行下列命令:
 [root@ahv ~]# ifconfig <interface>

範例輸出:

 [root@ahv ~]# ifconfig eth3 eth3 Link encap:Ethernet HWaddr 00:25:90:CB:39:27 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:46857327754 errors:0 dropped:228250 overruns:0 frame:0 TX packets:49134503170 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:49893674683483 (45.3 TiB) TX bytes:54855610562476 (49.8 TiB)


[回到頂部]

主備綁定模式下如何選擇主用網路卡

預設情況下,在啟動期間,AHV 會隨機選擇綁定的 NIC 之一並使其處於活動狀態。所有其他 NIC 都被指派了備份角色,並且只有在活動 NIC 發生故障時才會啟動它們。
如果您想要將首選 NIC 設定為主網卡,可以使用下列指令(AOS 5.15.4 及更高版本):

 ovs-vsctl set port other_config:bond-primary= 
  ovs-vsctl set port other_config:bond-primary=
   
  ovs-vsctl set port other_config:bond-primary=
 

例如:

 ovs-vsctl set port br0-up other_config:bond-primary=eth2

若要檢查哪個 NIC 處於活動狀態和/或首選,請連線至 AHV 主機並執行下列命令:

 [root@ahv ~]# ovs-appctl bond/show

在命令輸出中,活動介面將被標記為活動從介面。在下面的範例中,eth3 是 br0-up 綁定中的活動介面:

 [root@ahv ~]# ovs-appctl bond/show ---- br0-up ---- bond_mode: active-backup active-backup primary: eth2 ... slave eth2: enabled may_enable: true slave eth3: enabled active slave may_enable: true

若要變更活動網路卡,請連線至 AHV 主機並執行下列命令:

 [root@ahv ~]# ovs-appctl bond/set-active-slave <bond name> <interface name>

例子:

 [root@ahv ~]# ovs-appctl bond/set-active-slave br0-up eth2 done

現在,當您檢查 bond/show 輸出時,您可以看到 eth2 介面顯示為活動從設備

例子:

 [root@ahv ~]# ovs-appctl bond/show ---- br0-up ---- bond_mode: active-backup ... slave eth2: enabled        active slave        may_enable: true slave eth3: enabled        may_enable: true

[回到頂部]

將 1G 介面與 10G 介面的綁定分開

有關工作流程的詳細說明,請查看KB 8835
[回到頂部]

具有單一上行鏈路的網橋

有關工作流程的詳細說明,請查看KB 8015
[回到頂部]

已知的問題

症狀: manage_ovs 失敗並出現「ovs-vsctl:未找到」錯誤:

 CRITICAL manage_ovs:166 Failed to execute ovs command: list-br ... stderr: sh: ovs-vsctl: not found ...

解決方案:確保底層虛擬機器管理程序是 AHV。如果使用其他虛擬機器管理程序,請參閱其供應商的文檔,以了解如何從命令列管理網路。

症狀: manage_ovs 失敗,並顯示「叢集 ARP 和 DHCP IP 未初始化」。嘗試建立附加橋時發生錯誤:

 2019-10-24 01:55:57 ERROR manage_ovs:602 OVS error (192.168.5.1 create_single_bridge): Cluster ARP and DHCP ip not initialized.

解決方案:確保要新增網橋的節點是現有叢集的一部分。 Manage_ovs 不支援在未加入叢集的節點上建立新橋。
[回到頂部]

相關文章

文件ID:HT516499
原始發布日期:05/17/2024
Last Modified Date:05/30/2024