AHV-Host-Netzwerk

AHV-Host-Netzwerk

AHV-Host-Netzwerk

Dieser Beitrag wurde maschinell übersetzt. Für die englische Originalversion bitte hier klicken.

Beschreibung

AHV-Netzwerke werden in der Dokumentation behandelt, die auf dem Nutanix-Supportportal verfügbar ist.

Lösung

Hinweis: Verwenden Sie keinen dieser Befehle auf Benutzer-VM- oder CVM-Schnittstellen (VNET-Schnittstellen).

Behandelten Themen:

Öffnen Sie die vSwitch-Konfiguration

Nutanix AHV-Hosts werden mit vorkonfiguriertem Open vSwitch geliefert. Der Befehl „ovs-vsctl show“ druckt eine Übersicht der Open vSwitch-Konfiguration aus:

 [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"

Es gibt eine Bridge namens „br0“ mit mehreren Ports.

  • Port „br0“ ist eine interne Schnittstelle auf der Brücke br0. Dies ist die externe Verwaltungsschnittstelle des AHV-Hosts.
  • Port „vnet0“ ist ein virtueller Schnittstellenport, den die CVM (Controller-VM) verwendet.
  • Port „bond0“ oder Port „br0-up“ ist ein verbundener Port, der mehrere physische Schnittstellen vom AHV-Host enthält.

Hinweis: In AOS 5.5 wurde die Bridge-Verkettung eingeführt. Daher können Sie in der Ausgabe „ovs-vsctl show“ mehr Bridges sehen.
[ Zurück nach oben ]

Dienstprogramm manage_ovs

Nutanix stellt ein Dienstprogramm namens „manage_ovs“ bereit, das auf jedem CVM installiert ist und zum Verwalten der Open vSwitch-Konfiguration auf dem AHV-Host verwendet werden sollte. Weitere Informationen zur Verwendung finden Sie in der Ausgabe von „manage_ovs --helpshort“.

Beispielausgabe von 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 oder neuer

Es ist möglich, die Hostnetzwerkkonfiguration mithilfe von Prism Element oder Prism Central UI zu verwalten. Weitere Informationen zu virtuellen Switches finden Sie im Kapitel „Informationen zu virtuellen Switches“. Informationen zum Verwalten von virtuellen Switches finden Sie im Kapitel „Erstellen oder Aktualisieren eines virtuellen Switches“ .
[ Zurück nach oben ]

Weitere Informationen

Schritte zum Hinzufügen oder Entfernen des VLAN-Tags des CVM- und AHV-Hosts

Führen Sie alle AHV-Host- und CVM-Netzwerkänderungen durch, indem Sie sich über IPMI mit dem Host verbinden und eine Remote-Konsole öffnen. Wenn Sie VLAN-Änderungen auf der Ebene des physischen Switches vornehmen, ohne die Host-Änderungen gemäß diesen Schritten zu koordinieren, kann dies zu CVM-Zugriffs- und Konnektivitätsproblemen führen und möglicherweise zu UVM-Ausfällen und dazu, dass der Cluster von Prism Central oder Prism Element aus nicht erreichbar ist, bis die VLAN-Konfiguration abgeschlossen oder etwaige Nichtübereinstimmungen behoben sind. Es wird empfohlen, solche Änderungen im Wartungsmodus jeweils für einen Host/CVM/Uplink-Bond/Switchport durchzuführen, einen einzelnen Host/CVM abzuschließen und ihn wieder online zu bringen, bevor Sie mit dem nächsten fortfahren. Siehe KB4639So versetzen Sie CVM und Host in den Wartungsmodus
Siehe auch: AHV Admin Guide / Layer 2 Netzwerkmanagement mit Open vSwitch / VLAN Konfiguration

Um das VLAN auf dem AHV-Host zu ändern, führen Sie den folgenden Befehl aus:

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

Hinweis: Stellen Sie sicher, dass Sie br0 und nicht den Port br0-up oder bond0 aktualisieren. Wenn VLAN br0-up oder bond0 zugewiesen ist, verlieren CVM und Host möglicherweise die Netzwerkkonnektivität. Falls VLAN br-up oder bond0 zugewiesen wurde, führen Sie den folgenden Befehl aus, um es zu entfernen:

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

Verwenden Sie den Befehl „ovs-vsctl show“, um Änderungen zu überprüfen. Die korrekte Konfiguration sollte folgendermaßen aussehen:

 [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 ...

Um das VLAN auf dem CVM zu ändern, führen Sie den folgenden Befehl mit dem VLAN-Tag (mit X markiert) aus, den Sie konfigurieren möchten:

 nutanix@cvm$ change_cvm_vlan <vlan tag>

Hinweis: Verwenden Sie nicht den Befehl ovs-vsctl vom AHV-Host, um das VLAN-Tag für den CVM (auf vnet0) festzulegen. Verwenden Sie stattdessen den Befehl change_cvm_vlan von CVM.

Um das VLAN-Tag vom AHV-Host zu entfernen, führen Sie nach dem Öffnen der Remote-Konsole den folgenden Befehl aus:

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

Um die VLAN-Markierung von CVM zu entfernen, gehen Sie wie folgt vor:

  • Melden Sie sich über die Remote-Konsole beim AHV-Host an
  • SSH vom Host zum CVM (immer SSH zur Adresse 192.168.5.254):
     [root@ahv ~]# ssh nutanix@192.168.5.254
  • Führen Sie den folgenden Befehl auf dem CVM aus:
     nutanix@cvm$ change_cvm_vlan --remove

[ Zurück nach oben ]

LACP-Konfiguration

Befolgen Sie KB-3263, um LACP in AHV zu aktivieren, zu deaktivieren und zu überprüfen.

So finden Sie die MAC-Adresse einer Host-NIC

  • Führen Sie den folgenden Befehl auf dem AHV-Host aus:
 [root@ahv ~]# ethtool -P <interface>

Beispielausgabe:

 [root@ahv ~]# ethtool -P eth3 Permanent address: 00:25:90:cb:39:27
  • Führen Sie den folgenden Befehl auf dem AHV-Host aus:
 [root@ahv ~]# ifconfig <interface>

Beispielausgabe:

 [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)


[ Zurück nach oben ]

So wählen Sie eine aktive Netzwerkkarte im Active-Backup-Bond-Modus aus

Standardmäßig wählt AHV beim Booten zufällig eine der verbundenen Netzwerkkarten aus und aktiviert sie. Allen anderen Netzwerkkarten werden Backup-Rollen zugewiesen und sie werden nur aktiviert, wenn die aktive Netzwerkkarte ausfällt.
Wenn Sie eine bevorzugte Netzwerkkarte als primäre Netzwerkkarte festlegen möchten, können Sie den folgenden Befehl verwenden (AOS 5.15.4 und höher):

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

Zum Beispiel:

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

Um zu überprüfen, welche Netzwerkkarte aktiv und/oder bevorzugt ist, stellen Sie eine Verbindung zum AHV-Host her und führen Sie den folgenden Befehl aus:

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

In der Befehlsausgabe wird die aktive Schnittstelle als aktiver Slave gekennzeichnet. Im folgenden Beispiel ist eth3 eine aktive Schnittstelle in der br0-up-Bindung:

 [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

Um die aktive Netzwerkkarte zu ändern, stellen Sie bitte eine Verbindung zum AHV-Host her und führen Sie den folgenden Befehl aus:

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

Beispiel:

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

Wenn Sie jetzt die Bond/Show-Ausgabe prüfen, können Sie sehen, dass die eth2-Schnittstelle als aktiver Slave angezeigt wird:

Beispiel:

 [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

[ Zurück nach oben ]

Trennen Sie 1G-Schnittstellen von einer Verbindung mit den 10G-Schnittstellen

Eine detaillierte Beschreibung des Arbeitsablaufs finden Sie in KB 8835 .
[ Zurück nach oben ]

Brücken mit einem einzigen Uplink

Eine detaillierte Beschreibung des Arbeitsablaufs finden Sie in KB 8015 .
[ Zurück nach oben ]

Bekannte Probleme

Symptom: manage_ovs schlägt mit dem Fehler „ovs-vsctl: nicht gefunden“ fehl:

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

Lösung: Stellen Sie sicher, dass der zugrunde liegende Hypervisor AHV ist. Wenn ein anderer Hypervisor verwendet wird, lesen Sie in der Dokumentation des Anbieters nach, wie Sie das Netzwerk über die Befehlszeile verwalten können.

Symptom: manage_ovs schlägt mit dem Fehler „Cluster-ARP und DHCP-IP nicht initialisiert“ fehl, wenn versucht wird, eine zusätzliche Brücke zu erstellen:

 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.

Lösung: Stellen Sie sicher, dass der Knoten, dem die Brücke hinzugefügt wird, Teil eines vorhandenen Clusters ist. manage_ovs unterstützt nicht das Erstellen neuer Brücken auf Knoten, die nicht mit dem Cluster verbunden sind.
[ Zurück nach oben ]

In Verbindung stehende Artikel

Dokumenten-ID:HT516499
Ursprüngliches Veröffentlichungsdatum:05/17/2024
Datum der letzten Änderung:05/30/2024