Skip to content

OpenStack Ansible OVS br-ex Preparation Tutorial

Purpose

This short tutorial explains how to check and prepare the external OVS bridge (br-ex) on a node before running OpenStack Ansible or Epoxy playbooks. The goal is to make sure br-ex exists as an OVS bridge and not as a Linux bridge. The external NIC (for example enp4s0f0) must be attached to this OVS bridge.

Steps

1. Check Current Network Setup

Run this command to see if a Linux bridge named br-ex already exists:

if [ -d /sys/class/net/br-ex/bridge ]; then echo "LINUX_BRIDGE"; else echo "NOT_LINUX_BRIDGE"; fi

If the output is LINUX_BRIDGE, then you have a Linux bridge that must be removed.

2. Verify Which NIC is Supposed to be Used for External Connectivity

Usually this is the interface connected to the external or office LAN (the one that will carry floating IPs). For example enp4s0f0.

Check that the NIC has link:

ethtool enp4s0f0 | grep "Link detected"

You should see Link detected: yes.

3. Check if OpenVSwitch is Installed

If it is not installed, do so now:

apt-get install -y openvswitch-switch

4. Clean Up Linux br-ex if it Exists

If a Linux bridge exists, remove it:

ip link delete br-ex || true

Make sure the NIC is free (not attached to any bridge):

ip link set dev enp4s0f0 nomaster || true

5. Create the OVS br-ex Bridge

ovs-vsctl --may-exist add-br br-ex

6. Add the External NIC to the OVS Bridge

ovs-vsctl --may-exist add-port br-ex enp4s0f0

7. Verify Configuration

Check that the NIC appears on the OVS bridge:

ovs-vsctl list-ports br-ex

You should see something like:

enp4s0f0
patch-provnet-xxxxx-to-br-int

Check the OVS bridge mappings:

ovs-vsctl get Open_vSwitch . external-ids:ovn-bridge-mappings

If empty, you can set it manually:

ovs-vsctl set Open_vSwitch . external-ids:ovn-bridge-mappings="office:br-ex"

8. Update Netplan to Avoid Conflicts

Edit /etc/netplan/50-cloud-init.yaml and make sure that the external NIC is listed under ethernets only and not inside a bridges: block.

Example:

network:
  version: 2
  ethernets:
    enp4s0f0:
      dhcp4: false
      dhcp6: false
      optional: true

Then apply changes:

netplan apply

9. Verify Final State

Run again:

if [ -d /sys/class/net/br-ex/bridge ]; then echo "LINUX_BRIDGE"; else echo "OK"; fi

and

ovs-vsctl list-ports br-ex

You should see OK and the NIC listed under br-ex.

Notes

  • Do not assign an IP address to br-ex for flat external networks; Neutron will handle the floating IPs.
  • Make sure openvswitch-switch service is enabled and running.
  • Repeat these steps on all nodes that participate in external networking.