Openstack multinode deployment through Kolla-ansible [part 1]

Share this article

In one of a previous article Kolla Ansible deploying OpenStack wallaby on Ubuntu 20.04 [part-1], we discussed how to install OpenStack in a single node. However running a usable Openstack cloud environment need many nodes. Therefore, this article, we are going to discuss the multinode architecture for the OpenStack deployment. For multinode deployment, we will be deploying OpenStack on 4 different servers. The below mentioned network architecture diagram depicts our setup.

Network Architecture of our setup

More information regarding our setup:
  1. Servers: All the four kolla servers are Virtual Machine have following configuration
    1. OS: CentOS 8
    2. RAM 8 GB
    3. Storage 30 GB
    4. 3 network interfaces
  2. NFS storage: NFS server is running on VM
    1. OS: CentOS 7
    2. RAM 4GB
    3. Storage 60 GB
  3. IP address : All the server has three network interfaces
    1. eth0: Management network (192.168.100.12), kolla external vip interface, brown two face arrow shows that they have password less ssh in between them.
    2. eth1: Internal VIP interface (local VIP interface)
    3. eth2: Will be used by neutron

In the following section, we will explain the significance of the kolla-controller1 server which is the key management node in our setup.

kolla-controller1

This host will also work as a management node for kolla-ansible and kolla. That means will configure all the hosts from this node. Before any configuration let’s first set up the kolla-ansible for deployment and kolla for creating the images. We will be using root user to manage kolla ansible.

Step 1: Python dependencies installation

Installing python3 build and dependencies.

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

Step 2: python virtual environment createion

We deploy kolla ansible in python virtual environment to avoid conflicts with the system site-packages,

In CentOS you can use below mentioned command to install virtual environment package and create virtual env

dnf install python3-virtualenv
virtualenv train-venv

Output of creating virtual environmetn

[root@kolla-controller1 ~]# virtualenv train-venv
Using base prefix '/usr'
New python executable in /root/train-venv/bin/python3.6
Also creating executable in /root/train-venv/bin/python
Installing setuptools, pip, wheel...done.
[root@kolla-controller1 ~]# 

Now switch to the virtual environment.

[root@kolla-controller1 ~]# source train-venv/bin/activate
(train-venv) [root@kolla-controller1 ~]# 

Now we will run all the commands in through our virtual environment. As you can see after sourcing the virtual environment my Command line shows (train-venv), it signifies virtual environment is activated.

Step 3: Creating kolla development environment

The main reason to create kolla development environment is it provides us great flexibility because we will create our own images and later we need we can override those images with our changes and also can change deployment process.

Install the latest version of pip and install setup tools by using the following command.

pip install -U pip
pip install -U setuptools

Install Ansible. For Train OpenStack version kolla ansible version should be from Ansible 2.6  to 2.9. Use the following command to install ansible.

pip install 'ansible<2.10'

When you run above commands you will get the following output

(train-venv) [root@kolla-controller1 ~]# pip install -U pip
Requirement already satisfied: pip in ./train-venv/lib/python3.6/site-packages (21.2.4)
(train-venv) [root@kolla-controller1 ~]# pip install -U setuptools
Requirement already satisfied: setuptools in ./train-venv/lib/python3.6/site-packages (58.2.0)
(train-venv) [root@kolla-controller1 ~]# pip install 'ansible<2.10'
Collecting ansible<2.10
  Downloading ansible-2.9.26.tar.gz (14.3 MB)
     |████████████████████████████████| 14.3 MB 12.3 MB/s 
Collecting jinja2
  Downloading Jinja2-3.0.2-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 103.4 MB/s 
Collecting PyYAML
  Downloading PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl (640 kB)
     |████████████████████████████████| 640 kB 106.1 MB/s 
Collecting cryptography
  Downloading cryptography-35.0.0-cp36-abi3-manylinux_2_24_x86_64.whl (3.5 MB)
     |████████████████████████████████| 3.5 MB 104.8 MB/s 
Collecting cffi>=1.12
  Downloading cffi-1.14.6-cp36-cp36m-manylinux1_x86_64.whl (401 kB)
     |████████████████████████████████| 401 kB 103.9 MB/s 
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 119.2 MB/s 
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Building wheels for collected packages: ansible
  Building wheel for ansible (setup.py) ... done
  Created wheel for ansible: filename=ansible-2.9.26-py3-none-any.whl size=16206008 sha256=37eb5867655d4035ab83f404509cf054708359e26e3876ed3bfab5cd9839b7ab
  Stored in directory: /root/.cache/pip/wheels/ec/54/03/f7046fb5a98deaa833ff454f5a677ca1282e97448959a74c87
Successfully built ansible
Installing collected packages: pycparser, MarkupSafe, cffi, PyYAML, jinja2, cryptography, ansible
Successfully installed MarkupSafe-2.0.1 PyYAML-5.4.1 ansible-2.9.26 cffi-1.14.6 cryptography-35.0.0 jinja2-3.0.2 pycparser-2.20
(train-venv) [root@kolla-controller1 ~]# 

Clone kolla and kolla-ansible repositories from git Use the following command to do that. Also, for the sake of simplicity we will clone kolla ansible inside train-venv directory.

git clone https://github.com/openstack/kolla 
git clone https://github.com/openstack/kolla-ansible

Output of the above command is following.

