Openstack is an open source and free to use cloud solution that enables you to build a private Infrastructure-as-a-Service (IaaS) platform through a variety of complementary services. Each service in OpenStack offers an Application Programming Interface (API) to facilitate the integration. Key components available in OpenStack will provide compute, network, and storage resources. It can be operated from a command line interface using openstack tool or through its intuitive dashboard from where you can administer OpenStack cloud and monitor its resources.
In this article we cover in detail the steps required to setup a private OpenStack Cloud locally on your Debian 12 Linux machine. This is a single node installation that’s suitable only for home lab learning and testing purposes. We are using a manual method of installation other solution like Kolla and OpenStack Ansible.
Before you get started with this setup, ensure your machine has the following minimum requirements met.
- A fresh installation of Debian 12 Linux
- CPU virtualization extension enable in BIOS
- root user or user with sudo privileges
- 2 vCPUs
- 8 GB RAM
- 20GB disk capacity
- Good internet connection
- 1. Prepare Environment
- 2. Install MariaDB, RabbitMQ, Memcached
- 3. Install and Configure Keystone
- 4. Install and Configure Glance (Image Service)
- 5. Install and Configure Nova
- 6. Configure Network Service (Neutron)
- 7. Add Compute Flavors and SSH key
- 8. Create Security groups
- 9. Add OS Images and Create test VM
- 10. Configure Horizon – OpenStack Dashboard
- Conclusion
Let’s begin!.
1. Prepare Environment
Our environment has the following variables;
- Debian 12 Server IP address: 192.168.1.2
- Debian 12 Server hostname: osp01.home.cloudlabske.io
- Network interface: eno1
- Default OpenStack region: RegionOne
- Default domain: default
Set server hostname.
sudo hostnamectl set-hostname osp01.home.cloudlabske.io
Edit the /etc/hosts file to map your server IP address to the hostname configured.
$ sudo vim /etc/hosts
192.168.1.2 osp01.home.cloudlabske.io osp01
Update system before you start other configurations. The assumption is that you’re working on a clean Debian machine.
sudo apt update && sudo apt upgrade -y
A reboot might be required. Just confirm.
[ -e /var/run/reboot-required ] && sudo reboot
Configure NTP time synchronization.
- Using Systemd timesyncd
Open the timesyncd.conf file for editing and update the address to your NTP server.
$ sudo vim /etc/systemd/timesyncd.conf
[Time]
NTP=192.168.1.1
Restart systemd-timesyncd service.
sudo systemctl restart systemd-timesyncd
Confirm the status
sudo timedatectl timesync-status
- Using Chrony
Install Chrony and Configure NTP server for time adjustment. NTP uses 123/UDP.
sudo apt -y install chrony vim
You can change NTP servers or use default.
$ sudo vim /etc/chrony/chrony.conf
pool 2.debian.pool.ntp.org iburst
Set timezone to your current location
sudo timedatectl set-timezone Africa/Nairobi
sudo timedatectl set-ntp true
Confirm the settings
$ timedatectl
Local time: Wed 2024-01-31 21:47:22 EAT
Universal time: Wed 2024-01-31 18:47:22 UTC
RTC time: Wed 2024-01-31 18:47:22
Time zone: Africa/Nairobi (EAT, +0300)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Restart chrony service
sudo systemctl restart chrony
Manually sync time on the system.
$ sudo chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- ntp1.icolo.io 2 6 37 57 +770us[ +770us] +/- 13ms
^* ntp0.icolo.io 2 6 37 57 -15us[ -895us] +/- 13ms
^- time.cloudflare.com 3 6 37 58 +3221us[+3221us] +/- 71ms
^- time.cloudflare.com 3 6 37 59 +3028us[+2156us] +/- 71ms
2. Install MariaDB, RabbitMQ, Memcached
From this point we can switch to root user account.
$ sudo -i
# or
$ sudo su -
Install MariaDB database server
apt install mariadb-server -y
Adjust maximum database connections to avoid connection timeouts.
# vim /etc/mysql/mariadb.conf.d/50-server.cnf
max_connections = 700
Restart MariaDB service after making the change.
systemctl restart mariadb
Also install Python MySQL extension package.
apt install python3-pymysql
Once done perform the installation of RabbitMQ, Memcached and Nginx web server.
apt install memcached rabbitmq-server nginx libnginx-mod-stream
Add RabbitMQ user for OpenStack, set password and grant permissions.
rabbitmqctl add_user openstack StrongPassw0rd01
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Disable the default nginx web page.
unlink /etc/nginx/sites-enabled/default
Restart the services.
systemctl restart mariadb rabbitmq-server memcached nginx
3. Install and Configure Keystone
The OpenStack Identity service (Keystone) is a single point of integration for authentication, authorization, and a catalog of services.
Create a database, and user with proper permissions granted.
# mysql
create database keystone;
grant all privileges on keystone.* to keystone@'localhost' identified by 'StrongPassw0rd01';
flush privileges;
exit;
Install Keystone and its dependencies including OpenStack client.
apt install keystone python3-openstackclient apache2 python3-oauth2client libapache2-mod-wsgi-py3 -y
Answer “No” for all prompts.
Edit keystone configuration file and change the address and configure database connection settings and token provider.
# vim /etc/keystone/keystone.conf
# Specify Memcache Server on