Introduction

Our Private Cloud Core deployments provide workload orchestration through the use of kolla-ansible which deploys OpenStack services and infrastructure components in Docker containers. Should you want to make a change to an OpenStack service’s configuration or add a new OpenStack service, you will need to use kolla-ansible. Read along to learn how to reconfigure your OpenStack cloud using kolla-ansible. This guide introduces you to the basics of using kolla-ansible and links to examples of what can be done using it.

Please note! — You should have an understanding of how both Docker and Ansible work before working with kolla-ansible. Making changes using kolla-ansible can potentially cause degradation of services or the cloud to be inoperable. Be careful!

References:


 

Using kolla-ansible

To start using kolla-ansible, an environment needs to be created. This section explains the steps needed to create that environment.


To get a quick idea of what is required, here is a high-level overview of the steps:

# Copy kolla-ansible configuration from fm-deploy docker container
$ docker cp fm-deploy:/opt/kolla-ansible /opt/kolla-ansible

# Navigate to /opt/kolla-ansible
$ cd /opt/kolla-ansible

# Initialize a Python virtual environment
$ virtualenv .venv

# Activate the virtual environment
$ source .venv/bin/activate

# Update pip
pip install --upgrade pip

# Install kolla-ansible using requirements.txt
$ pip install -r requirements.txt

Once prepared, make the needed changes and perform the kolla-ansible run:

# Reconfigures kolla-ansible using specified inventory file
$ kolla-ansible -i /etc/fm-deploy/kolla-ansible-inventory reconfigure

These steps are explained in more detail below.


 

Prepare and use kolla-ansible

Follow these steps to learn how to prepare and use kolla-ansible.


Relevant files

  • Globals file: /etc/kolla/globals.yml
  • Inventory file: /etc/fm-deploy/kolla-ansible-inventory

Note! — The above files may not be present on each host. Inspect each host until you find the above, and perform the kolla-ansible run from this host.


Before Making Changes

Before any changes are made to the kolla-ansible configuration, the following variables in globals.yml should not be modified, otherwise they will be overwritten:

  • api_interface
  • cluster_interface
  • dns_interface
  • docker_registry_insecure
  • kolla_enable_tls_external
  • kolla_external_fqdn
  • kolla_external_vip_address
  • kolla_internal_vip_address
  • migration_interface
  • network_interface
  • neutron_external_interface
  • openstack_region_name
  • storage_interface
  • tunnel_interface

Preparation

Step 1 – Prepare environment

From the Docker container called fm-deploy, copy /opt/kolla-ansible to the local file system:

$ docker cp fm-deploy:/opt/kolla-ansible /opt/kolla-ansible

 

Step 2 — Prepare Python virtual environment

Create a Python virtual environment from which kolla-ansible will be used:

$ cd /opt/kolla-ansible
$ virtualenv .venv
$ source .venv/bin/activate

 

Step 3 — Update pip

If pip is not up to date, packages may not install.

Pip can be updated using:

pip install --upgrade pip

 

Step 4 — Install kolla-ansible using requirements.txt

A requirements.txt file is used to install kolla-ansible. The release of OpenStack your cloud is running will determine the version of kolla-ansible to install. This means you need to inspect requirements.txt and ensure the right version of kolla-ansible is installed.

At the time of writing this guide, the OpenStack release used in Private Cloud Core is Victoria.

To determine the release your cloud is using, as root from a hardware node, run docker ps to get a list of all Docker containers running. In that output is shown each OpenStack service’s image, appended with the OpenStack version.

For example:

$ docker ps
cf9e23cef540   harbor.imhadmin.net/kolla/centos-binary-mariadb-clustercheck:victoria        "dumb-init --single-…"   8 days ago    Up 8 days                                 mariadb_clustercheck
c19964a28b4e   harbor.imhadmin.net/kolla/centos-binary-mariadb-server:victoria              "dumb-init -- kolla_…"   8 days ago    Up 8 days                                 mariadb

In this output, the second column represents a kolla-ansible image and there are two entries. The output has been truncated and you should see many more Docker containers running than two. At the end of the image name the version of OpenStack for which that image is built can be seen following the colon:

harbor.imhadmin.net/kolla/centos-binary-mariadb-clustercheck:victoria

The above indicates this OpenStack cloud is on the Victoria release.

Next, in a text editor load requirements.txt and uncomment the appropriate version for kolla-ansible.

The contents of this file appears this way:

ansible>=2.9,<2.10,!=2.9.10

# Use one of the following supported OpenStack versions:
#git+https://github.com/openstack/kolla-ansible@stable/train
#git+https://github.com/openstack/kolla-ansible@stable/ussuri
#git+https://github.com/openstack/kolla-ansible@stable/victoria

For the purpose of this demonstration, the OpenStack release is Victoria, so the #git+https://github.com/openstack/kolla-ansible@stable/victoria line within this file needs to be uncommented, or, in other words, remove the prepended #.

The file should now appear this way:

ansible>=2.9,<2.10,!=2.9.10

# Use one of the following supported OpenStack versions:
#git+https://github.com/openstack/kolla-ansible@stable/train
#git+https://github.com/openstack/kolla-ansible@stable/ussuri
git+https://github.com/openstack/kolla-ansible@stable/victoria

Now, requirements.txt is prepared and can be used to install kolla-ansible:

(.venv) $ pip install -r requirements.txt

 

Step 5 — Make needed adjustments

Typically at this stage you need to adjust the appropriate file to enable or disable a service, such as central logging for example. As an example, this section demonstrates enabling central logging.

To enable central logging, pull up /etc/kolla/globals.yml in a text editor, then change:

enable_central_logging: 'no'

to:

enable_central_logging: 'yes'

 

Step 6 — Perform the kolla-ansible reconfigure run

The base kolla-ansible command takes this form:

kolla-ansible -i $INVENTORY <command>
  • $INVENTORY — This is /etc/fm-deploy/kolla-ansible-inventory
  • <command> — In this guide, reconfigure will be used.

Perform the kolla-ansible run:

$ kolla-ansible -i /etc/fm-deploy/kolla-ansible-inventory reconfigure

 

Next Steps

This concludes the steps needed to have a base understanding of how to use kolla-ansible.

The following guides go into detail about specific things you can configure using kolla-ansible, such enabling TLS for Horizon or enabling Central Logging: