How to set up development environment for OpenStack with DevStack

DevStack can be used to quickly bring up a complete OpenStack environment for development, based on the latest versions of everything from git master. However running it will make substantial changes to the system during installation, so it is advisable to only run DevStack on servers or virtual machines that are dedicated to this purpose.

With that in mind, I will be setting up a virtual machine using VirtualBox with Ubuntu 18.04 (Bionic Beaver).

I have downloaded VirtualBox from https://www.virtualbox.org/ and installed it to my machine. I can use it now to create a virtual machine and give it 4GB of RAM and 40GB of disk (requirements for DevStack).

Now, let’s start the machine and in the promt window select the ubuntu .iso file downloaded from https://ubuntu.com/download/server .

By hitting start, the Ubuntu installation process will begin and it is pretty straightforward.

Once the installation is complete, let’s configure SSH access to the machine. For that, we need to install openssh-server and configure the network settings.

To install the openssh-server, run:

$ sudo apt-get install openssh-server

Make sure the SSH service is running:

$ sudo service ssh status

If necessary, to start the service, run:

$ sudo service ssh start

To set up network settings we need the local IP of the machine. To get it, run:

$ hostname -I

Now let’s configure the network settings, in this example I will be setting up NAT with port forwarding. So, in the VirtualBox Manager, let’s open Settings/Network/Advanced, click on Port Forwarding and add a new rule:

Make sure to set the Name of the rule to SSH, Guest IP to the value you got with running hostname -I just moments ago and Guest Port to 22.

Now, to access the machine from Terminal for example, run:

$ ssh -p 2522 <username>@127.0.0.1

where <username> is the username, you set up during the ubuntu installation.

Next up, we can start setting up DevStack on the machine. For that let’s follow the steps described here :

$ git clone https://opendev.org/openstack/devstack

$ cd devstack/

To create a local.conf file :

$ nano local.conf

Minimum required config for this file would be :

[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

But this file can be customised to run DevStack with selected components. In my case I will be adding config info to include manila and manila-ui.

To include manila-ui, for example, I added:

# manila-ui
enable_plugin manila-ui https://opendev.org/openstack/manila-ui

If you are an intern or applicant like me I suggest ask your mentor how to set up the conf file for all the components you need for your project and make your initial setup as smooth as possible.

Once the file is created, run the script :

$ ./stack.sh (this will take quite some time)

NOTE: If you need to make changes in the conf file afterwards, just run ./unstack.sh, make the desired changes, and then run ./stack.sh again.

Now, when the script has finished, we are all set! All the basic set of repos and any additional ones that are defined in local.conf, will be under /opt/stack/

2 thoughts on “How to set up development environment for OpenStack with DevStack

Leave a Reply

Your email address will not be published. Required fields are marked *