Table of Contents
Overview on Kolla Ansible
In this tutorial I'll teach you how to install Openstack Kolla Ansible on Ubuntu 20.04 on a VMware workstation step by step.
The Kolla project is described as a service that provides production-ready containers and deployment tools to operate OpenStack clouds that are scalable, fast, reliable, and upgradable using community best practices.
In order to deploy OpenStack, Kolla has three projects as follows:
- kolla: All the Docker container images for OpenStack projects are maintained in this project. Kolla provides an image building tool called kolla-build to build container images for most of the projects.
- kolla-ansible: This provides Ansible playbooks for deploying OpenStack inside Docker containers. It supports both the all-in-one and multi-node setups of the OpenStack cloud.
- kolla-kubernetes: This deploys OpenStack on Kubernetes. This aims to leverage the self-healing, health checks, upgrade, and other capabilities of Kubernetes for managing containerized OpenStack deployment. kolla-kubernetes uses Ansible playbooks and the Jinja2 template to generate configuration files for the services.
On the market, there are several OpenStack deployment tools and solutions. The advantages of Kolla are mostly due to container technology:
Rapid deployment, smooth upgrade, and upgrade impact time is very short.
The upgrade granularity is small. It can be upgraded in units of components. For example, to upgrade the nova component, use the
kolla-ansible -i ~/kolla/all-in-one upgrade -t nova command.
Only the operating system is compatible with docker.
Docker reduces a lot of conflicts between the openstack installation package and the basic installation package.
The kolla project has better community support.
What we intend to do
We are planning to deploy All in One OpenStack deployment using Ubuntu 20.04 as our host server, where:
- kolla-ansible uses the installation package.
- The kolla-ansible runtime environment uses virtualenv instead of the local python environment.
- Docker's registry uses the public Docker Hub instead of building it yourself.
- The openstack components deployed in this experiment are nova, neutron and some neutron plug-ins, heat, glance, cinder-volume , and horizon.
By the end of this tutorial, you will have an up and running OpenStack deployment with all the services running on the same Ubuntu server.
Host Machine Requirements
Here the host machine is the server on which we will be installing the kolla ansible to deploy openstack. In our case the host server is Ubuntu 20.04 Virtual Machine running on VMware Workstation.
The following minimal criteria must be met by the host machine:
- 2 network interfaces
- 8GB main memory
- 40GB disk space
This article assumes that you already have fair idea of using Ansible. You may follow our detailed ansible tutorial to get more insights.
The host server (Ubuntu 20.04) must have an active internet connection as during the course of this tutorial, we will also download and install certain packages.
My Lab Environment
To demonstrate the steps to deploy OpenStack using Kolla Ansible, we will be using VMs created using VMware Workstation. So, I have already installed VMware Workstation on my Windows Desktop on which I have created a VM using the following specs:
- OS: Ubuntu 20.04
- RAM: 16GB
- Disk: 100 GB
- CPU: Quad Core
- ens33(Bridge): 192.168.126.130
- ens34(NAT): Make sure no IP Address is assigned to this interface
Step-1: Install dependency packages
Always install stable version of python to avoid conflicts and errors. Before installation update you Ubuntu machine to get latest packages and dependencies.
Run the following command in your terminal to update the packages.
golinuxcloud@ubuntu:~$ sudo apt update
In the next step I am going to install python build and dependencies.
golinuxcloud@ubuntu:~$ sudo apt install python3-dev libffi-dev gcc libssl-dev
Step-2: Create Python Virtual Environment
In this step I am going to create a virtual environment to avoid any conflicts with the system and site packages. When the virtual environment is created I am going to install Kolla Ansible and its dependencies.
First I need to install Python virtual environment package and we need “pip” and for that I am going to use the following commands.
golinuxcloud@ubuntu:~$ sudo apt install python3-pip
Then install virtual environment.
golinuxcloud@ubuntu:~$ sudo apt install python3-virtualenv
Verify your virtual environment installation with following command.
golinuxcloud@ubuntu:~$ virtualenv --version virtualenv 20.0.17 from /usr/lib/python3/dist-packages/virtualenv/__init__.py
In the next step I am going to create a virtual environment and name it” golinux” with the following command. I have created my environment in “home” directory.
golinuxcloud@ubuntu:~$ python3 -m venv golinux
This command will create the following directory structure:
golinuxcloud@ubuntu:~$ ls -l golinux/ total 20 drwxrwxr-x 2 golinuxcloud golinuxcloud 4096 Nov 27 23:01 bin drwxrwxr-x 2 golinuxcloud golinuxcloud 4096 Nov 27 23:01 include drwxrwxr-x 3 golinuxcloud golinuxcloud 4096 Nov 27 23:01 lib lrwxrwxrwx 1 golinuxcloud golinuxcloud 3 Nov 27 23:01 lib64 -> lib -rw-rw-r-- 1 golinuxcloud golinuxcloud 70 Nov 27 23:01 pyvenv.cfg drwxrwxr-x 3 golinuxcloud golinuxcloud 4096 Nov 27 23:01 share
Now we will activate our virtual environment that we have created and will configure everything in that environment.
golinuxcloud@ubuntu:~$ source golinux/bin/activate (golinux) golinuxcloud@ubuntu:~$
Once you activate the virtual environment, your terminal prompt will change as shown above which would mean that you are inside the virutal environment.
Step-3: Install dependency packages using virtual environment
Next we must handle some more dependencies before we go ahead and install Kolla Ansible. Upgrade the pip to the latest version using the command.
golinuxcloud@ubuntu:~$ pip install -U pip
Install Ansible. Kolla Ansible requires at least Ansible 2.10 and supports up to 4.
golinuxcloud@ubuntu:~$ pip install 'ansible<5.0'
Step-4: Install and Setup Kolla Ansible
Next we will install Kolla-ansible using pip command:
golinuxcloud@ubuntu:~$ pip install kolla-ansible
/etc/kolla directory for the configuration of kolla and Openstack projects
golinuxcloud@ubuntu:~$ sudo mkdir -p /etc/kolla
Change the ownership of the directory. Here replace
golinuxcloud with the user you are using for the deployment.
golinuxcloud@ubuntu:~$ sudo chown golinuxcloud:golinuxcloud /etc/kolla
For our deployment, the most crucial files are
passwords.yml, copy these two files to the
(golinux) golinuxcloud@ubuntu:~/golinux$ cp -r /home/golinuxcloud/golinux/share/kolla-ansible/etc_examples/kolla/* /etc/kolla/
Copy the inventory file to the
/etc/kolla folder as well. Inventory files are simply used to notify kolla-ansible which are our hosts and type of installation we need on these hosts.The inventory file defines the division of ansible host groups. If it is an all-in-one environment, use the all-in-one file directly without modification.
(golinux) golinuxcloud@ubuntu:~/golinux$ cp /home/golinuxcloud/golinux/share/kolla-ansible/ansible/inventory/* /etc/kolla/
In our case we will use all-in-one file because we use multinode file when we are deploying OpenStack on more than one host
(golinux) golinuxcloud@ubuntu:~$ ls -l /etc/kolla/ total 64 -rw-rw-r-- 1 golinuxcloud golinuxcloud 8980 Nov 27 23:14 all-in-one -rw-rw-r-- 1 golinuxcloud golinuxcloud 30991 Nov 27 23:14 globals.yml -rw-rw-r-- 1 golinuxcloud golinuxcloud 9446 Nov 27 23:14 multinode -rw-rw-r-- 1 golinuxcloud golinuxcloud 4854 Nov 27 23:14 passwords.yml
Create an ansible directory and
golinuxcloud@ubuntu:~$ sudo mkdir /etc/Ansible
Here is the sample content of
golinuxcloud@ubuntu:~$ sudo vi /etc/ansible/ansible.cfg
Step-6: Create Inventory
I am deploying everything in one machine. Therefore, I will use all-in-one inventory file.
The file being kept as it is because we are only using one host for installation you can change the file as you need for you OpenStack installation.The inventory file defines the division of ansible host groups. If it is an all-in-one environment, use the all-in-one file directly without modification.
golinuxcloud@ubuntu:~$ cat /etc/kolla/all-in-one # These initial groups are the only groups required to be modified. The # additional groups are for more control of the environment. [control] localhost ansible_connection=local [network] localhost ansible_connection=local [compute] localhost ansible_connection=local [storage] localhost ansible_connection=local ...
Step-7: Configure globals.yml
globals.yml is the most important file in kolla Ansible. There are few options that we need to add in the file.
kolla_internal_vip_address(ens33): Next we need to provide floating IP for management traffic. This IP will be managed by keepalived to provide high availability, and should be set to be not used address in management network that is connected to our
- network_interface: This is the default interface for multiple management-type networks
- neutron_external_interface(ens34): Second interface required is dedicated for Neutron external (or public) networks, can be vlan or flat, depends on how the networks are created. This interface should be active without IP address.
enable_cinder: Kolla Ansible provides a bare compute kit, however it does provide support for a vast selection of additional services. To enable them, set
- kolla_base_distro: Kolla provides choice of several Linux distributions in containers. But if you are deploying for the first time i will recommend that you should use Ubuntu or Centos.
$ cat /etc/kolla/globals.yml enable_haproxy="no" kolla_internal_vip_address: "220.127.116.11" network_interface: "ens33" neutron_external_interface: "eth1" enable_cinder: "yes" kolla_base_distro: "Ubuntu"
Step-8: Generate Password
In the next step generate the password for the services. These generated passwords will be stored in
Step-9: Perform Deployment
Once the passwords are generated and every thing is done without getting errors. Now in the next step we are going to install bootstrap servers.
golinuxcloud@ubuntu:~$ kolla-ansible -i /etc/kolla/all-in-one bootstrap-servers
Ansible playbooks will be running using this command. This will take some time if you get “failed=0” at your terminal when the command is finished and you will see the following output.
Always do deployment checks.
golinuxcloud@ubuntu:~$ kolla-ansible -i /etc/kolla/all-in-one prechecks
You would get the same output like bootstraping if everything’s goes without any errors.
In the last step we will perform deployment.
golinuxcloud@ubuntu:~$ kolla-ansible -i /etc/kolla/all-in-one deploy
Now install the Openstack client and its dependencies using pip.
(golinux) golinuxcloud@ubuntu:/$ pip install python-openstackclient
Step-10: Post Deployment
Now create “admin-openrc” file that basically contains admin credentials.
(golinux) golinuxcloud@ubuntu:/etc/kolla$ kolla-ansible post-deploy /etc/kolla/admin-openrc.sh
Now in the next step we will run the deployment.
(golinux) golinuxcloud@ubuntu:~$ source /etc/kolla/admin-openrc.sh
(golinux) golinuxcloud@ubuntu:~$ cd /home/golinuxcloud/golinux/share/kolla-ansible
The initialization script will create virtual machine resources such as cirros image, network, subnet, routing, security group, specification, quota, etc.
(golinux) golinuxcloud@ubuntu:~/golinux/share/kolla-ansible$ ./init-runonce
Mange your Openstack using the Graphical User Interface.
Use Openstack client commands list different images, host and services. You can do a lot of things with Openstack client.
This method of deployment of Openstack using Kolla Ansible is easiest way of using cloud services and you can learn a lot. I hope my article was helpful to you in understanding the Openstack deployment on Ubuntu 20.04 using Kolla Ansible. Let me know how I can improve more to help you on cloud services.
You can use the above references to get understanding of Openstack commands and other services that are running in the Openstack.