Skip to content

Latest commit

Β 

History

History
498 lines (332 loc) Β· 9.9 KB

File metadata and controls

498 lines (332 loc) Β· 9.9 KB

πŸš€ OpenStack Single-Node Deployment using Kolla Ansible

βœ… All-in-One (AIO) Setup | βœ… VirtualBox VM | βœ… Fixed Common Issues

βœ… Perfect for Evaluation, Learning Development & Production
πŸ”§ Deploy OpenStack All-in-One with Kolla Ansible β€” Fast, Reliable & Professional


πŸ“Œ Table of Contents


πŸ’‘ About Kolla Ansible

Kolla Ansible is an official OpenStack project that uses Ansible to deploy containerized OpenStack services via Docker. It’s ideal for:

  • Rapid deployment of OpenStack for testing or evaluation.
  • Consistent, repeatable infrastructure as code.
  • Production-ready architecture (scalable from single-node to multi-node).

βœ… Why Use Kolla Ansible?

  • Fully automated setup
  • Built-in high availability (VIP + keepalived)
  • Easy upgrades and maintenance
  • Supports Ubuntu, Rocky Linux, CentOS

This guide uses the development-style installation method (cloning from Git) as per the official Kolla Ansible quickstart.


βš™οΈ Prerequisites

Ensure your VM meets these requirements:

Requirement Details
OS Ubuntu 24.04 LTS or Rocky Linux 9
RAM 8 GB or more
Disk 40+ GB free space
Network Interfaces 3 NICs (NAT, Host-Only, Bridged)
User Privileges Root access or sudo rights

πŸ–₯️ Our Environment:

βœ… 2+ vCPUs

βœ… 8+ GB RAM

βœ… 40+ GB Disk

βœ… OS: Ubuntu 24.04.X LTS

βœ… 3 Network Interfaces (as described)

Interface Type IP Address Purpose
enp0s3 NAT 10.0.2.15 Internet access
enp0s8 Host-Only 192.168.10.10 Management network
enp0s9 Bridged 192.168.102.221 External network for instances

We'll use:

  • enp0s8 β†’ network_interface
  • enp0s9 β†’ neutron_external_interface
  • VIP β†’ 192.168.10.250

Run all commands as root or with sudo.


βž• Step-by-Step Installation

πŸ’‘ Run all commands as root or use sudo.

1. Update System & Install Dependencies

Update package list

sudo apt update && sudo apt upgrade -y

Install system build tools and Python dependencies

apt install -y git python3-dev libffi-dev gcc libssl-dev libdbus-glib-1-dev python3-venv

🐧 For Rocky/CentOS, use:

dnf install -y git python3-devel libffi-devel gcc openssl-devel python3-libselinux

2. Create Virtual Environment

python3 -m venv /opt/venv-kolla
source /opt/venv-kolla/bin/activate
pip install --upgrade pip
pip install docker
pip install dbus-python

πŸ” Keep this environment activated for all steps!


3. Clone & Install Kolla-Ansible from Git

git clone --branch stable/2025.1 https://opendev.org/openstack/kolla-ansible

Install Python dependencies

pip install ./kolla-ansible

4. Create Config Directory

mkdir -p /etc/kolla
chown $USER:$USER /etc/kolla

5. Copy Configuration Files

