OpenStack is a free and open-source software platform that provides a cloud computing infrastructure. It provides a set of services for building and managing cloud environments, including compute, storage, networking, and identity management.
Devstack is a tool that enables the installation of OpenStack on a single node. In this tutorial, we will guide you through the process of installing a single node OpenStack using Devstack on Ubuntu 22.04.
Before proceeding with the installation, you should ensure that your system meets the following requirements:
- Freshly Installed Ubuntu 22.04
- At least 8GB of RAM
- At least Dual Processor (2vCPUs or more)
- Sudo User with admin rights
- At least 50GB of free disk space is available.
- Fast and stable internet Connection
- OS : Ubuntu 22.04 LTS
- IP Address : 192.168.1.2
- Interface: enp0s3
Without any further delay, let’s deep dive into installation steps of Openstack
1) Install Git and Add Stack User
Open the terminal and run following apt commands to install git,
$ sudo apt update && sudo apt install -y git
Create a user named stack using following useradd command and assign sudo rights to it. Run following set commands
$ sudo useradd -s /bin/bash -d /opt/stack -m stack $ sudo chmod +x /opt/stack $ sudo usermod -aG sudo stack $ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack $ sudo -u stack -i
2 ) Download devstack and setup local.conf file
Clone the Devstack repository by running the following command:
$ git clone https://opendev.org/openstack/devstack
Navigate to the Devstack directory by running the following command:
$ cd devstack
Create a local.conf file by copying the sample configuration file:
$ cp samples/local.conf local.conf
Edit the local.conf file and add the following configuration:
$ vi local.conf [[local|localrc]] HOST_IP=192.168.1.2 SERVICE_HOST=192.168.1.2 MYSQL_HOST=192.168.1.2 RABBIT_HOST=192.168.1.2 GLANCE_HOSTPORT=192.168.1.2:9292 ADMIN_PASSWORD=secret DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD ## Neutron options Q_USE_SECGROUP=True FLOATING_RANGE="192.168.1.0/24" IPV4_ADDRS_SAFE_TO_USE="10.0.0.0/22" Q_FLOATING_ALLOCATION_POOL=start=192.168.1.185,end=192.168.1.195 PUBLIC_NETWORK_GATEWAY="192.168.1.1" PUBLIC_INTERFACE=enp0s3 # Open vSwitch provider networking configuration Q_USE_PROVIDERNET_FOR_PUBLIC=True OVS_PHYSICAL_BRIDGE=br-ex PUBLIC_BRIDGE=br-ex OVS_BRIDGE_MAPPINGS=public:br-ex
Save the changes and close the file.
3) Start Openstack Installation
Once the devstack is installed and local.conf is setup properly as per our environment, then run the following command to start the installation process:
The installation process may take 10 to 20 minute to complete, depending on your internet speed and system resources.
Above script will install keystone, glance, nova, placement, cinder, neutron, and horizon. Floating IPs will be available, guests have access to the external world and guest VMs can be accessed from LAN by allocating Floating ips to them.
Once the installation is complete, you will see a message indicating that Devstack has been successfully installed.
Note: I have to manually add DNS server IP (126.96.36.199) in /etc/resolv.conf because I was getting dns resolution error.
4) Access Openstack
There are two ways to interact with openstack either via command line or Dashboard (GUI).
Command line access to openstack,
$ source openrc $ openstack network list $ openstack image list $ openstack catalog list
To access horizon dashboard, type the following URL in the web browser,
Change the IP address that suit to your environment.
- User Name : admin / demo
- Password : secret
Click on “Sign In” after entering the credentials,
That’s all from this tutorial, I hope you have found it informative.
In this tutorial, we have shown you how to install a single node OpenStack using Devstack on Ubuntu 22.04. By following the steps outlined in this tutorial, you can quickly set up your cloud infrastructure and start managing it with ease.
Read Also: How to Set Static IP Address on Ubuntu 22.04