OpenStack on Ubuntu: provider network does not go up

OpenStack on Ubuntu: provider network does not go up

or NetworkManager interfering

ยท

3 min read

Suppose you just brought up an OpenStack cluster, you deploy a VM and then you wanna access it via SSH. Of course, you can do it by injecting a key at start-up and by associating the VM a floating IP, coming from the pool you've chosen once you set up one of your external networks. Now you do all of that, you even followed all the instructions from the guide and yet your instances cannot be reached from outside the cluster.

The problem may be easier than you thought.

If you go on the official guide, it tells you to configure the provider network as unnumbered by editing the file at /etc/network/interfaces:

# The provider network interface
auto INTERFACE_NAME
iface INTERFACE_NAME inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down

This should work, usually. However, you may have counted your chicken before they're hatched (in Italian we say, fare i conti senza l'oste, literally did the (bill's) math without the innkeeper).

In fact, networking in Linux can be managed in different ways and with different tools. OpenStack uses the ifconfig toolset, but it may happen that the NetworkManager may also be active.

Ok, so before continuining, I guess a small excursus is due, quoting from here:

NetworkManager is a sort of settings daemon that makes sure that multiple users can edit network connections, this is very smart in a desktop environment (especially on laptops that might move around between different wireless networks). Basically NetworkManager is a frontend to iproute, dhclient, wpa_supplicant and ppp. ifconfig is a general tool for configuring network interfaces. ifup and ifdown are helper programs that use ifconfig to configure a network interface in accordance to /etc/network/interfaces this will make sure that if there are any up, down, pre-up, pre-down, post-up, post-down scripts that need to be run they will be.

What the option auto does is to bring up at boot time any interface that has it. However, what we believe is happening, at least on our Kubuntu 18.04, is that NetworkManager has some sort of priority over ifconfig and it decides it does not have to go up and consequently your provider network does not work.

A better solution would be to disable the NetworkManager, however it may also suffice to bring up the provider network manually by running ip link set dev INTERFACENAME up.

This has a caveat, though. If you reboot your system, you will find the interface again down. A workaround is to have this command be executed every time at reboot. There are several ways to achieve this, we did it by adding a task to the root crontab; it is essential that you add it to the root crontab file since the command should be run with super user privileges.

Once you've done all of this, you should be able to ssh into your newly deployed VMs.

Many ๐Ÿ™ to Carmine Colarusso () for the nice troubleshooting together.

ย