Devstack with VirtualBox on Windows


Devstack provides a convenient way to quickly deploy Openstack.  It can be deployed on a dedicated machine or using virtual machines.    If your new to Openstack, it’s a great way to evaluate it.   If your a developer then it is also a great way to test your latest features and patches, without having to run a production system.

This is a guide describes setting up Devstack using a Windows 7 laptop.  A vagrant file has been provided at the bottom to help automate the process.



Host Computer with the following

  • 8 GB RAM
  • 20 GB Free Disk Space
  • Windows 7 OS
  • VirtualBox > 5.X
  • Vagrant (optional but useful to automate the deployment)
  • Cygwin (optional but useful to allow you to ssh into the VM)
  • Fedora 23 iso (if your not using vagrant, then you’ll need the ISO to perform a basic install)


VirtualBox Setup

Devstack will run in a Fedora 23 virtual machine using VirtualBox as the hypervisor.  This setup will allow you to launch VMs and access them directly from your windows desktop.


We will use two networks

  • NAT
  • Host Only

The NAT network is the default in VirtualBox.  It provides your VM with external access.  All traffic is source NAT’d, providing the VM with access to the outside world.  The outside world can only access the VM if port mapping rules are setup.


The Host Only network provides your VM with an interface, that allows you to access the VM from your host computer.   This is the interface that you will use to SSH into the VM, as well as connect to any Openstack services.


Create the Host Only Network

Start by creating a host-only network in VirtualBox

  1. Click on File->Preferences->Network
  2. Select the ‘Host Only Network‘ Tab
  3. Click the + icon to add a new network

By default VirtualBox will create a new network, without DHCP.  Click on the ‘screw driver’ icon and take note of the IP address.  In the example below it is



Create the Virtual Machine

From VirtualBox Create a new VM.  The VM should have the following configuration:

  • 4096 MB RAM
  • 40 GB Disk
  • NIC 1 – NAT
  • NIC 2 – Host Only


  1. Enter a name and type01_vm_create
  2. Specify 4096 MB RAM02_vm_create
  3. Create a new 40GB Disk (VDI and Dynamically Allocated)03_vm_create
  4. Edit the VM Configuration to enable the second network adapter.  Select the host only network you created earlier, and make sure promiscious mode is set to ‘AllowAll’04_vm_create

Install Fedora 23

Download Fedora 23 from here

Attach the ISO to your VM and then start the VM.  The VM will boot from the ISO and start the installation process.  Follow the wizard accepting the default options.


Configure eth1

When the installation is complete, you will need to configure eth1.  This is the interface attached to our host only network.  Open the VM and login as the root user on the console.

Create the interface file /etc/sysconfig/network-scripts/ifcfg-eth1

Add the following contents to the file


Here we assign the VM the IP  This is from the range of the host only network.  N.B we currently don’t use DHCP so it’s fine to assign a static address.

Bring up the interface

ifup eth1

When devstack is installed, we will access the horizon dashboard using this address.


Time for a quick test

Now is a good time to test your setup is functioning as expected.

If you installed Cygwin on your windows host, then you should open the Cygwin Terminal and try to ssh to your VM

ssh root@

If everything works as expected you can now install Devstack.  If you can’t ssh into your VM, see if you can ping it.  If you can ping, but not ssh in then you may need to disable the firewall

service firewalld stop

You may also need to install and start the ssh service

dnf install -y openssh-server
service sshd start


Add some Swap

It’s not essential to add swap, but I’ve found without it DevStack can easily run out of memory.

First check if a swap has aleady been setup

sudo swapon -s

Swapon will return any existing swaps.  If there aren’t any, then create one now.

sudo dd if=/dev/zero of=/swapfile bs=1024 count=4194304
sudo mkswap /swapfile
sudo swapon -a

You can make this permant by adding the following to /etc/fstab

/swapfile swap swap defaults 0 0

Install Devstack

The installation of Devstack is remarkably simple, but from time to time a few dependencies may go missing.  Run the following commands to install devstack.    This may take sometime depending on how powerful your system is.

N.B this should be run as a non-root user, who has sudo permissions.

# Install some dependancies
sudo dnf install -y git libnghttp2 libnghttp2-devel mod_wsgi facter

# Checkout devstack
cd ~
git clone

# Create default local.conf, specifying the PUBLIC_INTERFACE
cat << EOF > ~/devstack/local.conf

# Replace MySQL with Postgres
disable_service mysql
enable_service postgresql


# Append the IP Address
echo "HOST_IP=$(facter ipaddress_eth1)" >> ~/devstack/local.conf

# Run Devstack N.B this should be run as a non-root user
cd ~/devstack && ./


Once the script completes, you should see the following output:

DevStack Component Timing
Total runtime 787

run_process 57
test_with_retry 4
pip_install 112
restart_apache_server 9
wait_for_service 15
yum_install 18

This is your host IP address:
This is your host IPv6 address: ::1
Horizon is now available at
Keystone is serving at
The default users are: admin and demo
The password: secret


