How to Install OpenStack on Ubuntu with DevStack [ Easy method ]

Install OpenStack In Ubuntu With Devstack

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.

In this article, we will learn how to set up OpenStack on our Ubuntu system with help of Devstack.

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

There are some additional software requirements also, which you need to fulfill.

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.

We will first 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 –

install openstack on ubuntu with devstack
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.

install openstack in ubuntu with devstack
Logging-in as User “stack”

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.

Step 4: Creating configuration (.conf) 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:

vim local.conf

and paste the following content –

[[local|localr]]

ADMIN_PASSWORD=StrongAdminSecret
DATABASE_PASSWORD=$ADMIN_PASSWOCinder
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD

If you are not much familiar with Vim, you can read through the vim tutorial. For 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
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

Or try

https://localhost/dashboard

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

Openstack Login
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
OpenStack Dashboard

Bonus

Conclusion

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