Sieć hostów AHV
Sieć hostów AHV
Sieć hostów AHV
Opis
Sieć AHV jest opisana w dokumentacji dostępnej na portalu wsparcia Nutanix.
- Początkową konfigurację opisano w Instrukcji instalacji w terenie:
Podręcznik instalacji terenowej Foundation 4.6.x - Podstawową konfigurację dla większości przypadków użycia opisano poniżej:
Podręcznik administratora AHV (wersja AOS 5.18)
Przewodnik po najlepszych praktykach AHV - Zaawansowana konfiguracja dla bardziej szczegółowych potrzeb jest opisana poniżej:
Przewodnik po najlepszych praktykach sieciowych AHV .
Rozwiązanie
Uwaga: nie używaj żadnego z tych poleceń w interfejsach User VM lub CVM (interfejsy vnet).
Omawiane tematy:
- Otwórz konfigurację vSwitch
- Manage_ovs Narzędzie
- Kroki, aby dodać lub usunąć znacznik VLAN hosta CVM i AHV
- Konfiguracja LACP
- Jak wybrać aktywną kartę sieciową w trybie aktywnego tworzenia kopii zapasowych
- Oddziel interfejsy 1G od połączenia z interfejsami 10G
- Mosty z pojedynczym łączem nadrzędnym
- Znane problemy
Otwórz konfigurację vSwitch
Hosty Nutanix AHV mają wstępnie skonfigurowany Open vSwitch. Polecenie „ovs-vsctl show” wyświetli przegląd konfiguracji 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"
Istnieje most o nazwie „br0” z kilkoma portami.
- Port „br0” to wewnętrzny interfejs mostka br0. Jest to zewnętrzny interfejs zarządzania hosta AHV.
- Port „vnet0” to wirtualny port interfejsu używany przez CVM (kontroler VM).
- Port „bond0” lub port „br0-up” to port połączony zawierający wiele interfejsów fizycznych z hosta AHV.
Uwaga: w systemie AOS 5.5 wprowadzono łączenie mostów, w rezultacie w wyniku „ovs-vsctl show” można zobaczyć więcej mostów.
[ Powrót do góry ]
Manage_ovs Narzędzie
Nutanix udostępnia narzędzie o nazwie „manage_ovs”, które jest instalowane na każdym CVM i powinno być używane do zarządzania konfiguracją Open vSwitch na hoście AHV. Zobacz dane wyjściowe „manage_ovs --helpshort”, aby uzyskać szczegółowe informacje na temat użycia.
Przykładowe dane wyjściowe z 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 lub nowszy
Możliwe jest zarządzanie konfiguracją sieci hosta za pomocą Prism Element lub Prism Central UI. Więcej informacji na temat przełączników wirtualnych można znaleźć w rozdziale Informacje o przełączniku wirtualnym. Informacje na temat zarządzania przełącznikami wirtualnymi można znaleźć w rozdziale Tworzenie lub aktualizowanie przełącznika wirtualnego .
[ Powrót do góry ]
Dodatkowe informacje
Kroki, aby dodać lub usunąć znacznik VLAN hosta CVM i AHV
Wykonaj wszystkie zmiany w sieci hosta AHV i CVM, łącząc się z hostem za pomocą protokołu IPMI i otwierając konsolę zdalną. Dokonywanie zmian w sieci VLAN na poziomie przełącznika fizycznego bez koordynowania zmian hosta zgodnie z tymi krokami może prowadzić do problemów z dostępem CVM i łącznością i potencjalnie prowadzić do przestoju UVM i braku dostępu do klastra z Prism Central lub Prism Element do czasu zakończenia konfiguracji VLAN lub wszelkie rozbieżności zostaną rozwiązane. Zaleca się przeprowadzanie takich zmian po jednym hoście/CVM/połączeniu łącza zwrotnego/portie przełącznika na raz w trybie konserwacji, kończąc pojedynczy host/CVM i przywracając go do trybu online przed przejściem do następnego. Zobacz KB4639 — Jak ustawić CVM i hosta w trybie konserwacji
Zobacz także: Podręcznik administratora AHV / Zarządzanie siecią warstwy 2 z konfiguracją Open vSwitch / VLAN
Aby zmienić sieć VLAN na hoście AHV, uruchom następujące polecenie:
[root@ahv ~]# ovs-vsctl set port br0 tag=<vlan tag>
Uwaga: Upewnij się, że aktualizujesz port br0 , a nie br0-up lub bond0. Jeśli sieć VLAN jest przypisana do br0-up lub bond0, wówczas CVM i host mogą utracić łączność sieciową. W przypadku, gdy sieć VLAN została przypisana do br-up lub bond0, uruchom następujące polecenie, aby ją usunąć:
[root@ahv ~]# ovs-vsctl remove port br0-up tag <vlan tag>
Aby zweryfikować zmiany, użyj polecenia „ovs-vsctl show”. Prawidłowa konfiguracja powinna wyglądać następująco:
[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 ...
Aby zmienić sieć VLAN w CVM, uruchom następujące polecenie ze znacznikiem VLAN (oznaczonym X), który chcesz skonfigurować:
nutanix@cvm$ change_cvm_vlan <vlan tag>
Uwaga: nie używaj polecenia ovs-vsctl z hosta AHV do ustawiania znacznika VLAN dla CVM (na vnet0). Zamiast tego użyj poleceniachange_cvm_vlan z CVM.
Aby usunąć tag VLAN z hosta AHV, po otwarciu konsoli zdalnej uruchom następujące polecenie:
[root@ahv ~]# ovs-vsctl set port br0 tag=0
Aby usunąć tagowanie VLAN z CVM, wykonaj poniższą procedurę:
- Zaloguj się do hosta AHV za pomocą konsoli zdalnej
- SSH z hosta do CVM (zawsze SSH na adres 192.168.5.254):
[root@ahv ~]# ssh nutanix@192.168.5.254
- Wykonaj następujące polecenie w CVM:
nutanix@cvm$ change_cvm_vlan --remove
[ Powrót do góry ]
Konfiguracja LACP
Postępuj zgodnie z KB-3263 Jak włączyć, wyłączyć i zweryfikować LACP w AHV.
Jak znaleźć adres MAC karty sieciowej hosta
- Wykonaj następujące polecenie na hoście AHV:
[root@ahv ~]# ethtool -P <interface>
Przykładowe wyjście:
[root@ahv ~]# ethtool -P eth3 Permanent address: 00:25:90:cb:39:27
- Wykonaj następujące polecenie na hoście AHV:
[root@ahv ~]# ifconfig <interface>
Przykładowe wyjście:
[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)
[ Powrót do góry ]
Jak wybrać aktywną kartę sieciową w trybie aktywnego tworzenia kopii zapasowych
Domyślnie podczas rozruchu AHV losowo wybiera jedną z powiązanych kart sieciowych i uaktywnia ją. Wszystkim pozostałym kartom sieciowym przypisano role zapasowe i zostaną one aktywowane tylko w przypadku awarii aktywnej karty sieciowej.
Jeśli chcesz ustawić preferowaną kartę sieciową jako podstawową, możesz użyć następującego polecenia (AOS 5.15.4 i nowsze wersje):
ovs-vsctl set port other_config:bond-primary=
ovs-vsctl set port other_config:bond-primary=
ovs-vsctl set port other_config:bond-primary=
Na przykład:
ovs-vsctl set port br0-up other_config:bond-primary=eth2
Aby sprawdzić, która karta sieciowa jest aktywna i/lub preferowana, połącz się z hostem AHV i uruchom następującą komendę:
[root@ahv ~]# ovs-appctl bond/show
W wynikach polecenia aktywny interfejs zostanie oznaczony jako aktywny slave . W poniższym przykładzie eth3 jest aktywnym interfejsem w wiązaniu 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
Aby zmienić aktywną kartę sieciową, połącz się z hostem AHV i uruchom następującą komendę:
[root@ahv ~]# ovs-appctl bond/set-active-slave <bond name> <interface name>
Przykład:
[root@ahv ~]# ovs-appctl bond/set-active-slave br0-up eth2 done
Teraz, gdy sprawdzisz wyjście bond/show, zobaczysz, że interfejs eth2 pojawia się jako aktywny slave :
Przykład:
[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
[ Powrót do góry ]
Oddziel interfejsy 1G od połączenia z interfejsami 10G
Sprawdź KB 8835, aby uzyskać szczegółowy opis przepływu pracy.
[ Powrót do góry ]
Mosty z jednym łączem nadrzędnym
Sprawdź KB 8015, aby uzyskać szczegółowy opis przepływu pracy.
[ Powrót do góry ]
Znane problemy
Objaw: zarządzanie_ovs kończy się niepowodzeniem z powodu błędu „ovs-vsctl: nie znaleziono”:
CRITICAL manage_ovs:166 Failed to execute ovs command: list-br ... stderr: sh: ovs-vsctl: not found ...
Rozwiązanie: Upewnij się, że podstawowym hypervisorem jest AHV. Jeśli używany jest inny hypervisor, zapoznaj się z dokumentacją jego dostawcy dotyczącą zarządzania siecią z wiersza poleceń.
Objaw: niepowodzenie narzędzia zarządzającego_ovs z komunikatem „Nie zainicjowano protokołu ARP klastra i adresu IP DHCP”. błąd podczas próby utworzenia dodatkowego mostu:
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.
Rozwiązanie: Upewnij się, że węzeł, do którego dodawany jest most, jest częścią istniejącego klastra. Manage_ovs nie obsługuje tworzenia nowych mostów na węzłach, które nie są przyłączone do klastra.
[ Powrót do góry ]
Powiązane artykuły
- Oryginalny artykuł w portalu Nutanix: Nutanix KB Artykuł: 2090
- Strona docelowa Nutanix