OpenStack is a cloud Operating System used to control the deep pools of computing, networking, and storage resources within a data center. OpenStack is a free, open-source cloud computing platform. OpenStack is primarily used and implemented as an Infrastructure as a Service (IaaS) for cloud computing.
OpenStack is an open-source platform that offers many options to deploy and install it through different software distributions. OpenStack provides various deployment models for their customers. OpenStack also provides pre-installed ISO images of its platform for its customers.
In this tutorial, we will discuss the steps to install and configure the OpenStack using DevStack. DevStack is the most suitable option to install and test OpenStack on a user laptop, PC, or server. DevStack helps to install all the components in a single environment. Users can use it to set up OpenStack on a single server or virtual machine (VM). Users cannot use the DevStack for production purposes because it is almost impossible to bring it up on the last state after reboot.
DevStack will install the following OpenStack components:
- OpenStack Dashboard – Horizon
- Compute Service – Nove
- Block Storage Service – Cinder
- Identity Service – Keystone
- Image Service – Glance
- Object Storage – Swift
- Network Service – Neutron
- Placement API – Placement
The hardware requirements to install and configure OpenStack on a server or system are:
- Processor – at least 2 cores
- NIC – at least 2 NICs
- Hard Drive – at least 60GB
- Memory – at least 8GB
DevStack can be installed on the following operating systems:
- Fedora 24/25
- Ubuntu 16.04/17.04/18.04
- CentOS/RHEL 7
Note: Ubuntu is the most tested and reliable Operating System option for DevStack.
To install the DevStack in a system, the user must first create a Linux Virtual Machine on their computer (using VMware or VirtualBox) or remotely in the cloud (such as using AWS).
The installed Virtual Machine must have at least 4GB of memory with a proper network connection. We are going to use a version of Ubuntu in this tutorial, which is 18.04.
To install the OpenStack in the Ubuntu virtual machine, follow the below steps :
Step 1: Update the System
- First, open a terminal and execute the following command to make sure that the system is up to date :
$ sudo apt update $ sudo apt -y upgrade $ sudo apt -y dist-upgrade
- After that, reboot the system. To reboot the system, execute the following command :
$ sudo reboot or $ init 6
Step 2: Create OpenStack User
The OpenStack must run as a regular user (non-root user) with sudo privileges. Follow the below process to create an OpenStack regular user with sudo privileges.
- To create a new user with the name “stack” and assign the sudo privileges or permissions, execute the following command in the terminal:
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
- Now, assign the sudo privileges to the created user by executing the following command :
$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
- Switch to the ‘stack’ user by running the following command:
$ sudo su - stack
Step 3: Install the GIT
- By default, Git is installed in most of the Ubuntu systems. But if it is missing on the system, then install Git by executing the following command:
$ sudo apt install git -y
Step 4: Download OpenStack
- Once the Git installation is completed, use the git command to download the DevStack from Github.
$ git clone https://git.openstack.org/openstack-dev/devstack
Step 5: Create a DevStack Configuration File
- Go to the devstack directory by executing the following command :
$ ls $ cd devstack
- Next, create a local.conf file in which the user has to enter the host IP address and four passwords:
$ vi local.conf
- Copy and paste the following line of content in the local.conf file:
[[local|localrc]] # Password for KeyStone, Database, RabbitMQ and Service ADMIN_PASSWORD=<StrongAdminpassword> DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD # Host IP - To get your Server or VM IP, run the 'ip addr' or 'ifconfig' command HOST_IP=<IP address>
- Press ESC and enter :wq to save and exit from the local.conf file. In the above content, replace <StrongAdminpassword> text with the Admin password that the user uses to log into the OpenStack login page (By default, it is admin). Also, replace <IP address> with the IP address of the server or user system. To check the IP address of the system, execute the following commands:
$ ifconfig or $ ip addr
Step 6: Install OpenStack with DevStack
- To install and run OpenStack on the system, execute the following command:
DevStack will install all the OpenStack components. The installation will take 15-20 minutes to complete. At the end of the installation, the user will receive the host’s IP address, URL for managing the host, and username and password to handle the administrative task.
Step 7: Accessing OpenStack on a browser
- Copy the horizon URL that you received in the installation output and paste it into the browser. In the below URL, replace <IP Address> with the host’s IP address.
- Next, log in to OpenStack with the default username (admin or demo) and configured password.
- After logging into the OpenStack, the system will redirect the user to the OpenStack dashboard. This dashboard screen is known as the OpenStack management web console.
Step 8: Create an Instance
On the main dashboard screen of OpenStack, users will be able to view the instance’s overview. Users can also create their own instances in the OpenStack. Instances are nothing but virtual machines. To create a new virtual machine:
- First, click on Instances from the left side of the page.
- Then, click on Launch Instances and fill in the required fields.
- Once the users fill all the required fields, click Launch Instances to create the instance.
This tutorial presents the steps to install and configure OpenStack. Hope this tutorial was helpful, and do reach out to us if you have any query or suggestions.