Rede de host AHV
Rede de host AHV
Rede de host AHV
Descrição
A rede AHV é abordada na documentação disponível no Portal de Suporte Nutanix.
- A configuração inicial é abordada no Guia de instalação em campo:
Guia de instalação em campo do Foundation 4.6.x - A configuração básica para a maioria dos casos de uso é abordada a seguir:
Guia de administração AHV (versão AOS 5.18)
Guia de melhores práticas de AHV - A configuração avançada para necessidades mais detalhadas é abordada a seguir:
Guia de práticas recomendadas de rede AHV .
Solução
Nota: Não use nenhum desses comandos nas interfaces User VM ou CVM (interfaces vnet).
Assuntos abordados:
- Abra a configuração do vSwitch
- Utilitário manager_ovs
- Etapas para adicionar ou remover a tag VLAN do host CVM e AHV
- Configuração LACP
- Como selecionar NIC ativo no modo de vínculo de backup ativo
- Interfaces 1G separadas de um vínculo com as interfaces 10G
- Pontes com um único uplink
- Problemas conhecidos
Abra a configuração do vSwitch
Os hosts Nutanix AHV vêm com Open vSwitch pré-configurado. O comando 'ovs-vsctl show' imprimirá uma visão geral da configuração do 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"
Existe uma ponte chamada "br0" com vários portos.
- A porta "br0" é uma interface interna na ponte br0. Esta é a interface de gerenciamento externo do host AHV.
- A porta "vnet0" é uma porta de interface virtual que o CVM (Controller VM) utiliza.
- A porta "bond0" ou porta "br0-up" é uma porta vinculada que contém várias interfaces físicas do host AHV.
Nota: No AOS 5.5, o encadeamento de pontes foi introduzido e, como resultado, você pode ver mais pontes na saída "ovs-vsctl show".
[ De volta ao topo ]
Utilitário manager_ovs
A Nutanix fornece um utilitário chamado 'manage_ovs', que é instalado em cada CVM e deve ser usado para gerenciar a configuração do Open vSwitch no host AHV. Consulte a saída "manage_ovs --helpshort" para obter detalhes sobre o uso.
Exemplo de saída do 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 ou mais recente
É possível gerenciar a configuração da rede host usando Prism Element ou Prism Central UI. Consulte o capítulo Sobre o switch virtual para obter mais informações sobre switches virtuais. Consulte o capítulo Criando ou atualizando um switch virtual para obter informações sobre como gerenciar switches virtuais.
[ De volta ao topo ]
Informações adicionais
Etapas para adicionar ou remover a tag VLAN do host CVM e AHV
Execute todas as alterações no host AHV e na rede CVM conectando-se ao host usando IPMI e abrindo um console remoto. Fazer alterações na VLAN no nível do switch físico sem coordenar as alterações no host de acordo com essas etapas pode levar a problemas de acesso e conectividade da CVM e potencialmente levar ao tempo de inatividade do UVM e ao cluster não ser acessível a partir do Prism Central ou do Prism Element até que a configuração da VLAN seja concluída ou qualquer incompatibilidade é resolvida. Recomenda-se realizar tais alterações em um host/CVM/uplink bond/switchport por vez enquanto estiver no modo de manutenção, completando um único host/CVM e colocando-o novamente online antes de passar para o próximo. Veja KB4639 - Como colocar CVM e host em modo de manutenção
Veja também: Guia de administração do AHV / Gerenciamento de rede de camada 2 com Open vSwitch / Configuração de VLAN
Para alterar a VLAN no host AHV, execute o seguinte comando:
[root@ahv ~]# ovs-vsctl set port br0 tag=<vlan tag>
Nota: Certifique-se de estar atualizando br0 e não a porta br0-up ou bond0. Se a VLAN for atribuída a br0-up ou bond0, o CVM e o host poderão perder a conectividade de rede. Caso a VLAN tenha sido atribuída a br-up ou bond0, execute o seguinte comando para removê-la:
[root@ahv ~]# ovs-vsctl remove port br0-up tag <vlan tag>
Use o comando "ovs-vsctl show" para verificar as alterações. A configuração correta deve ser assim:
[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 alterar a VLAN na CVM, execute o seguinte comando com a tag VLAN (marcada com X) que você deseja configurar:
nutanix@cvm$ change_cvm_vlan <vlan tag>
Nota: Não use o comando ovs-vsctl do host AHV para definir a tag VLAN para o CVM (em vnet0). Em vez disso, use o comando change_cvm_vlan da CVM.
Para remover a tag VLAN do host AHV, execute o seguinte comando após abrir o console remoto:
[root@ahv ~]# ovs-vsctl set port br0 tag=0
Para remover a marcação de VLAN do CVM, siga este procedimento:
- Faça login no host AHV via console remoto
- SSH do host para a CVM (sempre SSH para o endereço 192.168.5.254):
[root@ahv ~]# ssh nutanix@192.168.5.254
- Execute o seguinte comando na CVM:
nutanix@cvm$ change_cvm_vlan --remove
[ De volta ao topo ]
Configuração LACP
Siga KB-3263 Como ativar, desativar e verificar o LACP no AHV.
Como encontrar o endereço MAC de uma NIC host
- Execute o seguinte comando no host AHV:
[root@ahv ~]# ethtool -P <interface>
Exemplo de saída:
[root@ahv ~]# ethtool -P eth3 Permanent address: 00:25:90:cb:39:27
- Execute o seguinte comando no host AHV:
[root@ahv ~]# ifconfig <interface>
Exemplo de saída:
[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)
[ De volta ao topo ]
Como selecionar NIC ativo no modo de vínculo de backup ativo
Por padrão, durante o tempo de inicialização, o AHV seleciona aleatoriamente uma das NICs vinculadas e a torna ativa. Todas as outras NICs recebem funções de backup e só serão ativadas se a NIC ativa falhar.
Se quiser definir uma NIC preferencial para ser selecionada como primária, você pode usar o seguinte comando (AOS 5.15.4 e 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 exemplo:
ovs-vsctl set port br0-up other_config:bond-primary=eth2
Para verificar qual NIC está ativa e/ou preferencial, conecte-se ao host AHV e execute o seguinte comando:
[root@ahv ~]# ovs-appctl bond/show
Na saída do comando, a interface ativa será marcada como escravo ativo . No exemplo abaixo, eth3 é uma interface ativa no vínculo 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 alterar a NIC ativa, conecte-se ao host AHV e execute o seguinte comando:
[root@ahv ~]# ovs-appctl bond/set-active-slave <bond name> <interface name>
Exemplo:
[root@ahv ~]# ovs-appctl bond/set-active-slave br0-up eth2 done
Agora, ao verificar a saída bond/show, você pode ver que a interface eth2 aparece como escravo ativo :
Exemplo:
[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
[ De volta ao topo ]
Interfaces 1G separadas de um vínculo com as interfaces 10G
Verifique KB 8835 para obter uma descrição detalhada do fluxo de trabalho.
[ De volta ao topo ]
Pontes com um único uplink
Verifique KB 8015 para obter uma descrição detalhada do fluxo de trabalho.
[ De volta ao topo ]
Problemas conhecidos
Sintoma: manager_ovs falha com o erro "ovs-vsctl: not found":
CRITICAL manage_ovs:166 Failed to execute ovs command: list-br ... stderr: sh: ovs-vsctl: not found ...
Resolução: certifique-se de que o hipervisor subjacente seja AHV. Se outro hipervisor for usado, consulte a documentação do fornecedor sobre como gerenciar a rede a partir da linha de comando.
Sintoma: manage_ovs falha com "Cluster ARP e DHCP IP não inicializado". erro ao tentar criar uma ponte 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.
Resolução: Certifique-se de que o nó onde a ponte está sendo incluída faz parte de um cluster existente. manager_ovs não suporta a criação de novas pontes em nós que não estão associados ao cluster.
[ De volta ao topo ]
Artigos relacionados
- Artigo original no Portal Nutanix: Artigo Nutanix KB: 2090
- Página de destino da Nutanix