In the quickstart there is need the git package to install
kolla-ansible from the source for deployment or evaluation and
to clone repository for development.
Closes-Bug: #1999370
Change-Id: Ia623694c801c03b151944947141551ecbc1d24f5
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
(cherry picked from commit 629710c63c)
16 KiB
Quick Start
This guide provides step by step instructions to deploy OpenStack using Kolla Ansible on bare metal servers or virtual machines.
Recommended reading
It's beneficial to learn basics of both Ansible and Docker before running Kolla Ansible.
Host machine requirements
The host machine must satisfy the following minimum requirements:
- 2 network interfaces
- 8GB main memory
- 40GB disk space
See the support matrix <user/support-matrix>
for details of supported host Operating Systems. Kolla Ansible supports
the default Python 3.x versions provided by the supported Operating
Systems. For more information see tested runtimes.
Install dependencies
Typically commands that use the system package manager in this section must be run with root privileges.
It is generally recommended to use a virtual environment to install
Kolla Ansible and its dependencies, to avoid conflicts with the system
site packages. Note that this is independent from the use of a virtual
environment for remote execution, which is described in Virtual Environments <user/virtual-environments.html>.
For Debian or Ubuntu, update the package index.
sudo apt updateInstall Python build dependencies:
For CentOS, RHEL 8 or openEuler, run:
sudo dnf install git python3-devel libffi-devel gcc openssl-devel python3-libselinuxFor Debian or Ubuntu, run:
sudo apt install git python3-dev libffi-dev gcc libssl-dev
Install dependencies using a virtual environment
If not installing Kolla Ansible in a virtual environment, skip this section.
Install the virtual environment dependencies.
For CentOS, RHEL 8 or openEuler, you don't need to do anything.
For Debian or Ubuntu, run:
sudo apt install python3-venvCreate a virtual environment and activate it:
python3 -m venv /path/to/venv source /path/to/venv/bin/activateThe virtual environment should be activated before running any commands that depend on packages installed in it.
Ensure the latest version of pip is installed:
pip install -U pipInstall Ansible. Kolla Ansible requires at least Ansible
4and supports up to5.pip install 'ansible>=4,<6'
Install dependencies not using a virtual environment
If installing Kolla Ansible in a virtual environment, skip this section.
Install
pip.For CentOS, RHEL or openEuler, run:
sudo dnf install python3-pipFor Debian or Ubuntu, run:
sudo apt install python3-pipEnsure the latest version of pip is installed:
sudo pip3 install -U pipInstall Ansible. Kolla Ansible requires at least Ansible
4and supports up to5.For CentOS or RHEL, run:
sudo dnf install ansibleFor openEuler, run:
sudo pip install ansibleFor Debian or Ubuntu, run:
sudo apt install ansibleNote
If the installed Ansible version does not meet the requirements, one can use pip:
sudo pip install -U 'ansible>=4,<6'. Beware system package upgrades might interfere with that so it is recommended to uninstall the system package first. One might be better off with the virtual environment method to avoid this pitfall.
Install Kolla-ansible
Install Kolla-ansible for deployment or evaluation
Install kolla-ansible and its dependencies using
pip.If using a virtual environment:
pip install git+https://opendev.org/openstack/kolla-ansible@|KOLLA_BRANCH_NAME|If not using a virtual environment:
sudo pip3 install git+https://opendev.org/openstack/kolla-ansible@|KOLLA_BRANCH_NAME|Create the
/etc/kolladirectory.sudo mkdir -p /etc/kolla sudo chown $USER:$USER /etc/kollaCopy
globals.ymlandpasswords.ymlto/etc/kolladirectory.If using a virtual environment:
cp -r /path/to/venv/share/kolla-ansible/etc_examples/kolla/* /etc/kollaIf not using a virtual environment, run:
cp -r /usr/local/share/kolla-ansible/etc_examples/kolla/* /etc/kollaCopy
all-in-oneandmultinodeinventory files to the current directory.If using a virtual environment:
cp /path/to/venv/share/kolla-ansible/ansible/inventory/* .For
all-in-onescenario in virtual environment add the following to the very beginning of the inventory:localhost ansible_python_interpreter=pythonIf not using a virtual environment, run:
cp /usr/local/share/kolla-ansible/ansible/inventory/* .
Install Kolla for development
Clone
kolla-ansiblerepository from git.git clone --branch |KOLLA_BRANCH_NAME| https://opendev.org/openstack/kolla-ansibleInstall requirements of
kollaandkolla-ansible:If using a virtual environment:
pip install ./kolla-ansibleIf not using a virtual environment:
sudo pip3 install ./kolla-ansibleCreate the
/etc/kolladirectory.sudo mkdir -p /etc/kolla sudo chown $USER:$USER /etc/kollaCopy the configuration files to
/etc/kolladirectory.kolla-ansibleholds the configuration files (globals.ymlandpasswords.yml) inetc/kolla.cp -r kolla-ansible/etc/kolla/* /etc/kollaCopy the inventory files to the current directory.
kolla-ansibleholds inventory files (all-in-oneandmultinode) in theansible/inventorydirectory.cp kolla-ansible/ansible/inventory/* .
Install Ansible Galaxy requirements
Install Ansible Galaxy dependencies (Yoga release onwards):
kolla-ansible install-deps
Configure Ansible
For best results, Ansible configuration should be tuned for your
environment. For example, add the following options to the Ansible
configuration file /etc/ansible/ansible.cfg:
[defaults]
host_key_checking=False
pipelining=True
forks=100Further information on tuning Ansible is available here.
Prepare initial configuration
Inventory
The next step is to prepare our inventory file. An inventory is an Ansible file where we specify hosts and the groups that they belong to. We can use this to define node roles and access credentials.
Kolla Ansible comes with all-in-one and
multinode example inventory files. The difference between
them is that the former is ready for deploying single node OpenStack on
localhost. If you need to use separate host or more than one node, edit
multinode inventory:
Edit the first section of
multinodewith connection details of your environment, for example:[control] 10.0.0.[10:12] ansible_user=ubuntu ansible_password=foobar ansible_become=true # Ansible supports syntax like [10:12] - that means 10, 11 and 12. # Become clause means "use sudo". [network:children] control # when you specify group_name:children, it will use contents of group specified. [compute] 10.0.0.[13:14] ansible_user=ubuntu ansible_password=foobar ansible_become=true [monitoring] 10.0.0.10 # This group is for monitoring node. # Fill it with one of the controllers' IP address or some others. [storage:children] compute [deployment] localhost ansible_connection=local become=true # use localhost and sudoTo learn more about inventory files, check Ansible documentation.
Check whether the configuration of inventory is correct or not, run:
ansible -i multinode all -m pingNote
Distributions might not come with Python pre-installed. That will cause errors in the
pingmodule. To quickly install Python with Ansible you can run: for Debian or Ubuntu:ansible -i multinode all -m raw -a "apt -y install python3", and for CentOS, RHEL or openEuler:ansible -i multinode all -m raw -a "dnf -y install python3".
Kolla passwords
Passwords used in our deployment are stored in
/etc/kolla/passwords.yml file. All passwords are blank in
this file and have to be filled either manually or by running random
password generator:
For deployment or evaluation, run:
kolla-genpwd
For development, run:
cd kolla-ansible/tools
./generate_passwords.py
Kolla globals.yml
globals.yml is the main configuration file for Kolla
Ansible. There are a few options that are required to deploy Kolla
Ansible:
Image options
User has to specify images that are going to be used for our deployment. In this guide Quay.io-provided, pre-built images are going to be used. To learn more about building mechanism, please refer
Building Container Images <admin/image-building.html>.Kolla provides choice of several Linux distributions in containers:
- CentOS Stream (
centos) - Ubuntu (
ubuntu) - Debian (
debian) - RHEL (
rhel, deprecated)
For newcomers, we recommend to use CentOS Stream 8 or Ubuntu 20.04.
kolla_base_distro: "centos"Next "type" of installation needs to be configured. Choices are:
- binary
-
using repositories like apt or dnf
- source (default)
-
using raw source archives, git repositories or local source directory
Note
This only affects OpenStack services. Infrastructure services are always "binary".
Note
Source builds are proven to be slightly more reliable than binary.
kolla_install_type: "source"- CentOS Stream (
Networking
Kolla Ansible requires a few networking options to be set. We need to set network interfaces used by OpenStack.
First interface to set is "network_interface". This is the default interface for multiple management-type networks.
network_interface: "eth0"Second interface required is dedicated for Neutron external (or public) networks, can be vlan or flat, depends on how the networks are created. This interface should be active without IP address. If not, instances won't be able to access to the external networks.
neutron_external_interface: "eth1"To learn more about network configuration, refer
Network overview <admin/production-architecture-guide.html#network-configuration>.Next we need to provide floating IP for management traffic. This IP will be managed by keepalived to provide high availability, and should be set to be not used address in management network that is connected to our
network_interface.kolla_internal_vip_address: "10.1.0.250"Enable additional services
By default Kolla Ansible provides a bare compute kit, however it does provide support for a vast selection of additional services. To enable them, set
enable_*to "yes". For example, to enable Block Storage service:enable_cinder: "yes"Kolla now supports many OpenStack services, there is a list of available services. For more information about service configuration, Please refer to the
Services Reference Guide <reference/index.html>.Multiple globals files
For a more granular control, enabling any option from the main
globals.ymlfile can now be done using multiple yml files. Simply, create a directory calledglobals.dunder/etc/kolla/and place all the relevant*.ymlfiles in there. Thekolla-ansiblescript will, automatically, add all of them as arguments to theansible-playbookcommand.An example use case for this would be if an operator wants to enable cinder and all its options, at a later stage than the initial deployment, without tampering with the existing
globals.ymlfile. That can be achieved, using a separatecinder.ymlfile, placed under the/etc/kolla/globals.d/directory and adding all the relevant options in there.Virtual environment
It is recommended to use a virtual environment to execute tasks on the remote hosts. This is covered
Virtual Environments <user/virtual-environments.html>.
Deployment
After configuration is set, we can proceed to the deployment phase. First we need to setup basic host-level dependencies, like docker.
Kolla Ansible provides a playbook that will install all required services in the correct versions.
The following assumes the use of the multinode
inventory. If using a different inventory, such as
all-in-one, replace the -i argument
accordingly.
- For deployment or evaluation, run:
Bootstrap servers with kolla deploy dependencies:
kolla-ansible -i ./multinode bootstrap-serversDo pre-deployment checks for hosts:
kolla-ansible -i ./multinode prechecksFinally proceed to actual OpenStack deployment:
kolla-ansible -i ./multinode deploy
- For development, run:
Bootstrap servers with kolla deploy dependencies:
cd kolla-ansible/tools ./kolla-ansible -i ../../multinode bootstrap-serversDo pre-deployment checks for hosts:
./kolla-ansible -i ../../multinode prechecksFinally proceed to actual OpenStack deployment:
./kolla-ansible -i ../../multinode deploy
When this playbook finishes, OpenStack should be up, running and
functional! If error occurs during execution, refer to troubleshooting guide <user/troubleshooting.html>.
Using OpenStack
Install the OpenStack CLI client:
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/|KOLLA_OPENSTACK_RELEASE|OpenStack requires an openrc file where credentials for admin user are set. To generate this file:
For deployment or evaluation, run:
kolla-ansible post-deploy . /etc/kolla/admin-openrc.shFor development, run:
cd kolla-ansible/tools ./kolla-ansible post-deploy . /etc/kolla/admin-openrc.sh
Depending on how you installed Kolla Ansible, there is a script that will create example networks, images, and so on.
Warning
You are free to use the following
init-runoncescript for demo purposes but note it does not have to be run in order to use your cloud. Depending on your customisations, it may not work, or it may conflict with the resources you want to create. You have been warned.For deployment or evaluation, run:
If using a virtual environment:
/path/to/venv/share/kolla-ansible/init-runonceIf not using a virtual environment:
/usr/local/share/kolla-ansible/init-runonceFor development, run:
kolla-ansible/tools/init-runonce