Browsing to you should now see the Openstack Horizon dashboard



Setup Default Routing to access VMs from Windows Host

At this point you can create a VM in the demo tenant, and assign it a floating IP.   Unfortunately by default you may find that you cannot route traffic to it i.e. ping, or ssh into the VM.   This is usually because the default routing rules haven’t been setup on the Windows host.

By default you should have found that Devstack created a public network using the following CIDR  When you assign a floating IP to a VM it will come from this block.

In order to route to it, you must add the following rule.

  1. Open windows command and type
route add MASK

This tells windows to route all traffic for addresses in via the gateway i.e. your Devstack VM.

You now have a fully working Openstack environment to play with; Enjoy 🙂




Building an Openstack Cloud


Last February I started looking at Openstack.  The project seemed quiet impressive, but still felt rough round the edges.  Armed with there unwieldy installation manual I had an attempt at installing my own cloud.  After a few days of tinkering around I promptly give up and then moved onto using devstack.

Devstack is a set of tools that automatically installs a Openstack cloud for developers.  The problem is it’s not a very production ready environment;  It’s intended to give you an environment to test changes to Openstack code, blow it away and start again.  Although it was useful enough to allow be to proof of concept a few projects using Openstack and heat.

Since then Openstack has moved on massively, Grizzly was released, Havana is almost available (later in October) and RedHat have spent much time and effort announcing RedHat Openstack (RHOS).  While RHOS looks like an attractive proposition for large companies, who want the comfort blanked of commercial support, it’s upstream cousin RDO that is getting much attention from everyone else.  Part of the RedHat/RDO effort has been the creation of packstack.  A set off puppet modules that help install Openstack.

Out of the box, it’s very simple to run packstack --allinone and about 15minutes later you will have a Openstack cloud running.

Packstack works by generating an anwser file, and then letting you specify the defaults.  Using the ‘–allinone’ flag, will insert sensible defaults based on your machines interfaces.  If you want to setup a multi-node deployment, then you will have to do a little more work.

Over the past few days I’ve went through several cycles of installing/un-installing, and eventually reached the point where I have my very own multi-node cloud.  Packstack works very well, and in fairness most of the issues I faced were due to having to work around my own environment, where I am trying to integrate into an existing development Lab.  The rest of this blog will explain how I actually setup my system.


Cloud Design

I started by roughly sketching the physical layout and topology of my cloud.   I had access to three HP DL360g7 servers in the existing lab.  Each with 4x1G ports and 2x10G ports.  2 of the 1G ports are connected as access switch ports.  1 of the 10G ports are connected as a trunk.

In my work we develop a server that handles a high volume of TCP traffic.  On a physical box we aim to support around 30K TPS, which equates to around 5Gbps with the traffic profile we use.  The intention was to build a cloud where my VMs would be connected via the 10G interface, and evaluate what performance we could get from a cloud platform.

The diagram below illustrates my setup:

Openstack Topology
Openstack Physical Topology

I have designated the 3 servers as ‘server 01’, ‘server 02’ and ‘server 03’.   Server 01, will be used as the controller, network node and compute node, and storage node.  Servers 2 and 3 will be purely compute nodes.  This is simply to make the most of my limited hardware.  In production you would want to make sure you have a dedicated network node, as well as having active standby’s for the controller and network node to provide HA.


Public/API Network

All 3 machines are connected to the existing lab network, and have an address on the range.  There are serveral other non-openstack servers connected to this network, and it is routable from employees desktops. It also provides external access to the internet.   By default VMs on the cloud will get a private address, but we will be able to assign a floating IP from this network, to provide access into the VMs from the lab network.

Management Network

Openstack has a number of services that need to talk to one another to coordinate tasks like booting VMs, monitoring etc.  It’s best to place this on a dedicated management network.  Here I have created a private vlan, that uses  

VM Network

The VM network is connected using the 10G port.  The physical machines don’t actually take an IP address on this network, instead Openstacks networking component ‘Neutron’ will use openvswitch to plumb VMs onto this network.  

Any communication between the virtual machines will go across this network.   The mode of networking that I use is provider tenant with VLANs.  When you create a network within Openstack, it assigns a VLAN id, so it’s important that the physical port these machines are connected to is configured as a trunk.  In my case I was assigned the VLAN ids in the range 10-20, which I can configure Openstack to use.  Initially my ports were configured as access point, which meant that VMs on different physical hosts weren’t able to talk to one another as the switch rejected the tagged packets.

Host Installation

I started by freshly installing my machines. I used CentOS 6.4. Normally we would use RHEL 6.4, but this install requires some packages that aren’t available in the RHEL repos yet, so you would need to add a CentOS repo either way.

I installed using the minimal server configuration.
Once complete I got the Openstack RDO Havana repos, upgraded the system and added the following packages:

yum install -y
yum update -y
yum install nmap tcpdump openstack-packstack