(train-venv) [root@kolla-controller1 ~]#  cd  train-venv/
(train-venv) [root@kolla-controller1 train-venv]#  
(train-venv) [root@kolla-controller1 train-venv]#  ls
bin  include  lib  lib64  pip-selfcheck.json
(train-venv) [root@kolla-controller1 train-venv]# git clone https://github.com/openstack/kolla 
Cloning into 'kolla'...
remote: Enumerating objects: 80583, done.
remote: Counting objects: 100% (2899/2899), done.
remote: Compressing objects: 100% (1194/1194), done.
remote: Total 80583 (delta 1828), reused 2604 (delta 1651), pack-reused 77684
Receiving objects: 100% (80583/80583), 14.90 MiB | 15.30 MiB/s, done.
Resolving deltas: 100% (49088/49088), done.
(train-venv) [root@kolla-controller1 train-venv]# git clone https://github.com/openstack/kolla-ansible
Cloning into 'kolla-ansible'...
remote: Enumerating objects: 131348, done.
remote: Counting objects: 100% (9357/9357), done.
remote: Compressing objects: 100% (3860/3860), done.
remote: Total 131348 (delta 5737), reused 8285 (delta 4971), pack-reused 121991
Receiving objects: 100% (131348/131348), 23.68 MiB | 21.03 MiB/s, done.
Resolving deltas: 100% (86440/86440), done.
(train-venv) [root@kolla-controller1 train-venv]# 

Now, make sure you are at the stable/train branch on both repositories. See the below mention command to switch to stable/train branch.

[root@kolla-controller1 kolla-ansible]# git checkout stable/train
Already on 'stable/train'
Your branch is up to date with 'origin/stable/train'.
[root@kolla-controller1 kolla-ansible]# cd ../kolla
[root@kolla-controller1 kolla]# git checkout stable/train
Already on 'stable/train'
Your branch is up to date with 'origin/stable/train'.
[root@kolla-controller1 kolla]# 

Install requirements of kolla and kolla-ansible. To check more about requirements go to the cloned directory and see the requirements.txt files. For example /root/train-venv/kolla/requirements.txt files has following package requirements.

pbr!=2.1.0,>=2.0.0 # Apache-2.0
docker>=2.4.2 # Apache-2.0
Jinja2>=2.8 # BSD License (3 clause)
GitPython>=1.0.1 # BSD License (3 clause)
oslo.config>=5.1.0 # Apache-2.0

To install the requirements run the following command from inside the kolla and kolla-ansible directory.

pip install .

Output of the above command

(train-venv) [root@kolla-controller1 kolla]# pwd
/root/train-venv/kolla
(train-venv) [root@kolla-controller1 kolla]# pip install .
Processing /root/train-venv/kolla
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Collecting pbr!=2.1.0,>=2.0.0
  Using cached pbr-5.6.0-py2.py3-none-any.whl (111 kB)
Collecting docker>=2.4.2
  Downloading docker-5.0.3-py2.py3-none-any.whl (146 kB)
     |████████████████████████████████| 146 kB 12.1 MB/s 
Requirement already satisfied: Jinja2>=2.8 in /root/train-venv/lib/python3.6/site-packages (from kolla==12.1.0.dev203) (3.0.2)
Collecting GitPython>=1.0.1
.
.
(train-venv) [root@kolla-controller1 kolla-ansible]# pwd
/root/train-venv/kolla-ansible
(train-venv) [root@kolla-controller1 kolla-ansible]# pip install .
Processing /root/train-venv/kolla-ansible
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /root/train-venv/lib/python3.6/site-packages (from kolla-ansible==12.1.0.dev368) (5.6.0)
Requirement already satisfied: oslo.config>=5.2.0 in /root/train-venv/lib/python3.6/site-packages (from kolla-ansible==12.1.0.dev368) (8.7.1)
Requirement already satisfied: PyYAML>=3.12 in /root/train-venv/lib/python3.6/site-packages (from kolla-ansible==12.1.0.dev368) (5.4.1)
Requirement already satisfied: cryptography>=2.1 in /root/train-venv/lib/python3.6/site-packages (from kolla-ansible==12.1.0.dev368) (35.0.0)
Collecting oslo.utils>=3.33.0
  Downloading oslo.utils-4.10.0-py3-none-any.whl (101 kB)
     |████████████████████████████████| 101 kB 5.8 MB/s
.
.

The above commands has generated two directories inside share directory, see the output below.

(train-venv) [root@kolla-controller1 share]# pwd
/root/train-venv/share
(train-venv) [root@kolla-controller1 share]# ls
kolla  kolla-ansible
(train-venv) [root@kolla-controller1 share]# 

Step 4: Copy important configuration files

Create /etc/kolla/ folder to store configuration files

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

Copy all the configuration file to /etc/kolla directory, Use the following copy command

cp -r kolla-ansible/etc/kolla/* /etc/kolla
cp kolla-ansible/ansible/inventory/* .
cp ./kolla/etc/oslo-config-generator/kolla-build.conf /etc/kolla/

Now you can check the /etc/kolla/ directory, to see what files are inside /etc/kolla/ directory.

(train-venv)[root@kolla-controller1 ~]$ ls /etc/kolla/
all-in-one  globals.yml  kolla-build.conf  multinode  passwords.yml
(train-venv)[root@kolla-controller1 ~]$

Summary

In this article we discussed about our multinode architecture and created OpenStack kolla-ansible deployment environment. In the next article we will discuss about what is the significance of the configuration files.

Leave a Comment

Your email address will not be published. Required fields are marked *