A quick OpenStack deployment with Kolla-Ansible, plus notes on the multi-node inventory, networking and storage setup.

Components

Components deployed this time:

  • core
    • keystone
    • nova
    • glance
    • neutron

Environment

I prepared eight VMs for this deployment:

ip hostname cpu memory disk role
192.168.30.220 infra-node1 8 32 100 controller
192.168.30.221 infra-node2 8 32 100 controller
192.168.30.228 infra-node3 8 32 100 controller
192.168.30.223 computer1 8 32 100 compute
192.168.30.224 computer2 8 32 100 compute
192.168.30.225 ceph-node1 8 32 100, 100 storage
192.168.30.226 ceph-node2 8 32 100, 100 storage
192.168.30.227 ceph-node3 8 32 100, 100 storage
192.168.30.229 vip

The nodes run Ubuntu 22.04. At the time, cephadm’s support for 22.04 wasn’t complete, so I went with LVM for now and will add external Ceph later. The hostnames still say ceph-node, but these are actually LVM nodes.

Create a volume group on each of the three storage nodes. Note that pvcreate wipes the data on /dev/sdb:

pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb

Each node has two NICs. To keep things simple, both use the 192.168.30.0/24 network: floating IP traffic goes out on 192.168.30.0/24, and VXLAN carries tenant traffic.

Install Docker on every node. The official convenience script saves time:

wget -qO- https://get.docker.com/ | sh

This pipes a remote script straight into a shell. Don’t do this in production; following the Docker documentation and setting up the apt repository is safer.

Create a virtual environment for OpenStack on every node and install the dependencies:

apt update
apt install git python3-dev libffi-dev gcc libssl-dev python3-dbus -y
apt install python3-venv -y

Create and activate the Kolla virtual environment:

python3 -m venv /opt/kolla
source /opt/kolla/bin/activate

Install the Docker SDK for Python:

apt install python3-pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip install docker

Edit /root/.bashrc so the Kolla virtual environment activates on login

source /opt/kolla/bin/activate

Configure /etc/hosts on every node:

192.168.30.220 infra-node1
192.168.30.221 infra-node2
192.168.30.228 infra-node3
192.168.30.223 computer1
192.168.30.224 computer2
192.168.30.225 ceph-node1
192.168.30.226 ceph-node2
192.168.30.227 ceph-node3

Generate an SSH key on infra-node1 (no passphrase):

ssh-keygen

Copy the public key to every node. The hostnames are already in /etc/hosts, so just loop:

for h in infra-node{1..3} computer{1,2} ceph-node{1..3}; do
  ssh-copy-id root@$h
done

Disable the iSCSI service on every node:

systemctl disable iscsid.socket --now

Initialize Kolla

Install kolla-ansible on infra-node1. To avoid polluting the system Python, I created /opt/kolla with venv earlier; confirm you’re still inside that environment.

Install Ansible and kolla-ansible. The branch must match openstack_release; here that’s Zed:

pip install 'ansible>=4,<6'
pip install git+https://opendev.org/openstack/kolla-ansible@stable/zed

Create the Kolla configuration directory and take ownership:

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

Copy the Kolla configuration and inventory files:

cp -r /opt/kolla/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
cp /opt/kolla/share/kolla-ansible/ansible/inventory/all-in-one .

Install the matching dependencies:

kolla-ansible install-deps

Generate passwords:

kolla-genpwd

Configure Kolla

Ansible Configuration

This configuration disables host key checking and speeds up execution.

First create an Ansible configuration directory:

mkdir -pv /etc/ansible

Create the configuration file:

vi  /etc/ansible/ansible.cfg

Contents:

[defaults]
host_key_checking=False
pipelining=True
forks=100

Global Configuration

This is where you choose the OpenStack components to deploy, along with networking and so on

vi /etc/kolla/globals.yml

Change it to the following:

---
workaround_ansible_issue_8743: yes
kolla_base_distro: "ubuntu"
openstack_release: "zed"
kolla_internal_vip_address: "192.168.30.229"
network_interface: "eth0"
neutron_external_interface: "ens19"
enable_openstack_core: "yes"
enable_glance: "{{ enable_openstack_core | bool }}"
enable_haproxy: "yes"
enable_keepalived: "{{ enable_haproxy | bool }}"
enable_keystone: "{{ enable_openstack_core | bool }}"
enable_mariadb: "yes"
enable_memcached: "yes"
enable_neutron: "{{ enable_openstack_core | bool }}"
enable_nova: "{{ enable_openstack_core | bool }}"
enable_rabbitmq: "{{ 'yes' if om_rpc_transport == 'rabbit' or om_notify_transport == 'rabbit' else 'no' }}"
enable_cinder: "yes"
enable_cinder_backend_lvm: "yes"
cinder_volume_group: "cinder-volumes"

