Introduction

Today, we will be walking you through the steps required to build an OpenStack Lab using Kolla-Ansible, based on the queens release.

So what is Kolla-Ansible? In short, Kolla-Ansible is a highly customizable OpenStack project that is used to deploy OpenStack services and infrastructure components in Docker containers.

Once installed this lab will provide us with a platform that will allow us to dive into the various network features of OpenStack.

Let's begin ...

Environment

The following environment will be based upon 3 virtual machines (each machine consisting of 2 NICs):

  • 1 x Controller (also used as the deployment node)
  • 2 x Compute

With regards to the resources and IPs, please see below:

Hostname External IP vCPU RAM HDD
Controller01 172.29.236.171/24 2 8Gb 40Gb
Compute01 172.29.236.172/24 2 8Gb 40Gb
Compute02 172.29.236.173/24 2 8Gb 40Gb

OpenStack-Lab
Figure 1: Topology

Note: As part of our installation we will also install Kibana, which will be used to query the Openstack logs across each of the nodes and services from a central location.

Install CentOS7

On each server install CentOS7.
Once installed run the following command on each server,

yum update -y ; yum install openssh-server

On the deployment node update the /etc/hosts file with entries for Compute01 and Compute02.

SSH Keys

First, we setup SSH keys so that the deployment node can connect to the other servers, without the need for passwords, which is required for Ansible.

ssh-keygen
for i in 172.29.236.172 172.29.236.173 ; 
do 
  ssh-copy-id -i ~/.ssh/id_rsa.pub root@$i ; 
done

Install Dependencies

Next, we install the dependencies upon the deployment node. Like so,

yum install epel-release python-pip python-devel libffi-devel gcc openssl-devel libselinux-python ansible wget -y 
pip install -U pip
pip install -U ansible

Configure Kolla Ansible

At this point we can now start configuring Kolla, ready for the install/deployment. This is done by downloading 2 preconfigured Ansible config files, which are then copied into Ansible, ready for the deployment.

wget https://raw.githubusercontent.com/rickd3/OpenStack/master/Kolla/multinode.yml
wget https://raw.githubusercontent.com/rickd3/OpenStack/master/Kolla/globals.yml

Note: the globals.yml is configured based on the following interface names.

network_interface: "ens192" 
neutron_external_interface: "ens224" 

Update the file based on the interface names you have. No IP should be configured against the Neutron_external_interface. Whereas the network_interface interface is configured based on the IP's previously provided earlier.

We can now configure Kolla based on the below,

