OpenStack & GoBGP
OpenStack setup bringup
This section covers how FTAS works with OpenStack and GoBGP in a lab environment. Use it to understand where these components fit in the setup, what role they play in route and service validation, and what to prepare before running BGP-based test cases.
Two-node OpenStack cluster
OS02 — Controller + Compute OS03 — Compute
Ubuntu 22.04.5 LTS OpenStack Bobcat (2024.1) KVM/QEMU Hypervisor
1. Purpose and scope
This document is the definitive reference guide to run the automated OpenStack VM live-migration script.
2. Environment overview
The OpenStack cloud consists of two physical servers connected to a leaf-spine fabric. One server hosts all OpenStack control-plane services inside Linux containers, and both servers act as compute nodes where VMs run.
2.1 Physical server summary
Server 1
os02
10.20.x.x
Controller + Compute
10G to Leaf1
Server 2
os03
10.20.x.x
Dedicated Compute
10G to Leaf2
2.2 Key IP addresses example
10.20.x.x
os02
OS02 physical management interface (br-mgmt)
10.20.x.x
os03
OS03 physical management interface (br-mgmt)
10.20.x.x
VIP (Load Balancer)
All OpenStack API endpoints are reachable at this virtual IP
192.168.20.11
os02 mig-int
OS02 live-migration interface on VLAN 20
192.168.20.12
os03 mig-int
OS03 live-migration interface on VLAN 20
10.20.x.x/24
Management subnet
LXC containers and hypervisor management traffic
10.10.x.x/24
Tunnel subnet
VXLAN overlay tunnel traffic between nodes
192.168.20.0/24
VM and migration subnet
Tenant VMs and libvirt live-migration TCP stream
Keep all 192.168.x.x IPs the same as documented here. If you change one value, update every related command, port setting, route, and interface reference to match.
2.3 OpenStack LXC containers on OS02
All OpenStack control-plane services run inside Linux containers on OS02. These containers must all be in RUNNING state before executing the script.
os02-galera-container-0bb9da1e
10.20.x.x
MySQL/Galera database
os02-rabbit-mq-container-e57ae9a1
10.20.x.x
RabbitMQ message queue
os02-keystone-container-1d601d44
10.20.x.x
Keystone identity and authentication
os02-glance-container-142bd293
10.20.x.x
Glance image service
os02-nova-api-container-820a150c
10.20.x.x
Nova API, scheduler, and conductor
os02-neutron-server-container-7731d725
10.20.x.x
Neutron networking service
os02-cinder-api-container-752dfe2b
10.20.x.x
Cinder block storage service
os02-heat-api-container-ff75cc2a
10.20.x.x
Heat orchestration service
os02-horizon-container-7703010a
10.20.x.x
Horizon web dashboard
os02-memcached-container-6f74c143
10.20.x.x
Memcached token and session cache
os02-placement-container-f88213a0
10.20.x.x
Placement API
os02-repo-container-3f6647ec
10.20.x.x
Internal package repository mirror
os02-utility-container-9616c3ff
10.20.x.x
Utility container where the script runs
The utility container os02-utility-container-9616c3ff is the execution point for the migration script. It must be RUNNING, and the OpenRC credentials file must exist at /root/openrc.
3. Network architecture
Understanding the network layout is critical for diagnosing migration failures. Three independent networks serve different purposes in this environment.
3.1 Network planes summary
Management
10.20.x.x/24
br-mgmt
LXC communication and OpenStack API traffic
Tunnel (VXLAN)
10.10.x.x/24
br-vxlan
Overlay traffic between hosts
Provider (VLAN)
N/A (trunk)
br-vlan
Tenant VM traffic on physical VLANs
Migration (VLAN 20)
192.168.20.0/24
mig-int
Dedicated libvirt TCP channel for live memory transfer
3.2 VM network (mobility-test-net)
The script creates VMs on a pre-existing OpenStack network. This network must exist before the script runs.
Network name:
mobility-test-netNetwork type: VLAN (
provider: physnet1, segmentation ID20)Subnet name:
mobility-test-subnetSubnet CIDR:
192.168.20.0/24DHCP: enabled with allocation pool
192.168.20.2to192.168.20.254Gateway:
192.168.20.1
3.3 Live migration network
Live migration transfers a running VM's memory state from one hypervisor to the other over the network.
Transport: plain TCP on port
16509Interface:
mig-inton each hostOS02 migration IP:
192.168.20.11OS03 migration IP:
192.168.20.12Nova configuration key:
live_migration_scheme = tcplibvirt authentication:
auth_tcp = none
If TCP port 16509 is not reachable between OS02 and OS03 on the 192.168.20.0/24 subnet, all live migrations will fail.
4. Required OpenStack resources
The following resources must already exist before the script is executed.
4.1 Glance image
Image name
cirros
Image ID
26b0e1a3-e211-44a9-a9d1-84d52f04f797
Format
qcow2
Status
active
Size
~21 MB
Virtual size
~117 MB
Visibility
public
CPU mode
host-model (hw_cpu_mode=host-model)
Storage
File-backed at /var/lib/glance/images/ on OS02
4.2 Nova flavor
Flavor name
m1.tiny
RAM
512 MB
vCPUs
1
Root disk
1 GB
Ephemeral disk
0 GB
Swap
0 MB
Public
Yes
4.3 Nova compute services
Two compute nodes must be registered and in up state.
nova-conductor
os02-nova-api-container-*
enabled
up
Manages VM state in the database
nova-scheduler
os02-nova-api-container-*
enabled
up
Selects the target host
nova-compute
os02
enabled
up
Runs VMs on OS02
nova-compute
os03
enabled
up
Runs VMs on OS03
4.4 Nova hypervisors
os02
10.20.x.x
QEMU v6.2.0
up
enabled
os03
10.20.x.x
QEMU v6.2.0
up
enabled
5. Prerequisites checklist
Before running the migration script, verify every item in this checklist.
5.1 Hardware and OS prerequisites
H1
Both OS02 and OS03 are powered on and reachable via SSH
ping 10.20.x.x && ping 10.20.x.x
H2
Ubuntu 22.04.5 LTS is installed on both servers
lsb_release -a
H3
Kernel version 5.15.0+ is installed and KVM modules are loaded
uname -r && lsmod | grep kvm
H4
CPU virtualization is enabled
egrep -c '(vmx|svm)' /proc/cpuinfo
H5
Both hosts have at least 512 MB free RAM
free -h
H6
Both hosts have at least 2 GB free in /var/lib/nova
df -h /var/lib/nova
5.2 Network prerequisites
N1
br-mgmt is up on OS02
ip -br addr show br-mgmt
N2
br-mgmt is up on OS03
ip -br addr show br-mgmt
N3
VIP 10.20.x.x is reachable
ping -c 3 10.20.x.x
N4
mig-int is up on OS02
ip -br addr show mig-int
N5
mig-int is up on OS03
ip -br addr show mig-int
N6
OS02 can reach OS03 on the migration port
nc -zv 192.168.20.12 16509
N7
OS03 can reach OS02 on the migration port
nc -zv 192.168.20.11 16509
N8
br-vlan is up on both hosts
ip -br link show br-vlan
N9
OVS bridges br-int and br-vlan exist
ovs-vsctl show
N10
Leaf uplinks are active
ethtool enp24s0f0 | grep 'Link detected'
5.3 OpenStack service prerequisites
Run these commands in the utility container unless stated otherwise.
S1
All 13 LXC containers on OS02 are in RUNNING state
lxc-ls -f
S2
Keystone authentication works
openstack token issue
S3
nova-compute on os02 is up
openstack compute service list
S4
nova-compute on os03 is up
openstack compute service list
S5
nova-conductor and nova-scheduler are up
openstack compute service list
S6
Both hypervisors are visible and up
openstack hypervisor list
S7
The cirros image exists and is active
openstack image list
S8
The m1.tiny flavor exists
openstack flavor list
S9
The mobility-test-net network exists
openstack network list
S10
The mobility-test-subnet subnet exists
openstack subnet list
S11
Glance is healthy
openstack image list
S12
Neutron agents are healthy on both nodes
openstack network agent list
5.4 libvirt prerequisites
L1
libvirtd is running on OS02
systemctl status libvirtd
L2
libvirtd is running on OS03
systemctl status libvirtd
L3
libvirt listens on TCP port 16509 on OS02
ss -tulnp | grep 16509
L4
libvirt listens on TCP port 16509 on OS03
ss -tulnp | grep 16509
L5
nova-compute was restarted after any kernel upgrade
systemctl status nova-compute
L6
No stale virsh domains block migration slots
virsh list --all
5.5 Credential prerequisites
C1
OpenRC exists at /root/openrc in the utility container
cat /root/openrc
C2
OS_AUTH_URL points to http://10.20.x.x:5000/v3
grep OS_AUTH_URL /root/openrc
C3
Admin credentials are valid
source /root/openrc && openstack token issue
C4
Root SSH between OS02 and OS03 works
ssh 10.20.x.x hostname
6. Accessing the utility container
The script must be launched from inside the OpenStack utility container.
Step 1: SSH into OS02
Step 2: Attach to the utility container
After this command, the shell prompt changes to:
Step 3: Load OpenStack credentials
Load the credentials each time you open a new shell inside the container.
Step 4: Verify the environment is ready
7. What the script does
The script automates a continuous demonstration of OpenStack live migration.
Phase 1 — VM creation
The script creates a new VM using:
Image:
cirrosFlavor:
m1.tinyNetwork:
mobility-test-net
The VM receives an IP address from 192.168.20.0/24 through DHCP and starts in ACTIVE state.
Phase 2 — Continuous live migration loop
The script:
identifies the current host of the VM
triggers
openstack server migrate --livetoward the other hostwaits for the VM to return to
ACTIVErepeats the move in the opposite direction
During migration, Nova transfers the VM memory state between the hosts over mig-int on TCP port 16509.
Migration types demonstrated
Live migration
VM memory is copied while the guest keeps running
Near-zero
Block migration
VM disk data is also copied because shared storage is absent
Near-zero, but longer
8. Post-run verification commands
Run these commands inside the utility container after the script starts.
8.1 Check VM location and status
8.2 List all VMs
Expected result: one or more VMs in ACTIVE state on mobility-test-net.
8.3 List running VMs on each hypervisor
8.4 Check compute services
Every service should show State = up and Status = enabled.
8.5 Verify migration traffic flow
From OS02:
From OS03:
Both commands must return succeeded or open.
GoBGP setup bringup
Configure allowed address pairs for a VM port
For mobility and multi-IP test cases, the VM port must accept additional IP addresses. In OpenStack, configure this with allowed address pairs on the Neutron port attached to the VM.
Find the VM and its port
Log in to the utility container and load the OpenStack environment:
List the VM and capture its server ID:
Example output:
Use the server ID to find the attached port:
Example output:
Verify the port details
Inspect the port before making changes:
Confirm these values:
The port status is
ACTIVE.The port is bound to the expected compute host.
The VM MAC address matches the interface you plan to use.
Add the extra IP addresses
Set the allowed address pairs on the port:
This keeps the port MAC address unchanged and allows the VM to use the additional IP addresses on the same interface.
Verify the update
Check that the allowed address pairs were applied:
Example output:
Configure a GoBGP remote VTEP on Ubuntu
This example uses an Ubuntu 22.04 VM as a remote VXLAN VTEP for a SONiC leaf. The VM connects on Vlan20, advertises its loopback through IPv4 unicast, and sends an EVPN Type-3 IMET route through GoBGP.
Prerequisites
Install the GoBGP package before setup.
Use GoBGP version
3.14.0.Ensure the
gobgpdandgobgpbinaries are available in/usr/local/bin.
Key requirements:
The VM interface must use a static IP on the VLAN-facing network.
The VTEP loopback IP must be reachable from the switch.
The OpenStack port must allow the extra loopback IP.
The EVPN Type-3 route must include a PMSI ingress-replication attribute.
If the VM runs in OpenStack, add the VTEP loopback IP to the VM port allowed address pairs before testing. Without this, OVN port security drops traffic destined to the loopback IP.
Example setup script
What this script configures
Static addressing on
ens3Kernel handling for loopback-based VTEP traffic
A local VXLAN interface for
VNI 10020A GoBGP session toward the switch
IPv4 advertisement for loopback reachability
An EVPN Type-3 IMET route with PMSI ingress replication
Validated runtime state
The following state was verified on the Ubuntu VM after setup:
ens3uses192.168.20.36/24the default route points to
192.168.20.1loincludes10.20.30.33/32vxlan10020is up withlocal 10.20.30.33net.ipv4.conf.lo.accept_local = 1net.ipv4.conf.ens3.accept_local = 1net.ipv4.conf.all.rp_filter = 0net.ipv4.conf.ens3.rp_filter = 0GoBGP 3.14.0 runs from
/usr/local/bin/gobgpdthe BGP session to
192.168.20.1inAS 65000is established
In this lab, the loopback also carries these additional /32 IP addresses:
192.168.100.1/32192.168.100.101/32
If you want to inspect the netplan file directly, use sudo:
Re-add the IMET route with PMSI
If the switch receives the Type-3 route but show vxlan remotevtep stays empty, remove the old IMET route and add it again with the PMSI attribute:
After the re-add, verify that the EVPN RIB includes:
route type
multicastrd 10.20.30.33:2rt 65000:10020nexthop 10.20.30.33Pmsi: type: ingress-repl, label: 10020, tunnel-id: 10.20.30.33
Verify on the SONiC side
After the script runs, validate the control plane and VTEP programming on the switch:
Last updated
Was this helpful?
