Openstack Multinode Deployment through Kolla-ansible [part-4]

Share this article

This article is part-4, in our 4 article series of openstack deployement,

  1. OpenStack multinode environment/architecture [Part-1]
  2. Important files and configuration [Part-2]
  3. Environment setup with docker image building through kolla-ansible [Part-3]
  4. Openstack Multinode Deployment through Kolla-ansible [part-4]

In this article, we will explain how to deploy OpenStack services which will be responsible for cloud orchestration. For testing, we will create a new user, project, network, and then we will create a virtual machine.

Deploying Openstack Services

In our previous article (important files and configuration), please make sure that /etc/kolla/globals.yml is properly configured. All the services you want to deploy should be enabled in it.

In our OpenStack multinode environment/architecture article, we created a kolla-ansible setup is in a python virtual environment. In order to deploy first, we will source the python environment and then run the Kolla-ansible command.

Use the following commands to source virtual environment and for deploying OpenStack.

[root@kolla-controller1 ~]# source train-venv/bin/activate
(train-venv) [root@kolla-controller1 ~]# 
(train-venv) [root@kolla-controller1 ~]# time kolla-ansible -i /etc/kolla/multinode deploy

kolla- ansible command in the above code section, time will let you know how much time commands has taken and Kolla-ansible command with -i option to specify the path to ansible inventory file, this file holds information which services are deployed on which host.

If you have successful installation, output looks like mentioned below.

PLAY RECAP ********************************************************************************************************************************************************************************************************
kolla-controller1             : ok=336  changed=226   unreachable=0    failed=0    skipped=110  rescued=0    ignored=0   
kolla-controller2             : ok=223  changed=178   unreachable=0    failed=0    skipped=45   rescued=0    ignored=0   
kolla-compute01               : ok=218  changed=180   unreachable=0    failed=0    skipped=38   rescued=0    ignored=0   
kolla-compute02               : ok=56   changed=48    unreachable=0    failed=0    skipped=8    rescued=0    ignored=0   
localhost                     : ok=6    changed=0     unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


real	36m33,668s
user	6m43,925s
sys	2m13,024s

Note*: Also, crosscheck the services’ containers are healthy or not.

Testing

In the previous section, we installed the OpenStack on top of 4 nodes. In this section test the whole environment, we will create the network add security rules, and also create the Cirros image later which will be used to create the virtual machine.

Running init-runonce (demo script)

Kolla-ansible also ships an already built-in script (init-runonce) that accomplishes all the above-mentioned things. init-runonce script can be found in kolla-ansible folder, you can also change the script and change the values for network, etc.

Before you run the script first you have to install openstack-client and source admin credentials. According to our setup we used the following commands:

[root@kolla-controller1 ~]# source train-venv/bin/activate
(train-venv) [root@kolla-controller1 ~]# 
(train-venv) [root@kolla-controller1 ~] pip install python-openstackclient
Collecting python-openstackclient
.
.
.
Successfully built pyperclip
Installing collected packages: wcwidth, pyperclip, os-service-types, jsonpointer, decorator, attrs, requestsexceptions, PrettyTable, munch, msgpack, keystoneauth1, jsonpatch, dogpile.cache, cmd2, autopage, appdirs, simplejson, oslo.serialization, openstacksdk, cliff, python-novaclient, python-keystoneclient, python-cinderclient, osc-lib, python-openstackclient
Successfully installed PrettyTable-2.5.0 appdirs-1.4.4 attrs-21.4.0 autopage-0.5.0 cliff-3.10.0 cmd2-2.3.3 decorator-5.1.1 dogpile.cache-1.1.5 jsonpatch-1.32 jsonpointer-2.2 keystoneauth1-4.4.0 msgpack-1.0.3 munch-2.5.0 openstacksdk-0.61.0 os-service-types-1.7.0 osc-lib-2.4.2 oslo.serialization-4.2.0 pyperclip-1.8.2 python-cinderclient-8.2.0 python-keystoneclient-4.4.0 python-novaclient-17.6.0 python-openstackclient-5.7.0 requestsexceptions-1.4.0 simplejson-3.17.6 wcwidth-0.2.5
WARNING: You are using pip version 21.3; however, version 21.3.1 is available.
(train-venv) [root@kolla-controller1 ~]# 
(train-venv) [root@kolla-controller1 ~]# source /etc/kolla/admin-openrc.sh
(train-venv) [root@kolla-controller1 ~]# ./train-venv/share/kolla-ansible/init-runonce

VM creation

Now create the VM and check the status of the VM.

(train-venv) [root@kolla-controller1 ~]# openstack server create \
>     --image cirros \
>     --flavor m1.tiny \
>     --key-name mykey \
>     --network demo-net \
>     demo1

+-------------------------------------+-----------------------------------------------+
| Field                               | Value                                         |
+-------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                        |
| OS-EXT-AZ:availability_zone         |                                               |
| OS-EXT-SRV-ATTR:host                | None                                          |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                          |
| OS-EXT-SRV-ATTR:instance_name       |                                               |
| OS-EXT-STS:power_state              | NOSTATE                                       |
| OS-EXT-STS:task_state               | scheduling                                    |
| OS-EXT-STS:vm_state                 | building                                      |
| OS-SRV-USG:launched_at              | None                                          |
| OS-SRV-USG:terminated_at            | None                                          |
| accessIPv4                          |                                               |
| accessIPv6                          |                                               |
| addresses                           |                                               |
| adminPass                           | xGqRK5zi5Ra3                                  |
| config_drive                        |                                               |
| created                             | 2021-08-05T13:04:29Z                          |
| flavor                              | m1.tiny (1)                                   |
| hostId                              |                                               |
| id                                  | 0bf754d6-a3f6-4a58-9e01-2daf937da4da          |
| image                               | cirros (65ea7ab9-367e-4410-b3fa-bcf35ed5fcd9) |
| key_name                            | mykey                                         |
| name                                | demo1                                         |
| progress                            | 0                                             |
| project_id                          | 637d4156bede4e6db03fc0f556ee0250              |
| properties                          |                                               |
| security_groups                     | name='default'                                |
| status                              | BUILD                                         |
| updated                             | 2021-08-05T13:04:29Z                          |
| user_id                             | fcc9299c122e4e41883875afd7bde61f              |
| volumes_attached                    |                                               |
+-------------------------------------+-----------------------------------------------+

(train-venv) [root@kolla-controller1 ~]#
(train-venv) [root@kolla-controller1 ~]# openstack server list 
+--------------------------------------+-------+--------+---------------------+--------+---------+
| ID                                   | Name  | Status | Networks            | Image  | Flavor  |
+--------------------------------------+-------+--------+---------------------+--------+---------+
| 0a26c765-b2a3-43bf-9470-e118db41cfe1 | demo1 | ACTIVE | demo-net=10.0.0.132 | cirros | m1.tiny |
+--------------------------------------+-------+--------+---------------------+--------+---------+



Conclusion

This article is the fourth and last article in the series of deploying OpenStack services and creating cloud orchestration on top of four nodes.

In the first article, we started how to set up the environment for the kolla-ansible. Once the kolla-ansible was setup we prepared all the nodes by doing password-less ssh from the management node and then installed required packages in the all nodes from kolla-ansible.

In the second article, we discussed important files which are required for the OpenStack installation and also saw the configuration which is needed for creating service images and for the deployment of those services.

In the third and fourth articles, we have seen how to create docker images for the OpenStack services and how to host those images in the local registry. At last, we deployed services in the container from the local registry’s images.

Leave a Comment

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