A Beginner's Guide to Installing OpenStack on Single Node Using DevStack
A Step-by-Step Guide
OpenStack is a leading open-source cloud platform, widely used to manage and organize cloud infrastructure. In this article, I’ll guide you through setting up a single-node OpenStack environment using DevStack on an Ubuntu 22.04 virtual machine. This setup is an excellent way to gain hands-on experience with OpenStack.
Environment Details
Here are the specifications of the setup:
Operating System: Ubuntu 22.04
Virtualization Platform: VirtualBox
VM Configuration:
10 GB RAM (min)
4 CPU (min)
Networking: Bridged Adapter with static IP configuration using Netplan file
Prerequisites
Before starting, ensure the following:
A properly configured Ubuntu 22.04 virtual machine.
Internet access for downloading required packages and components.
Administrative privileges to install dependencies and configure the system
Step 1: Update the System
To ensure your system is up-to-date and ready for installation, run the following commands:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Packages
DevStack relies on several dependencies. Install them by running:
sudo apt install git curl wget python3-dev -y
Step 3: Create a Non-Root User for DevStack
DevStack requires a non-root user for installation. Follow these steps to create the ‘stack’ user:
sudo useradd -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
Switch to the newly created user:
sudo su - stack
Step 4: Clone the DevStack Repository
Clone the official DevStack repository:
git clone https://opendev.org/openstack/devstack
cd devstack
Step 5: Configure DevStack
Create a configuration file named local.conf to specify installation details:
nano local.conf
Add the following configuration:
[[local|localrc]]
# Credentials
ADMIN_PASSWORD=$ADMIN_PASSWORD
DATABASE_PASSWORD=$DATABASE_PASSWORD
RABBIT_PASSWORD=$RABBIT_PASSWORD
SERVICE_PASSWORD=$SERVICE_PASSWORD
# Network Configuration
HOST_IP=x.x.x.x # Replace with your VM's static IP address
Step 6: Start the Installation
Run the installation script to deploy OpenStack:
./stack.sh
This process will install all necessary OpenStack components. Depending on your system’s resources and internet speed, it may take 15-60 minutes.
Step 7: Access the Horizon Dashboard
After installation, OpenStack’s Horizon dashboard will be accessible via:
http://<your-VM-IP-address>/dashboard
Use the following credentials to log in:
Username: admin
Password: The ADMIN_PASSWORD you set in the local.conf file.
Additional Commands
Here are some useful commands to manage your DevStack environment:
Start DevStack (after reboot):
cd /opt/stack/devstack ./rejoin-stack.sh
Stop DevStack:
cd /opt/stack/devstack ./unstack.sh
Clean DevStack (for reinstallation):
./clean.sh
After running the installation (
./stack.sh
), you might see this tab in your terminal.By using the
http://<your-VM-IP-address>/dashboard
address, you can access the dashboard.You can also view the network topology from the dashboard for public, private, and shared network connections.
You can create and access an instance by uploading an ISO image, such as Ubuntu, Cirros, or another image. Subsequently, you can configure networks, set up routers, assign permissions to security groups, and create floating IPs. Essentially, you can perform all the tasks available on AWS, GCP, Azure, or other public cloud platforms.
With these steps, you have successfully set up your OpenStack environment. You can now manage your cloud resources efficiently, similar to using major public cloud platforms like AWS, GCP, or Azure. Enjoy exploring the capabilities of your new private cloud setup!