1080*80 ad

Deploy OpenStack All-in-One with Kolla-Ansible on Ubuntu 22.04

A Step-by-Step Guide to Deploying OpenStack with Kolla-Ansible on Ubuntu 22.04

Building your own private cloud environment can seem like a monumental task, but with the right tools, it becomes a manageable and rewarding project. OpenStack stands as a powerful, open-source platform for creating private and public clouds. However, its complexity can be a barrier. This is where Kolla-Ansible comes in, simplifying the deployment process by using Ansible and Docker containers to build a robust, scalable OpenStack environment.

This guide will walk you through deploying a complete, all-in-one OpenStack cloud on a single Ubuntu 22.04 server using Kolla-Ansible. An all-in-one deployment is perfect for development, testing, or building a home lab.

Why Use Kolla-Ansible for Your OpenStack Deployment?

Before diving in, it’s important to understand the advantages of this approach. Manually deploying OpenStack involves configuring dozens of services and components, a process prone to error. Kolla-Ansible streamlines this by:

  • Containerization: Each OpenStack service (like Nova for compute, Neutron for networking, and Glance for images) runs in its own Docker container. This isolates services, simplifies upgrades, and enhances stability.
  • Automation: By leveraging Ansible playbooks, Kolla-Ansible provides a repeatable, automated, and production-ready deployment method. You define your cloud’s configuration in simple YAML files, and Ansible handles the rest.
  • Flexibility: While we are focusing on an all-in-one setup, the same tools and principles can be used to scale out to a multi-node, high-availability cluster.

Preparing Your Ubuntu 22.04 Server

A successful deployment starts with a properly prepared host system. Follow these steps to get your server ready.

1. Minimum System Requirements

Ensure your server or virtual machine meets these minimum specifications:

  • CPU: 2+ cores (4+ recommended)
  • RAM: 8 GB (16 GB or more is highly recommended for better performance)
  • Disk: 50 GB of free space
  • Network: One network interface with internet access

2. Initial System Setup

First, connect to your server and perform a full system update to ensure all packages are current.

sudo apt update && sudo apt upgrade -y

Next, set a static hostname. OpenStack components rely heavily on consistent hostnames for communication.

sudo hostnamectl set-hostname openstack-controller

Then, map the hostname to your server’s IP address in the /etc/hosts file. This is a critical step for ensuring proper name resolution within the OpenStack services. Replace 192.168.1.100 with your server’s actual IP address.

echo "192.168.1.100 openstack-controller" | sudo tee -a /etc/hosts

3. Install Core Dependencies

Kolla-Ansible requires several Python and build-related packages, along with Ansible itself.

sudo apt install python3-dev libffi-dev gcc libssl-dev python3-pip -y
sudo pip install ansible

4. Install and Configure Docker

Since Kolla is container-based, Docker is a core dependency. Install it directly from the official repository for the latest version.

# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Set up the repository
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Installing and Configuring Kolla-Ansible

With the server prepared, you can now install and configure Kolla-Ansible to define your OpenStack deployment.

1. Install Kolla-Ansible

Use pip to install Kolla-Ansible. This command will pull down the necessary Ansible roles and modules.

sudo pip install kolla-ansible

2. Create Configuration Directories and Files

Kolla-Ansible requires a configuration directory. Create it and copy the default configuration files to customize.

sudo mkdir -p /etc/kolla
sudo chown $USER:$USER /etc/kolla
cp -r /usr/local/share/kolla-ansible/etc/kolla/* /etc/kolla
cp /usr/local/share/kolla-ansible/ansible/inventory/all-in-one .

3. Customize Your Deployment Configuration

The primary configuration file is /etc/kolla/globals.yml. Open it with a text editor and make the following critical changes:

  • kolla_base_distro: Set this to ubuntu.
  • kolla_install_type: Set this to source.
  • openstack_release: Specify the OpenStack version. zed is a stable and widely used release.
  • kolla_internal_vip_address: This is the virtual IP address that will be used to access your OpenStack APIs and dashboard. This IP should be unused on your network. You can often use an IP address in the same subnet as your network interface.
  • network_interface: This is the name of your primary network interface (e.g., eth0, ens160). You can find this using the ip a command.

Here is an example snippet from globals.yml:

kolla_base_distro: "ubuntu"
kolla_install_type: "source"
openstack_release: "zed"
kolla_internal_vip_address: "192.168.1.101"
network_interface: "eth0"

Security Tip: Kolla-Ansible can automatically generate strong, random passwords for all OpenStack services. Run the following command to populate the /etc/kolla/passwords.yml file. Always back up this password file in a secure location.

kolla-ansible -i all-in-one passwords

The Deployment Process: Bringing Your Cloud to Life

With all preparations complete, you are ready to deploy OpenStack. This is a three-step process executed with kolla-ansible commands.

Step 1: Bootstrap the Server
This command prepares the host server by installing necessary dependencies required for the deployment.

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

Step 2: Run Pre-Deployment Checks
This crucial step validates your configuration files and system environment to catch potential issues before the main deployment begins.

kolla-ansible -i all-in-one prechecks

If this command fails, carefully read the output to identify and resolve any configuration errors.

Step 3: Deploy OpenStack
This is the final command that does the heavy lifting. Kolla-Ansible will now pull all necessary Docker images, create the containers, and configure all the OpenStack services. This process can take a significant amount of time (30-60 minutes or more) depending on your server’s performance and internet speed.

kolla-ansible -i all-in-one deploy

Post-Deployment: Accessing and Verifying Your Cloud

Once the deployment command completes successfully, your OpenStack cloud is running. Here’s how to access and verify it.

1. Install the OpenStack Client
To interact with your cloud via the command line, install the OpenStack client tools.

sudo pip install python-openstackclient

2. Accessing the Horizon Dashboard
Kolla-Ansible generates a script with the necessary credentials. You can find the admin password in /etc/kolla/passwords.yml.

  • Open a web browser and navigate to http://<kolla_internal_vip_address>.
  • Log in with the username admin and the keystone_admin_password from your passwords file.

3. Using the Command-Line Interface (CLI)
To use the CLI, you first need to source the admin credentials file.

source /etc/kolla/admin-openrc.sh

Now, verify that the services are running. The following command lists the compute services and their status.

openstack compute service list

You should see a list of services (like nova-conductor, nova-scheduler, etc.) with a State of up. This confirms your compute infrastructure is operational.

Congratulations! You have successfully deployed a functional, all-in-one OpenStack cloud using Kolla-Ansible. You are now ready to explore the Horizon dashboard, create networks, upload images, and launch your first virtual machine.

Source: https://kifarunix.com/deploy-all-in-one-openstack-with-kolla-ansible-on-ubuntu-22-04/

900*80 ad

      1080*80 ad