cp -r kolla-ansible/etc/kolla/* /etc/kolla/
cp kolla-ansible/ansible/inventory/* .

6. Install Ansible Galaxy Dependencies

kolla-ansible install-deps

7. Generate Passwords

kolla-ansible/tools/generate_passwords.py

πŸ” All passwords are now securely generated in /etc/kolla/passwords.yml


8. Configure globals.yml

Edit the main config file:

nano /etc/kolla/globals.yml

Update with your settings:

# Base OS for containers
kolla_base_distro: "ubuntu"

# OpenStack release
kolla_install_type: "source"

# Management interface (host-only)
network_interface: "enp0s8"

# External interface for Neutron (bridged, no IP!)
neutron_external_interface: "enp0s9"

# Virtual IP for internal traffic (must be unused)
kolla_internal_vip_address: "192.168.10.250"

# Enable key services
enable_haproxy: "yes"
enable_keystone: "yes"
enable_glance: "yes"
enable_nova: "yes"
enable_neutron: "yes"
enable_placement: "yes"
enable_horizon: "yes"
enable_cinder: "yes"
enable_cinder_backend_lvm: "yes"
enable_heat: "yes"

Save and exit (Ctrl+O, Enter, Ctrl+X).


9. Bootstrap the Server

Installs Docker and other required tools.

kolla-ansible bootstrap-servers -i all-in-one

10. Run Pre-Deployment Checks

kolla-ansible prechecks -i all-in-one

❌ If it fails due to missing Python modules, see Troubleshooting below.


11. Deploy OpenStack

Deploy all services in containers:

kolla-ansible deploy -i all-in-one

πŸ• This may take 10–20 minutes.

βœ… Wait for: PLAY RECAP with 0 failed tasks.


12. Generate Admin Credentials

kolla-ansible post-deploy -i ~/all-in-one

βœ… Output: /etc/kolla/clouds.yaml and /etc/kolla/admin-openrc.sh


13. Install OpenStack CLI

pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/2025.1

14. Source Admin Environment

source /etc/kolla/admin-openrc.sh

Test connection:

openstack token issue

βœ… You should see a valid authentication token.


15. (Optional) Run Demo Script

Creates sample network, image, and instance.

kolla-ansible/tools/init-runonce

⚠️ Only for testing! Do not run in production.


πŸ” Verify & Use OpenStack

Access Horizon Dashboard

Open in browser:

http://192.168.10.10
or
http://192.168.102.221

Login with:

  • Username: admin
  • Password: See /etc/kolla/passwords.yml β†’ keystone_admin_password

Get password:

grep keystone_admin_password /etc/kolla/passwords.yml

πŸ›  Manage & Maintain Your Cloud

Useful Commands

Task Command
Redeploy (e.g., after config change) kolla-ansible deploy -i ~/all-in-one
Restart specific service (Nova) kolla-ansible deploy -i ~/all-in-one --tags nova
Stop all containers kolla-ansible stop -i ~/all-in-one
Pull latest images kolla-ansible pull -i ~/all-in-one
View logs docker logs <container_name>
List running containers docker ps

Upgrade OpenStack (Future)

When upgrading to a new version:

# Pull new images
kolla-ansible pull -i ~/all-in-one

# Run upgrade playbook
kolla-ansible upgrade -i ~/all-in-one

⚠️ Always backup first!


🧹 Cleanup / Uninstall

To completely remove OpenStack:

kolla-ansible destroy -i ~/all-in-one --yes-i-really-really-mean-it

⚠️ Warning: This deletes all data, including volumes and databases.

Then remove config and virtual env:

rm -rf /etc/kolla
rm -rf /opt/venv-kolla
rm -rf ~/kolla-ansible

πŸ”§ Troubleshooting & Common Issues

Here are real problems you faced and their perfect fixes, plus other likely issues.


❌ Issue 1: ModuleNotFoundError: No module named 'docker'

Error during prechecks:

failed: [localhost] ... ModuleNotFoundError: No module named 'docker'

βœ… Solution:

Install docker in the Ansible runtime environment:

pip install docker

or

/opt/ansible-runtime/bin/pip install docker

❌ Issue 2: ModuleNotFoundError: No module named 'dbus'

Error:

import dbus; ModuleNotFoundError: No module named 'dbus'

βœ… Solution:

Install dbus-python in the Ansible runtime:

pip install dbus-python

or

/opt/ansible-runtime/bin/pip install dbus-python

πŸ”— Requires system package: libdbus-glib-1-dev (already installed above).


❌ Issue 3: Inventory path does not exist during post-deploy

Error:

Kolla inventory /etc/kolla/ansible/inventory/all-in-one is invalid: Path does not exist

βœ… Solution:

Create the correct directory and copy the file:

mkdir -p /etc/kolla/ansible/inventory
cp all-in-one /etc/kolla/ansible/inventory/all-in-one

Or always specify -i:

kolla-ansible post-deploy -i all-in-one

❌ Issue 4: Neutron external network not working

Symptoms:

  • Instances can't reach internet
  • Floating IPs not accessible

βœ… Fix:

Ensure neutron_external_interface has no IP address:

ip addr flush dev enp0s9

And disable any network manager control over it.


❌ Issue 5: Time synchronization failure

Error in prechecks about NTP.

βœ… Fix:

Enable time sync:

timedatectl set-ntp true
timedatectl status

❌ Issue 6: Not enough memory or disk space

Symptom: Docker fails to start or containers crash.

βœ… Fix:

  • Allocate at least 8GB RAM and 40GB disk to VM.
  • Monitor usage: df -h, free -h

πŸ“œ License & Credits


βœ… Congratulations!
You’ve successfully deployed a fully functional single-node OpenStack cloud using Kolla Ansible.

Use this environment to learn Nova, Neutron, Cinder, Horizon, and more!


πŸ“¬ Need Help?
Have questions or improvements? Open an issue or contact me!

✨ Happy Cloud Building!