How to Install OpenStack on Ubuntu with DevStack

Pranav T P
5 min readNov 12, 2021

In this article, we’ll learn how to install OpenStack on Ubuntu with the use of DevStack. OpenStack is a cloud computing infrastructure (IaaS) that helps in controlling large pools of computation power, storage, and networking resources throughout a datacenter. It does so with help of APIs. In short, OpenStack helps in building and managing Public and Private Clouds, by using pooled virtual resources.

Devstack is a series of extensible scripts, which is used to set up an OpenStack environment with ease. It is used alot, as it gives an interactive environment for development with OpenStack.

Pre-requisites for using OpenStack

There are a few basic pre-requisites you need to fulfill, before setting up OpenStack on your system.

  • Ubuntu OS
  • A minimum of 4 GB RAM
  • Multi-core enabled processor
  • At least 10GB of free hard disk space
  • A good internet connection

Steps to Install Openstack on Ubuntu with Devstack

Installing OpenStack on Ubuntu is a rather complex process. But it is made easy by Devstack. The steps to install it, are quite easy even if you’re not much proficient with the command line, simply follow the steps and get it up and running.

Step 1: Preparing the system

Before we start off, we need to ensure that our system is updated, for that run following command:

$ sudo apt-get update && sudo apt-get upgrade -y

The command will ask for root privileges. Enter your user password and wait for your system to upgrade. After the upgrade is finished, make sure to reboot your system. It will initialize and setup your upgrades in the next reboot.

Step 2: Creating stack user with Sudo privileges

Now, it’s time to start with the important steps to install Openstack on Ubuntu. First we will create a new user named stack for our system to setup OpenStack, as it should be installed on a non-root user with sudo enabled.

Open a fresh terminal, and run the useradd command:

$ sudo useradd -s /bin/bash -d /opt/stack -m stack

You also need to enable stack user to have root privileges and run without a password, for that run:

$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack

The Output will look like this –

Adding User — “stack”

Once you have created the stack user, it’s time to log in to it using the following command:

$ sudo su - stack

It will log in you to bash, as stack user.

Step 3: Downloading Devstack

For this step, we considered you already git installed on your system. Now, enter this command to download/clone devstack from its repository to your system:

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

Devstack repo contains a script stack.sh , which we will use to setup OpenStack. It also contains templates for configuration files.

The Output will look like this –

Downloading Devstack from Git

Step 4: Creating configuration file for Devstack

Now, we have downloaded DevStack and need to setup our configuration files for it.

You need to first navigate to the devstack folder, by running:

$ cd devstack

Afterwards, create a local.conf file, by running:

$ sudo vim local.conf

and paste the following content –

[[local|localr]]
ADMIN_PASSWORD=StrongAdminSecretDATABASE_PASSWORD=$ADMIN_PASSWOCinderRABBIT_PASSWORD=$ADMIN_PASSWORDSERVICE_PASSWORD=$ADMIN_PASSWORD

now, you can just paste using the mouse by right-clicking and clicking Paste and enter :x to save & exit.

Here, I used a minimal configuration to setup DevStack, you can explore

Note:
1. StrongAdminSecret is the password we used here, you can change it with your choice.
2. You can find a sample configuration file for local.conf in the Samples directory under the Devstack repository.

Step 5: Installing Openstack with Devstack

Now, as we have setup the configuration files properly.

Let’s run the script to setup OpenStack on our system, using the following command:

$ ./stack.sh

(This script we’re using is part of DevStack itself)

The script will install the listed features for your OpenStack environment –

  • Horizon — OpenStack Dashboard
  • Keystone — Identity Service
  • Nova — Compute Service
  • Glance — Image Service
  • Neutron — Network Service
  • Placement — Placement API
  • Cinder — Block Storage Service

The setup will take around 10 to 20 minutes, based on your system performance and internet speed, as many git trees and packages are installed during the process.

After your installation successfully finishes, your terminal will look like the image below.

Devstack Installed

Now, we can see that it is saying that Horizon (Openstack Dashboard) is available at the given URL, it will vary from system to system.

Step 6: Accessing OpenStack using a web browser

Now, as we have successfully setup OpenStack using Devstack, let’s access it via our browser.

Browse this URL on your browser –

https://server-ip/dashboard

It will open up the OpenStack login page, as shown below.

Openstack Login

Now, enter the credentials. You can also log in as admin here, by having User Name as admin & for Password using the one we added to local.conf file.

After logging in, your dashboard will look similar to this.

OpenStack Dashboard

Conclusion

In this article, we learned what Openstack and Devstack are went through the entire process to install Openstack on Ubuntu with Devstack on our own. Also, make sure to be cautious while entering configurations, as everything on the stack user is running with root privileges.

--

--

Pranav T P

I'm a Pranav T P. pursuing my Master (Mtech) at PES University, Banglore in a stream of Cloud Computing