Save and exit when done

Configure the Inventory

Edit the following parts of the all-in-one file:

[control]
192.168.30.220
192.168.30.221
192.168.30.228
[network]
192.168.30.220
192.168.30.221
192.168.30.228
[compute]

192.168.30.223
192.168.30.224

[storage]
192.168.30.225
192.168.30.226
192.168.30.227
[monitoring]

[deployment]
localhost       ansible_connection=local

Deploy OpenStack

First bootstrap the dependencies for the Kolla deployment:

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

If that looks good, move on: Bootstrap Servers

Run the prechecks:

kolla-ansible -i ./all-in-one prechecks

Once that passes, continue: openstack-prechecks

Deploy OpenStack:

kolla-ansible -i ./all-in-one deploy

If the deployment completes cleanly, that’s the main work done:

openstack-deploy

Install the OpenStack client:

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

Generate the matching adminrc file:

kolla-ansible post-deploy

Verification

Find the admin account and password:

cat /etc/kolla/admin-openrc.sh

Log in to the VIP’s web page:

openstack login page

Create a Flavor

There are no flavors by default, so create one:

openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano

This defines a flavor with 1 vCPU, 64 MB of RAM and a 1 GB disk, named m1.nano.

Create Networks

Two networks are needed here: one external network and one tenant VPC network

Openstack create public network

You can see the physical device with this command:

cat /etc/kolla/neutron-server/ml2_conf.ini

OpenStack Neutron ML2 configuration

Create the subnet: OpenStack Create Public network subnet

The external subnet should match your network plan. Here it’s 192.168.30.0/24 and reaches the internet.

To keep the lab simple, the external network and the management network share a subnet. In production, keep them separate; don’t use the management network directly as the floating IP pool.

Here I configured the DHCP allocation pool and DNS servers:

OpenStack Create Public network subnet details

Create the tenant subnet:

OpenStack User Network

This is the tenant subnet. It can differ from the external range; the network type is VXLAN. Here it’s 10.230.0.0/24 with gateway 10.230.0.254.

OpenStack User Network Subnet

DHCP pool and DNS server settings:

OpenStack User Network Subnet Details

Create a router for VM internet access and floating IPs:

OpenStack Create Router

Note that the external network should be the one created above, with SNAT enabled.

Next, configure the router. First go back to the network topology: OpenStack Create Router Topology

Create the interface: OpenStack Add Router Interface

Choose the tenant network created earlier. The IP can be set manually or assigned by DHCP; DHCP was enabled when the tenant network was created, so I’ll leave it unset here:

OpenStack Router Interface Subnet

The topology afterwards:

OpenStack Network Topology

Create an Image

CirrOS is the example here; upload the image through the web UI.

OpenStack Images interface

Fill in the details as prompted. Pay attention to the image properties; set them according to your needs:

OpenStack Create Images Details

Once it’s created, the CirrOS image appears:

OpenStack Create Image Done

Open the Security Group

First open ICMP and port 22 in the security group for the ping test and SSH connection later:

openstack security group rule create --proto icmp default
openstack security group rule create --proto tcp --dst-port 22 default

Launch an Instance

OpenStack Launch Instance

Select the image: OpenStack Launch Sources

Select the flavor: OpenStack Launch Flavor

Select the network: OpenStack Launch Network Then click Create.

OpenStack VM Booting

After it’s created OpenStack VM Stats

Add a Floating IP

Add a floating IP

No floating IPs are available right now, so allocate one: Create a new floating IP

Allocate a new floating IP

Once it’s allocated, select Assign: Manage floating IPs After assigning, the floating IP address shows up: Instance with a floating IP attached

Pitfalls

iSCSI Connection Failures

When Cinder uses LVM + iSCSI, iscsid on the host interferes with iSCSI inside the container. Disable the host service, then restart the container:

systemctl disable iscsid.socket --now

Next Steps

  • Build an offline deployment: a local registry plus an internal pip mirror
  • Hook up external Ceph and replace LVM
  • Test the other components later, such as Octavia and Heat

References