VirtualBox networking settings for OpenStack

The best way to learn OpenStack is by installing, running and playing with it directly. While most people use DevStack to accomplish this I prefer to setup a multi-node installation. This is important for me because much of my work related to OpenStack revolves around Networking. Another reason is that a multi-node installation is what real users of OpenStack will also be deploying.

In this blog, I will share the details of the VirtualBox based multi-node OpenStack installation. I will be focusing only on the networking aspects when using VirtualBox. I will also share some tips that are important in this deployment. This blog will not cover the steps to install and create a virtual machine using VirtualBox.

We will consider a two-node OpenStack setup with one node acting as API Server and Network Node (generally called Controller) and the second node acting as Compute node. We will also assume that VM instances require External network (Internet) access. The physical connectivity between the two nodes should be as follows:

VirtualBox OpenStack Networking

As you can see you need at least three network interfaces on the controller node and two on the compute node. But since we are going to run these as virtual box instances, I recommend an additional interface. And shortly I will explain why the additional interface is useful. The tables below shows how each interface or adapter needs to be configured on Virtual Box.

VirtualBox Network settings for Controller Node

Interface NameVirtualBox Network AdapterComments
eth0 (Management Network)Host-onlyEnsure that all nodes use the same Host-only Network Name
eth1 (Data Network)Internal NetworkEnsure that all nodes use the same Internal Network name. In the advanced settings, set Promiscuous mode to "Allow All"
eth2 (External Network)Host-onlyFor external network Host-only is sufficient. If the OpenStack VMs are able to reach the Host, then the objective of external network is achieved. But you can also use NAT.
eth3 (Additional Interface)NATThis adapter provides Internet access to the nodes to download packages etc.

VirtualBox Network settings for Compute Node

Interface NameVirtualBox Network AdapterComments
eth0 (Management Network)Host-onlyEnsure that all nodes use the same Host-only Network Name
eth1 (Data Network)Internal NetworkEnsure that all nodes use the same Internal Network name. In the advanced settings, set Promiscuous mode to "Allow All"
eth2 (Additional interface)NATThis adapter provides Internet access to the nodes to download packages etc.

Tip: it is important to enable Promiscuous mode on eth1, the data traffic interfaces on both compute and controller node. Without this setting packets will not reach from OpenStack tenant VMs (that will be started inside the compute node), to the OpenStack controller.

Why the additional interface

The additional interface is very useful if you are running your virtual box instances on a laptop. Let us see why?

  1. The eth0 interface on the OpenStack nodes is used for API requests and responses. Typically, it is also used to access the Horizon GUI or to execute CLI via SSH.
  2. In the settings above, the eth0 is realized using VirtualBox “Host-only” adapter. This ensures that all virtual machines on that “Host-only” network and the host laptop are able to talk to each other.
  3. We could have used either a bridge adapter or NAT. But both approaches have drawbacks. If your laptop was without network connectivity, bridge adapter will not work. And with NAT you will need Port forwarding to be configured to access Horizon/SSH on the VM. This is cumbersome. So host-only network is the best option for eth0.
  4. But the VM instances also need Internet access. So I recommend an additional interface of type NAT just to accomplish that.

In short, we have assigned separate network interfaces for Management Network and for Internet access for the OpenStack nodes (VirtualBox VMs).

Here are some useful links to learn more about VirtualBox Networking:

  1. VirtualBox Networking Manual
  2. How-to: VirtualBox Networking Part Two – NAT and Bridged
  3. How-to: VirtualBox Networking Part Three – Host-only and Internal