pip install kolla-ansible
cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
cp /usr/share/kolla-ansible/ansible/inventory/* .
cp multinode.yml /usr/share/kolla-ansible/ansible/inventory/
cp globals.yml /etc/kolla/
kolla-genpwd

Note: The passwords generated via kolla-genpwd are stored within /etc/kolla/passwords.yml

Deploy OpenStack

Next, OpenStack can be deployed. Anisble will flag any errors that it finds.
Note: Ensure that any errors are reported by Anisble (shown in red) are resolved before running the next command.

cd /usr/share/kolla-ansible/ansible/inventory/
kolla-ansible -i ./multinode bootstrap-servers
kolla-ansible -i ./multinode prechecks
kolla-ansible -i ./multinode deploy

Once installed you will be able to see the various services installed via running a docker ps. Like so,

[root@centos7-001-undercloud inventory]#  docker ps
CONTAINER ID        IMAGE                                                  COMMAND             CREATED             STATUS              PORTS               NAMES
311aedbaaaed        kolla/centos-source-horizon:queens                     "kolla_start"       4 days ago          Up 7 minutes                            horizon
f740935645e5        kolla/centos-source-heat-engine:queens                 "kolla_start"       4 days ago          Up 5 minutes                            heat_engine
7b10477c2ce4        kolla/centos-source-heat-api-cfn:queens                "kolla_start"       4 days ago          Up 4 minutes                            heat_api_cfn
ec33885300ab        kolla/centos-source-heat-api:queens                    "kolla_start"       4 days ago          Up 7 minutes                            heat_api
438fa37dbd06        kolla/centos-source-neutron-metadata-agent:queens      "kolla_start"       4 days ago          Up 7 minutes                            neutron_metadata_agent
3d34ebc3d793        kolla/centos-source-neutron-l3-agent:queens            "kolla_start"       4 days ago          Up 4 minutes                            neutron_l3_agent
6a17c527d0f7        kolla/centos-source-neutron-dhcp-agent:queens          "kolla_start"       4 days ago          Up 4 minutes                            neutron_dhcp_agent
42727d49529c        kolla/centos-source-neutron-openvswitch-agent:queens   "kolla_start"       4 days ago          Up 5 minutes                            neutron_openvswitch_agent
3309206d538c        kolla/centos-source-neutron-server:queens              "kolla_start"       4 days ago          Up 4 minutes                            neutron_server
2ab87a83f879        kolla/centos-source-openvswitch-vswitchd:queens        "kolla_start"       4 days ago          Up 5 minutes                            openvswitch_vswitchd
e2d2d6a70bdc        kolla/centos-source-openvswitch-db-server:queens       "kolla_start"       4 days ago          Up 7 minutes                            openvswitch_db
acee56d131a3        kolla/centos-source-nova-novncproxy:queens             "kolla_start"       4 days ago          Up 8 minutes                            nova_novncproxy
be3c91951ce2        kolla/centos-source-nova-consoleauth:queens            "kolla_start"       4 days ago          Up 4 minutes                            nova_consoleauth
601c0f25c84b        kolla/centos-source-nova-conductor:queens              "kolla_start"       4 days ago          Up 5 minutes                            nova_conductor
09179d513c3c        kolla/centos-source-nova-scheduler:queens              "kolla_start"       4 days ago          Up 8 minutes                            nova_scheduler
91c7817e2fc5        kolla/centos-source-nova-api:queens                    "kolla_start"       4 days ago          Up 7 minutes                            nova_api
cb5217402dc7        kolla/centos-source-nova-placement-api:queens          "kolla_start"       4 days ago          Up 6 minutes                            placement_api
367bd2f6507f        kolla/centos-source-glance-registry:queens             "kolla_start"       4 days ago          Up 6 minutes                            glance_registry
3582df09a162        kolla/centos-source-glance-api:queens                  "kolla_start"       4 days ago          Up 7 minutes                            glance_api
e32f174ee9e1        kolla/centos-source-keystone:queens                    "kolla_start"       4 days ago          Up 6 minutes                            keystone
45cf8eb89be0        kolla/centos-source-rabbitmq:queens                    "kolla_start"       4 days ago          Up 7 minutes                            rabbitmq
7c8e0908b7bb        kolla/centos-source-mariadb:queens                     "kolla_start"       4 days ago          Up 5 minutes                            mariadb
2f92a6444486        kolla/centos-source-memcached:queens                   "kolla_start"       4 days ago          Up 7 minutes                            memcached
6b88c58a3fb6        kolla/centos-source-keepalived:queens                  "kolla_start"       4 days ago          Up 4 minutes                            keepalived
3357133396e6        kolla/centos-source-haproxy:queens                     "kolla_start"       4 days ago          Up 8 minutes                            haproxy
898a14ac878c        kolla/centos-source-cron:queens                        "kolla_start"       4 days ago          Up 4 minutes                            cron
c7b3982d398a        kolla/centos-source-kolla-toolbox:queens               "kolla_start"       4 days ago          Up 4 minutes                            kolla_toolbox
9bb0b4bbdefc        kolla/centos-source-fluentd:queens                     "kolla_start"       4 days ago          Up 5 minutes                            fluentd

Post Deploy

Once OpenStack is deployed. The following commands can be run to generate an rc file, and also install the OpenStack clients.

kolla-ansible post-deploy
. /etc/kolla/admin-openrc.sh

pip install python-openstackclient python-glanceclient python-neutronclient

With these commands, as a test we can now run the OpenStack CLI and confirm our hypervisors,

source /etc/kolla/admin-openrc.sh
openstack hypervisor list
+----+---------------------+-----------------+----------------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP        | State |
+----+---------------------+-----------------+----------------+-------+
|  1 | centos7-002         | QEMU            | 172.29.236.172 | up    |
|  2 | centos7-003         | QEMU            | 172.29.236.173 | up    |
+----+---------------------+-----------------+----------------+-------+

Further more the following services can be reached at:

Service EndPoint
Horizon http://172.29.236.171
Kabina http://172.29.236.171:5601

Additional

If you need to reconfigure Kolla, and/or update the configuration outside of what we have performed within this article, please refer to the following link for further information: https://ask.openstack.org/en/question/113699/kolla-ansible-how-to-managemodify-configuration-files/