Utilize network CLIs to manage OVS (Open vSwitch) instances and make changes to multiple nodes

Open vSwitch (OVS)

  • Open vSwitch, or OVS, in short is an open source software switch.
  • It is installed and run in the Linux kernel.
  • It mimics a Layer 2 switch.
    • In other words, it learns MAC addresses and maintains a MAC address table.
    • It makes forwarding decisions based on these MAC addresses.
  • It has virtual ports and physical ports.
    • Virtual ports connect to virtual machines and physical ports connect to the physical switches.
  • Since all AHV hosts have a similarly configured open vSwitch called br0, these open vSwitches collectively appear like a distributed virtual switch.
open vswitch

There are several CLI shells in a Nutanix system. The CVM has a bash shell where you can execute commands such as manage_ovs, acli, allssh, and hostssh. We’ll get into the details of these commands in the following sections.

The AHV host has a bash shell as well, though it is rarely needed. The preference is to do everything possible from the CVM.

Every CVM has two special internal addresses that are local to that CVM and the AHV host it is connected to. The AHV host also has an internal address that the local CVM knows about. The CVM has address 192.168.5.254 which the local AHV host can ALWAYS use to reach the locally attached CVM.

The CVM also has address 192.168.5.2, which is used for storage traffic between the host and CVM. Usually this is the local CVM. However, if the local CVM is down the host will be directed to another CVM in the cluster to reach this address. Keep this in mind when making changes and connect to the 192.168.5.254 address if you want to guarantee that you’re connecting to the local CVM.

The AHV host has address 192.168.5.1 which the local CVM can use to ensure the local AHV host is reached over the internal bridge. This address won’t ever change or be redirected. Some commands like manage_ovs use this 192.168.5.1 address to send commands directly to the local AHV host.

allssh

  • Run on any CVM
  • allssh [“command to run”]
  • Executes on all CVMs as bash
  • Use quotes to be safe
  • Great for viewing. Use caution when making changes

hostssh

  • Run on any CVM
  • Executes on all hosts as bash
  • hostssh “ip link | grep mtu”

manage_ovs

  • Run from the CVM bash shell.
  • Order of flags is CRITICAL. Flags must be first and commands must be last.
  • Default flags are bridge=br0 and bond=br0-up
  • Configures only the local AHV host.
  • Often combined with allssh to run on all AHV hosts.

nutanix@cvm$ manage_ovs –help
USAGE: manage_ovs [flags]
manage_ovs –bridge_name –interfaces <interfaces> — require_link=false update_uplinks

ovs-vsctl

ovs-vsctl is an AHV command for managing an open vSwitch. We often use ovs-vsctl show to display the open vSwitch configuration and ovs-vsctl addbr to create a new open vSwitch.

open vswitch

Leave a Reply

Your email address will not be published. Required fields are marked *