At this point you should make sure your network interfaces are configured. You can use DHCP, but I found there was alot of messing around with the network, so it was easier to statically configure them. I also had a few issues around routing, where the NetworkManager seemed to select the wrong default route. To avoid any messing around I disabled NetworkManager too.

The table below illustrates the interfaces configured:

Server Public/API Management VM Net
Server 01 eth0: eth1: eth2:
Server 02 eth0: eth1: eth2:
Server 03 eth0: eth1: eth2:

Here is an example of the interface cfg files from server 01.






Shutdown NetworkManager, and start the network deamon. You should do this from the console.

service NetworkManager stop
chkconfig NetworkManager off

service network start
chkconfig network on

Once this is complete, verify you still have connectivity on each of your interfaces, and that your /etc/resolv.conf is correct. As NetworkManager no longer looks after it, you may need to manually populate the details of your nameservers. i.e.


Finally, there seems to be issue around selinux polices and Openstack. For now you need to edit /etc/selinux/config and set


At this stage your almost ready to start installing, but as part of the yum update, a new Openstack kernel will have been installed that includes support for GRE.  You should reboot your server at this point to load the new kernel.


Openstack Installation

When your system reboots log onto Server 01, to begin installing Openstack.  From the command line run

packstack --gen-answer-file=multi-node.txt

This will generate an answer file with some defaults, that you can modify to suit your needs.

Open multi-node.txt with vim, or some other suitable editor.  If you search for the string ‘CONFIG_MYSQL_HOST’  you should see that packstack has configured the host using your Public/API network address.  If this is the case, then do a search and replace for, with your management network address i.e.

Next configure the following settings

Host Settings


You should set this to be the public IP of your controller node i.e.


This will allow you to VNC into VMs from the Openstack horizon dashboard.


You should specify the management addresses of all machines you wish to use as compute hosts i.e.

Network Settings

The following settings relate to setting up the network, for inter VM communication.


The default is local, but you should change this to vlan.




You can specify the vlan id range to use here.  If you were allocated a specific set of VLAN ids to use, then enter them here i.e. I was given 10-20 so I would specify




You should specify the physical bridge that will be used for VM communication.  Packstack will create this, but the convention is br-<interface name> i.e.




This specifies which port to add to the bridge above.  So in our case we want to add eth2 as a port to br-eth2 i.e.




Specify one or more ntp servres to keep your nodes in sync,,,



You may want to install some services which are off by default.  I changed the following:


For my purposes we are interested in performance, howerver by default Openstack will overcommit your CPU and RAM resources. To avoid this you can change the ratio to 1.0, i.e. if you have 24 logical CPUs (On my DL360g7 I have 2*CPU*6cores*2hyperthreads = 24) then you will have 24 vCPUs available in Openstack.


You can now start your Openstack installation by running

packstack --answer-file=multi-node.txt

When it completes packstack should present you with the URL to login with. It will have also generated a file called keystonerc_admin. Take a look at this file to get the admin password to login with ‘OS_PASSWORD’.

Now you have a cloud, take a look around the dashboard before reading my next post on how to configure your cloud.

Dealing with duplicate photos

Over the past couple of years I’ve got through a few different computers.  Due to laziness on my behalf I’ve let my photo library grow widely out of control.  It got to the point where I had manually created backups on three different drives.  Unfortunately I had no designated master, and now had a jumble of 100G of photos to sort out.

I knew there were a lot of duplicates, but because I’d used different media managers on different computers I’d ended up with duplicate photos, but named differently.  It was time to sort it all out – enter fdupes.

fdupes is a nice utility that will go through a collection of files and identify duplicates.  It does this by doing a binary comparison, so it doesn’t matter if your files are named differently.

The syntax is pretty straight forward

fdupes -R . -s -1

This simply tells fdupe to recursively (-R) go through all directories from the current one (.); checking all files including sysmlinks (-s), and list all occurrences of a duplicate file on the same line (-1).

If fdupes identifies any duplicates you will get output like this:

./2012/Jan/img-01.jpg ./2012/restored/03243.jpg

./2013/Jan/img-01.jpg ./someotherfolder/img-01.jpg

Each line indicates a duplicate photo as been found.  Within each line all occurrences of duplicates are listed. 


A simple script can then be used to process this data.  The following script uses awk to ignore the first column of each line, and print the remaining columns (duplicates) into a new file.  This new file can then be processed however you like (moving, deleting the files listed in it)



# Process the file, and print each duplicate file onto a new line
while read line
echo $line | awk -F’ ./’ ‘{for(i=2;i<=NF;i++){printf “./%sn”, $i};}’ >> $TMP_FILE
done < $FILE

echo “Wrote duplicates to $TMP_FILE”

You could modify this script to delete your duplicates, but by writing them to a separate file first, it gives you the opportunity to review the data before doing anything destructive.

If you want to delete the files try this


while read file
if [ -f “$file” ]; then
rm -f “$file”
done < $FILE