Quickstart guide with kolla-ansible (for rocky)

Posted on Fri 15 February 2019 in openstack • 2 min read

Requirements

  • kolla-ansible (testet with 7.0.1)
  • ansible (testet with 2.6.13)
  • epel-release (for centos)
  • python-pip

And some magic:

  • vagrant
  • vagrant-libvirt plugin
  • vagrant config

Quickstart

We will run all commands on our admin-node (vagrant ssh kolla-admin)

sudo yum install -y epel-release
sudo yum install -y python2-pip
sudo pip install kolla-ansible==7.0.1
sudo pip install ansible==2.6.13
sudo cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
sudo chown -R vagrant:vagrant /etc/kolla/
cp /usr/share/kolla-ansible/ansible/inventory/all-in-one ~/inventory

For ubuntu 16.04 :

sudo apt install python-pip
sudo cp -r /usr/local/share/kolla-ansible/etc_examples/kolla /etc/

Generate $random passwords with

kolla-genpwd

and maybe you want to change the keystone_admin_password password (this is your admin pass for the dashboard)

grep keystone_admin /etc/kolla/passwords.yml
keystone_admin_password: G26xkBrfltvrOk4rsG6MvAZFI418mrV5pgaSI9hm

~/ansible.cfg

Create this file in your $HOME.

[defaults]
retry_files_enabled=False
host_key_checking=False
deprecation_warnings=False
pipelining=True
forks=100

Adjust your ~/inventory

[control]
kolla-ctl0 ansible_become=true
kolla-ctl1 ansible_become=true
kolla-ctl2 ansible_become=true

[network:children]
control

[external-compute]
kolla-comp0 ansible_become=true
kolla-comp1 ansible_become=true

[storage]
kolla-ctl0 ansible_become=true

[monitoring:children]
control

[baremetal:children]
control
compute

[glance]
kolla-ctl0 ansible_become=true

Configure kolla-ansible

$ egrep -v "^#|^$" /etc/kolla/globals.yml 
---
config_strategy: "COPY_ALWAYS"
kolla_base_distro: "centos"
kolla_install_type: "source"
openstack_release: "rocky"
kolla_internal_vip_address: "10.20.20.254"
network_interface: "eth1"
storage_interface: "eth2"
tunnel_interface: "eth2"
neutron_external_interface: "eth3"

Deploy openstack

$ kolla-ansible -i ~/inventory bootstrap-servers
$ kolla-ansible -i ~/inventory pull
$ kolla-ansible -i ~/inventory prechecks
$ kolla-ansible -i ~/inventory deploy

stopwatch

with VMs & a 50mbit line

  • bootstrap 2m55.526s
  • pull (on each vm) 20m49.273s
  • deploy ~18m10.771s

speedup - pull-through cache

On the kolla-admin node

$ sudo yum install -y docker
$ sudo systemctl enable docker
$ sudo systemctl start docker
$ sudo pip install docker-compose
$ sudo mkdir /{srv,opt}/registry
$ sudo chown vagrant:vagrant /opt/registry
$ sudo setenforce 0
$ cat /opt/registry/config.yml
version: 0.1
log:
  fields:
    service: registry
storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/registry
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3
proxy:
  remoteurl: https://registry-1.docker.io
$ cat /opt/registry/docker-compose.yaml
version: '3'

services:

  registry:
    image: registry
    restart: always
    ports:
        - 5000:5000
    volumes:
        - /opt/registry/config.yml:/etc/docker/registry/config.yml
        - /srv/registry:/var/lib/registry
$ cd /opt/registry
$ sudo docker-compose up -d

Configure the registry in kolla

$ grep "^docker_registry" /etc/kolla/globals.yml
docker_registry: "10.20.30.31:5000"

Rerun the bootstrap (kolla-ansible will configure the registry for you)

$ time kolla-ansible -i ~/inventory pull --forks=1
[...]
real    7m37.361s
user    1m20.185s
sys     0m23.208s