Kolla Ansible deploying OpenStack wallaby on Ubuntu 20.04 [part-2]

Share this article

In part-1, we have seen how to deploy OpenStack through kolla-ansible. In this blog, we will test our installation and run our first testing virtual machine.

Container testing

In the deployment phase when you are done with installation. You will see the below-mentioned output. That means your installation has been done.

PLAY RECAP ******************************************************************************************
ubuntu-exp    : ok=259  changed=151  unreachable=0    failed=0    skipped=121  rescued=0    ignored=0  

Now check all the containers, are they up and running, and make sure do you have all the containers there which you enabled in globals.yml.

Use the command to check the container.

(wallaby) ubuntu@ubuntu-exp:~$ sudo docker ps -a

The command output will look like this 🙂

Installing Openstack client and dependencies

For running commands from our terminal, we need to install the OpenStack client and its dependencies. So that in the future we can test and manage our deployment from CLI.

(wallaby) ubuntu@ubuntu-exp:~$ pip install python-openstackclient

Evaluation

Create an admin-openrc file that basically contains admin credentials and some important environment variables. Use the following command to create admin-openrc.sh file.

(wallaby) ubuntu@ubuntu-exp:~$ kolla-ansible post-deploy  /etc/kolla/admin-openrc.sh

For evaluation, we will be going to run init-runonce initialize script. Which comes with Kolla ansible. This script will create example networks, images, flavors etc. Usually this script would be in your kolla-ansible folder.

(wallaby) ubuntu@ubuntu-exp:~/wallaby/share/kolla-ansible$ ls
ansible  doc  etc_examples  init-runonce  init-vpn  setup.cfg  tools

Before running this script source the admin credentials and run this script.

(wallaby) ubuntu@ubuntu-exp:~/wallaby/share_back/kolla-ansible$ source /etc/kolla/admin-openrc.sh 
(wallaby) ubuntu@ubuntu-exp:~/wallaby/share_back/kolla-ansible$ 
(wallaby) ubuntu@ubuntu-exp:~/wallaby/share_back/kolla-ansible$ ./init-runonce 

You can use GUI for managing your OpenStack. I used the same credentials which is in admin-openrc.sh file to log in as an admin.

Testing

Create a VM

Create the VM by using the following command.

(wallaby) ubuntu@ubuntu-exp:~/wallaby/share_back/kolla-ansible$ 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                    |                                               |
+-------------------------------------+-----------------------------------------------+


Check the VM is running or not.

(wallaby) ubuntu@ubuntu-exp:~$ 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 |
+--------------------------------------+-------+--------+---------------------+--------+---------+
(wallaby) ubuntu@ubuntu-exp:~$ 

Issues

In this whole process I have faced only one issue. At the end I am not able to create VMs. When I was trying to create a VM I am getting an issue, mentioned below.

    domain = self.get_connection().defineXML(xml)
  File "/usr/lib/python3.6/site-packages/eventlet/tpool.py", line 190, in doit
    result = proxy_call(self._autowrap, f, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/eventlet/tpool.py", line 148, in proxy_call
    rv = execute(f, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/eventlet/tpool.py", line 129, in execute
    six.reraise(c, e, tb)
  File "/usr/lib/python3.6/site-packages/six.py", line 703, in reraise
    raise value
  File "/usr/lib/python3.6/site-packages/eventlet/tpool.py", line 83, in tworker
   rv = meth(*args, **kwargs)
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 4403, in defineXML
    raise libvirtError('virDomainDefineXML() failed')
  libvirt.libvirtError: unsupported configuration: Emulator '/usr/libexec/qemu-kvm' does not support virt type 'kvm'


In order to remove this issue, I have to change in nova-compute configuration in libvirt section changed virt_type from kvm to qemu.

virt_type = qemu

Restart the nova-compute container.

(wallaby) ubuntu@ubuntu-exp:~$ sudo docker restart nova_compute 
nova_compute
(wallaby) ubuntu@ubuntu-exp:~$ 

Leave a Comment

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