Install and configure OpenStack Pike with Kolla as a standalone
words - read.

Install and configure OpenStack Pike with Kolla as a standalone

Kolla is an OpenStack project focused on deploying, maintaining, and upgrading easily production OpenStack clouds following the community best practices. To achieve this goal, Kolla uses two main technologies: Ansible automation scripts and Docker containers. As you will see, it is really easy to deploy and maintain OpenStack using Kolla.

OpenStack Kolla Logo

Prerequisites

For this lab, we will deploy Ocata which is the last stable version of OpenStack on a single machine. This kind of deployment is also known as All-In-One (AIO). Kolla is supported on CentOS, Oracle Linux and Ubuntu.

Linux distribution

We will use a Ubuntu 16.04 VM with 4 vCPU, 8 GB of RAM and 40 GB of disk. Depending on the number of OpenStack services you are willing to install, you may have to add more RAM and more disk space.

Networking

The VM will have two NICs configured with a static IP. The first NIC will have the IP 10.10.20.31/24, the second NIC will have the IP 10.10.20.32/24, and the gateway will be 10.10.20.1/24. We will also need two virtual IPs for HAproxy and we will use 10.10.20.30/24 for the external virtual IP and 10.10.20.33/24 for the internal virtual IP.

Installation of Ubuntu 16.04 LTS

1- Download the ISO of Ubuntu 16.04 LTS.
2- Boot your machine with this ISO and choose the language of the installer.

Ubuntu Installation

3- Start the installation of Ubuntu.

Ubuntu Installation

4- Select your language.

Ubuntu Installation

5- Select the location of your server.

Ubuntu Installation

6- Skip the automatic detection of the keyboard layout.

Ubuntu Installation

7- Select the country of your keyboard.

Ubuntu Installation

8- Select the layout of your keyboard.

Ubuntu Installation

9- Select your primary network card.

Ubuntu Installation

10- The DHCP configuration will fail, which is fine as we want to use a static IP.

Ubuntu Installation

11- Configure the network manually.

Ubuntu Installation

12- Enter the IP of the machine.

Ubuntu Installation

13- Enter the netmask of the machine.

Ubuntu Installation

14- Enter your gateway.

Ubuntu Installation

15- Enter the DNS that you would like to use (example: 8.8.8.8 for google DNS).

Ubuntu Installation

16- Enter a hostname.

Ubuntu Installation

17- Enter your domain name if you have one.

Ubuntu Installation

18- Create the user account kolla.

Ubuntu Installation

19- Create the username kolla.

Ubuntu Installation

20- Enter your password for the kolla user.

Ubuntu Installation

21- Confirm the password for the kolla user.

Ubuntu Installation

22- Choose if you want to encrypt the kolla user home directory.

Ubuntu Installation

23- Confirm your timezone.

Ubuntu Installation

24- Configure the partitioning with LVM.

Ubuntu Installation

25- Select the disk to partition.

Ubuntu Installation

26- Confirm the partitioning.

Ubuntu Installation

27- Choose the size of the partition.

Ubuntu Installation

28- Confirm that the changes will be written on the disk.

Ubuntu Installation

29- Enter your proxy if you use one.

Ubuntu Installation

30- Choose to install the security update automatically.

Ubuntu Installation

31- Choose to install the standard system utilities and the OpenSSH server.

Ubuntu Installation

32- Choose to install the GRUB boot loader to the master boot record.

Ubuntu Installation

33- Reboot the system.

Ubuntu Installation

Your new Ubuntu 16.04 LTS is now installed. You can SSH to it with the kolla user.

Upgrade Ubuntu 16.04 LTS

1- Update the the APT repository.

$ sudo apt-get update

2- Upgrade your system.

$ sudo apt-get upgrade

Configure the network

1- The first interface (ens192 in my case) should have an IP and the second interface (ens224 in my case) should be down.

$ ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       validlft forever preferredlft forever
    inet6 ::1/128 scope host 
       validlft forever preferredlft forever
2: ens192:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:01:1e:8c brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.31/24 brd 10.10.20.255 scope global ens192
       validlft forever preferredlft forever
    inet6 fe80::250:56ff:fe01:1e8c/64 scope link 
       validlft forever preferredlft forever
3: ens224:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:50:56:01:1e:8e brd ff:ff:ff:ff:ff:ff

2- Edit the network configuration file.

$ sudo vim /etc/network/interfaces

3- Add the following lines to your network configuration file to get an IP from the DHCP server (you can of course use a static IP if you wish). Replace [second_nic_label] with the label of your interface.

# The secondary network interface
auto [second_nic_label]
iface [second_nic_label] inet static
        address 10.10.20.32
        netmask 255.255.255.0

4- Restart the network.

$ sudo systemctl restart networking

5- Check if your second network card got an IP.

$ sudo ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       validlft forever preferredlft forever
    inet6 ::1/128 scope host 
       validlft forever preferredlft forever
2: ens192:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:01:1e:8c brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.31/24 brd 10.10.20.255 scope global ens192
       validlft forever preferredlft forever
    inet6 fe80::250:56ff:fe01:1e8c/64 scope link 
       validlft forever preferredlft forever
