Redes de host AHV
Redes de host AHV
Redes de host AHV
Descripción
AHV Networking está cubierto en la documentación disponible en el portal de soporte de Nutanix.
- La configuración inicial se trata en la Guía de instalación en campo:
Guía de instalación de campo de Foundation 4.6.x - La configuración básica para la mayoría de los casos de uso se trata a continuación:
Guía de administración de AHV (versión AOS 5.18)
Guía de mejores prácticas de AHV - La configuración avanzada para necesidades más profundas se cubre a continuación:
Guía de mejores prácticas de redes AHV .
Solución
Nota: No utilice ninguno de esos comandos en interfaces de usuario VM o CVM (interfaces vnet).
Tópicos cubiertos:
- Abra la configuración de vSwitch
- Utilidad Manage_ovs
- Pasos para agregar o eliminar la etiqueta VLAN del host CVM y AHV
- Configuración LACP
- Cómo seleccionar NIC activa en modo de enlace de respaldo activo
- Separe las interfaces 1G de un vínculo con las interfaces 10G
- Puentes con un único enlace ascendente
- Problemas conocidos
Abra la configuración de vSwitch
Los hosts Nutanix AHV vienen con Open vSwitch preconfigurado. El comando 'ovs-vsctl show' imprimirá una descripción general de la configuración de 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"
Hay un Puente llamado "br0" con varios Puertos.
- El puerto "br0" es una interfaz interna en el puente br0. Esta es la interfaz de administración externa del host AHV.
- El puerto "vnet0" es un puerto de interfaz virtual que utiliza el CVM (Controlador VM).
- El puerto "bond0" o el puerto "br0-up" es un puerto vinculado que contiene múltiples interfaces físicas del host AHV.
Nota: En AOS 5.5, se introdujo el encadenamiento de puentes y, como resultado, puede ver más puentes en la salida "ovs-vsctl show".
[ Volver arriba ]
Utilidad Manage_ovs
Nutanix proporciona una utilidad llamada 'manage_ovs', que se instala en cada CVM y debe usarse para administrar la configuración de Open vSwitch en el host AHV. Consulte el resultado "manage_ovs --helpshort" para obtener detalles sobre el uso.
Salida de muestra de 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 o más reciente
Es posible gestionar la configuración de la red del host utilizando Prism Element o Prism Central UI. Consulte el capítulo Acerca del conmutador virtual para obtener más información sobre los conmutadores virtuales. Consulte el capítulo Creación o actualización de un conmutador virtual para obtener información sobre cómo administrar conmutadores virtuales.
[ Volver arriba ]
información adicional
Pasos para agregar o eliminar la etiqueta VLAN del host CVM y AHV
Realice todos los cambios en el host AHV y la red CVM conectándose al host mediante IPMI y abriendo una consola remota. Realizar cambios de VLAN en el nivel del conmutador físico sin coordinar los cambios de host según estos pasos puede provocar problemas de conectividad y acceso a CVM y, potencialmente, provocar un tiempo de inactividad de UVM y que no se pueda acceder al clúster desde Prism Central o Prism Element hasta que se complete la configuración de VLAN. o se resuelve cualquier discrepancia. Se recomienda realizar dichos cambios en un host/CVM/enlace ascendente/puerto de conmutación a la vez mientras se encuentra en modo de mantenimiento, completando un solo host/CVM y poniéndolo nuevamente en línea antes de pasar al siguiente. Consulte KB4639 : Cómo colocar CVM y host en modo de mantenimiento
Consulte también: Guía de administración de AHV / Administración de red de capa 2 con Open vSwitch / Configuración de VLAN
Para cambiar la VLAN en el host AHV, ejecute el siguiente comando:
[root@ahv ~]# ovs-vsctl set port br0 tag=<vlan tag>
Nota: Asegúrese de actualizar br0 y no el puerto br0-up o bond0. Si la VLAN se asigna a br0-up o bond0, entonces CVM y el host podrían perder la conectividad de red. En caso de que se haya asignado VLAN a br-up o bond0, ejecute el siguiente comando para eliminarla:
[root@ahv ~]# ovs-vsctl remove port br0-up tag <vlan tag>
Utilice el comando "ovs-vsctl show" para verificar los cambios. La configuración correcta debería verse así:
[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 ...
Para cambiar la VLAN en el CVM, ejecute el siguiente comando con la etiqueta VLAN (marcada con X) que desea configurar:
nutanix@cvm$ change_cvm_vlan <vlan tag>
Nota: No utilice el comando ovs-vsctl del host AHV para configurar la etiqueta VLAN para el CVM (en vnet0). En su lugar, utilice el comando change_cvm_vlan de CVM.
Para eliminar la etiqueta VLAN del host AHV, ejecute el siguiente comando después de abrir la consola remota:
[root@ahv ~]# ovs-vsctl set port br0 tag=0
Para eliminar el etiquetado VLAN de CVM, siga este procedimiento:
- Inicie sesión en el host AHV a través de la consola remota
- SSH desde el host al CVM (siempre SSH a la dirección 192.168.5.254):
[root@ahv ~]# ssh nutanix@192.168.5.254
- Ejecute el siguiente comando en el CVM:
nutanix@cvm$ change_cvm_vlan --remove
[ Volver arriba ]
Configuración LACP
Siga KB-3263 Cómo habilitar, deshabilitar y verificar LACP en AHV.
Cómo encontrar la dirección MAC de una NIC host
- Ejecute el siguiente comando en el host AHV:
[root@ahv ~]# ethtool -P <interface>
Salida de muestra:
[root@ahv ~]# ethtool -P eth3 Permanent address: 00:25:90:cb:39:27
- Ejecute el siguiente comando en el host AHV:
[root@ahv ~]# ifconfig <interface>
Salida de muestra:
[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)
[ Volver arriba ]
Cómo seleccionar NIC activa en modo de enlace de respaldo activo
De forma predeterminada, durante el tiempo de arranque, AHV selecciona aleatoriamente una de las NIC vinculadas y la activa. A todas las demás NIC se les asignan funciones de respaldo y solo se activarán si falla la NIC activa.
Si desea configurar una NIC preferida para que se seleccione como principal, puede usar el siguiente comando (AOS 5.15.4 y posterior):
ovs-vsctl set port other_config:bond-primary=
ovs-vsctl set port other_config:bond-primary=
ovs-vsctl set port other_config:bond-primary=
Por ejemplo:
ovs-vsctl set port br0-up other_config:bond-primary=eth2
Para verificar qué NIC está activa y/o preferida, conéctese al host AHV y ejecute el siguiente comando:
[root@ahv ~]# ovs-appctl bond/show
En la salida del comando, la interfaz activa se marcará como esclava activa . En el siguiente ejemplo, eth3 es una interfaz activa en el enlace 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
Para cambiar la NIC activa, conéctese al host AHV y ejecute el siguiente comando:
[root@ahv ~]# ovs-appctl bond/set-active-slave <bond name> <interface name>
Ejemplo:
[root@ahv ~]# ovs-appctl bond/set-active-slave br0-up eth2 done
Ahora, cuando verifica la salida de bond/show, puede ver que la interfaz eth2 aparece como esclavo activo :
Ejemplo:
[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
[ Volver arriba ]
Separe las interfaces 1G de un vínculo con las interfaces 10G
Consulte KB 8835 para obtener una descripción detallada del flujo de trabajo.
[ Volver arriba ]
Puentes con un único enlace ascendente
Consulte KB 8015 para obtener una descripción detallada del flujo de trabajo.
[ Volver arriba ]
Problemas conocidos
Síntoma: Manage_ovs falla con el error "ovs-vsctl: no encontrado":
CRITICAL manage_ovs:166 Failed to execute ovs command: list-br ... stderr: sh: ovs-vsctl: not found ...
Resolución: asegúrese de que el hipervisor subyacente sea AHV. Si se utiliza otro hipervisor, consulte la documentación del proveedor sobre cómo administrar la red desde la línea de comandos.
Síntoma: Manage_ovs falla con "Cluster ARP y DHCP IP no inicializados". Error al intentar crear un puente adicional:
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.
Resolución: asegúrese de que el nodo donde se agrega el puente sea parte de un clúster existente. Manage_ovs no admite la creación de nuevos puentes en nodos que no están unidos al clúster.
[ Volver arriba ]
Artículos relacionados
- Artículo original en Nutanix Portal: Artículo Nutanix KB: 2090
- Página de inicio de Nutanix