How to upgrade OpenStack Version through kolla-ansible

Share this article

Introduction

Cloud computing: is the on-demand availability of computing resources like servers, data storage, development tools, networking capabilities, and many more. These resources are hosted somewhere remotely located data center managed by a cloud services provider and accessed over the internet.

OpenStack is a cloud operating system that provides on-demand availability of computing resources like servers, data storage, development tools, networking capabilities, and many more. These resources are hosted somewhere remotely located data center managed by a cloud services provider and accessed over the internet. There are multiple projects which allow to deploy and manage the Openstack lifecycle and one of them is kolla-ansible. In our previous articles, we have seen how to install OpenStack through kolla-ansible.

OpenStack keeps evolving day by day and we are seeing regularly new OpenStack versions. In our previous article, we have shown in our previous articles how to deploy OpenStack in a single node or in multiple nodes.
In this article, we will explain how to upgrade OpenStack version Xena to Yoga through kolla-ansible. We will be upgrading our multinode environment you can refer to the following blogs for more details of the multinode environment and its deployment

  1. Openstack multinode deployment through Kolla-ansible [part 1]
  2. Kolla Ansible Files & Configurations for Openstack Multinode installation [Part -2]
  3. Openstack Multinode environment setup and image building through Kolla-ansible [Part 3]
  4. Openstack Multinode Deployment through Kolla-ansible [part-4]

Preparation Phase

In the preparation Phase, we will do all the necessary steps required for the upgrade.

Create a virtual environment for the Yoga OpenStack version:

You can upgrade your current environment to deploy the new version. We deploy kolla ansible in a python virtual environment to avoid conflicts with the system’s site packages, a new virtual environment is easy to create than upgrading the old environment because once you have upgraded the packages and also have to check the package compatibility in the system.

In CentOS, you can use below mentioned command to install the virtual environment package and create a virtual environment.

python3 -m venv /path/to/new/virtual/environment
source /path/to/new/virtual/environment/bin/activate

We have run the following command in our management node and then we will switch to the virtual environment, then we switched to the virtual environment.

[root@kolla-controller1 ~]# cd /root
[root@kolla-controller1 ~]# python3 -m venv xena-venv
[root@kolla-controller1 ~]# source xena-venv/bin/activate
(xena-venv) [root@kolla-controller1 ~]#
Note*: make sure that all the commands we will be running in the virtual environment, therefore make sure if you deactivate the virtual environment or close the session first source the virtual environment before running the commands.

Install the latest version of pip and for Xena deployment, we need Ansible at least 2.10 and supports up to 4. use the following command to do it.

pip install -U pip
pip install 'ansible<5.0'

Create Openstack services’ Images

To create the images first we need to install kolla in our environment therefore first clone the git repository by using the following commands, then check out the Xena version and install the requirements of kolla in the environment.

cd xena-venv/
git clone https://github.com/openstack/kolla
cd kolla
git checkout stable/xena
pip install .

Command outputs in my environment.

(xena-venv) [root@kolla-controller1 ~]# cd xena-venv/
(xena-venv) [root@kolla-controller1 xena-venv]#
(xena-venv) [root@kolla-controller1 xena-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.
(xena-venv) [root@kolla-controller1 xena-venv]# cd kolla
(xena-venv) [root@kolla-controller1 kolla]# git checkout stable/xena
Already on 'stable/xena'
Your branch is up to date with 'origin/stable/xena'.
(xena-venv) [root@kolla-controller1 kolla]# pip install .

Once all the package is installed, In our previous article we have explained how to create the images. This article explains all the important nuances of image creation and image overriding.

Edit globals.yml

In this subsection, we will be comparing globals.yml or will configure new globals.yml.

Personally, I think comparing and merging changes of current globals.yml to new globals.yml is a nice way to enable the services you are currently running and look for newly added parameters or removed parameters. For comparing and merging I have used the meld application. Updated globals.yml looks like below. Here our nova_compute_virt_type is qemu because our testing setup is in virtual machines.

###############
# Kolla options
###############
kolla_install_type: "source"
openstack_release: "yoga"
kolla_internal_vip_address: "192.168.100.100"
kolla_external_vip_address: "192.168.200.100"

################
# Docker options
################
docker_registry: "192.168.100.11:5001"

##############################
# Neutron - Networking Options
##############################
network_interface: "eth1"
kolla_external_vip_interface: "eth0"
neutron_external_interface: "eth2"
neutron_plugin_agent: "openvswitch"

###################
# OpenStack options
###################
enable_neutron_agent_ha: "yes"
enable_openvswitch: "{{ enable_neutron | bool and neutron_plugin_agent != 'linuxbridge' }}"

########################
# Nova - Compute Options
########################
nova_compute_virt_type: "qemu"

Generate new passwords:

There are new services that require new password generation, which is quite straightforward. Follow the steps mentioned below to generate passwords for new services.

Copy your current passowrd.yml file and copy passwords.yml of the yoga version.

cp /etc/kolla/passwords.yml passwords.yml.old
cp /root/yoga-venv/share/kolla-ansible/etc_example/kolla/passwords.yml passwords.yml.new

Now generate the password in the newly copied password file. After running the following command you will see that all the passwords are generated in the passwords.yml file.

kolla-genpwd -p passwords.yml.new

This step is the most important because it will merge the old password and the newly generated password, use the following commands

kolla-mergepwd --old passwords.yml.old --new passwords.yml.new --final /etc/kolla/passwords.yml

Upgrade Phase.

In this section we will actually upgrade the OpenStack version, we can perform this phase in two ways one by upgrading each service or upgrade the whole process.

Upgrade each service

Here we will upgrade services one by one, doing so will provide control over the specific service and you will be more aware of the service if something wrong happens. Use the following command

kolla-ansible -i /etc/kolla/multinode upgrade -t service_name

Upgrade the whole deployment

Here we will upgrade the whole deployment in one go. Use the following command.

kolla-ansible -i /etc/kolla/multinode upgrade


The output of this command looks something like mentioned in the following code section.

PLAY RECAP ********************************************************************************************************************************************************************************************************
kolla-controller1             : ok=286  changed=206   unreachable=0    failed=0    skipped=80  rescued=0    ignored=0   
kolla-controller2             : ok=193  changed=158   unreachable=0    failed=0    skipped=35   rescued=0    ignored=0   
kolla-compute01               : ok=178  changed=140   unreachable=0    failed=0    skipped=38   rescued=0    ignored=0   
kolla-compute02               : ok=56   changed=44    unreachable=0    failed=0    skipped=12    rescued=0    ignored=0   
localhost                     : ok=6    changed=0     unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


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

Testing

In the previous section, we have mentioned how to upgrade if the upgrade is successful without any error that means all the services are upgraded. see the code section for the following section for a reference of how a successful upgrade looks like.
Check all the services and containers are they in a healthy state! If any service is not working properly try to debug those services maybe you have missed some upgraded configuration parameters or sometimes you are just unlucky, services need your little intervention to work properly.

Once the health of all the containers is good then check your VMs are running like before, and try to create a new VM with volumes and try to use all the core services and other service components to check every service is running fine.

.

1 thought on “How to upgrade OpenStack Version through kolla-ansible”

Leave a Comment

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