3: ens224:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:01:1e:8e brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.32/24 brd 10.10.20.255 scope global ens224
       validlft forever preferredlft forever
    inet6 fe80::250:56ff:fe01:1e8e/64 scope link 
       validlft forever preferredlft forever

Install Kolla Dependancies

$ sudo apt-get install python-jinja2 python-pip libssl-dev

$ sudo pip install --upgrade pip

$ sudo pip install ansible

Install and configure Kolla

1- Install kolla-ansible.

$ sudo pip install kolla-ansible==6.0.0.0rc2

2- Copy the configurations files.

$ sudo cp -r /usr/local/share/kolla-ansible/etc_examples/kolla /etc/kolla

3- Edit the Kolla configuration.

$ sudo vim /etc/kolla/globals.yml

4- Modify the following values. Modify [first_nic_label], and [second_nic_label] accordingly.

kolla_base_distro: "centos"
kolla_install_type: "binary"
openstack_release: "pike"
kolla_internal_vip_address: "10.10.20.33"
kolla_external_vip_address: "10.10.20.30"
network_interface: "[first_nic_label]"
neutron_external_interface: "[second_nic_label]"
kolla_enable_tls_external: "yes"
kolla_external_fqdn_cert: "{{ nodeconfigdirectory }}/certificates/haproxy.pem"

5- Generate a self-signed TLS certificate for the HAProxy external interface. It will be stored in /etc/kolla/certificates. You can of course also use a signed certificates if you have one.

$ sudo kolla-ansible certificates

6- Use QEMU instead of KVM (you can skip this step if your host supports hardware virtualization).

$ sudo mkdir -p /etc/kolla/config/nova

$ sudo vim /etc/kolla/config/nova/nova-compute.conf

Add the following lines:

[libvirt]
virt_type = qemu
cpu_mode = none

7- If you are deploying a nested environment (your host is a VM), you need to enable promiscuous on your virtual network. If you don't do this, your instances will not have external connectivity.

8- Generate password for the deployment.

$ sudo kolla-genpwd

9- Bootstrap the server.

$ sudo kolla-ansible \
-i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one \
bootstrap-servers

10- Verify if the bootstrap was successful.

localhost: ok=40   changed=20   unreachable=0    failed=0

11- Pull the different Docker images needed by Kolla.

$ sudo kolla-ansible pull

Deploy OpenStack using Kolla

1- Check the environment.

$ sudo kolla-ansible prechecks \
-i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one

2- Verify if the precheck was successful.

localhost: ok=83   changed=1    unreachable=0    failed=0

3- Deploy OpenStack.

$ sudo kolla-ansible deploy \
-i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one

4-Verify if all the containers are up and running.

$ sudo docker ps -a

5- Generate the admin-openrc.sh configuration file.

$ sudo kolla-ansible post-deploy

6- Install the openstack CLI client.

$ sudo pip install python-openstackclient

7- Edit the init-runonce file.

$ sudo vim /usr/local/share/kolla-ansible/init-runonce

8- Modify the public network scheme.

EXT_NET_CIDR='10.10.20.0/24'
EXT_NET_RANGE='start=10.10.20.110,end=10.10.20.254'
EXT_NET_GATEWAY='10.10.20.1'

9- Get the root privileges.

$ sudo -s

10- Load the environment variable needed by the OpenStack CLI

# source /etc/kolla/admin-openrc.sh

11- Initialize the deployment.

# cd /usr/local/share/kolla-ansible/ && ./init-runonce

Access the Horizon console

1- Get the admin user password.

$ sudo grep keystone_admin_password /etc/kolla/passwords.yml

2- Browse to the external virtual IP https://10.10.20.30 and login with the user "admin" and the password from the previous step.

OpenStack Horizon Login Page

At this point you should have a working deployment of OpenStack Ocata. If you want to add more services like Cinder (block storage) or Swift (object storage), please refer to the specific annexes.

Annexes

Kolla management

Destroy the OpenStack deployment

1- Delete all the instances in your OpenStack environment.

2- Destroy the OpenStack deployment.

$ sudo kolla-ansible destroy --yes-i-really-really-mean-it

Stop the deployed containers

1- Go in the tools directory.

$ cd /usr/local/share/kolla-ansible/tools

2- Stop the containers

$ sudo ./stop-containers

Remove the deployed containers

1- Go to the tools directory.

$ cd /usr/local/share/kolla-ansible/tools

2- Remove the containers

$ sudo ./cleanup-containers

Remove the network modification done by Neutron.

1- Go to the tools directory.

$ cd /usr/local/share/kolla-ansible/tools

2- Clean the network.

$ sudo ./cleanup-host

Remove the containers images stored in the local registry.

1- Go to the tools directory.

$ cd /usr/local/share/kolla-ansible/tools

2- Clean the images.

$ sudo ./cleanup-images

Add more services

Cinder (block storage)

To make things more readable this content has been moved to the Configure Cinder on OpenStack Pike standalone with Kolla article.

Swift (object storage)

To make things more readable this content has been moved to the Configure Swift on OpenStack Pike standalone with Kolla article.

Comments

comments powered by Disqus