2015-08-21 09:05:23 +00:00
|
|
|
Quickstart to Deploying OpenStack using Ansible
|
|
|
|
===============================================
|
2015-03-24 00:56:01 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Evaluation and Developer Environments
|
|
|
|
-------------------------------------
|
2015-08-15 03:03:22 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Two virtualized evaluation and development environment options are
|
|
|
|
available. These options permit the evaluation of Kolla without
|
|
|
|
disrupting the host operating system.
|
|
|
|
|
|
|
|
If developing or evaluating Kolla on an OpenStack cloud environment that
|
2015-09-04 12:21:01 +00:00
|
|
|
supports Heat, follow the :doc:`Heat evaluation and developer environment guide <devenv-heat>`.
|
2015-08-21 09:05:23 +00:00
|
|
|
|
|
|
|
If developing or evaluating Kolla on a system that provides VirtualBox,
|
2015-09-04 12:21:01 +00:00
|
|
|
Vagrant may be used and is documented in the :doc:`Vagrant evaluation and developer environment guide <devenv-vagrant>`.
|
2015-08-21 09:05:23 +00:00
|
|
|
|
|
|
|
If evaluating or deploying OpenStack on bare-metal with Kolla, follow the
|
|
|
|
instructions in this document to get started.
|
2015-03-24 00:56:01 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
Installing Dependencies
|
|
|
|
-----------------------
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-24 10:00:25 +00:00
|
|
|
Kolla is tested on Fedora/Ubuntu/CentOS. It should work with other OS
|
|
|
|
distributions, but some need further testing. If other OS distributions can
|
|
|
|
be verified, update this doc accordingly. For Fedora/Ubuntu, follow below
|
|
|
|
recommendations:
|
|
|
|
|
|
|
|
Fedora: Kolla will not run on Fedora 22 or later currently. Fedora 22
|
|
|
|
compresses kernel modules with the .xz compressed format. The guestfs system
|
|
|
|
in the CentOS family of containers cannot read these images because a dependent
|
2015-08-21 09:05:23 +00:00
|
|
|
package supermin in CentOS needs to be updated to add .xz compressed format
|
|
|
|
support.
|
|
|
|
|
2015-08-24 10:00:25 +00:00
|
|
|
Ubuntu: For Ubuntu based systems where Docker is used, do not use AUFS when
|
|
|
|
starting Docker daemon unless you are running the Ubuntu with 3.19 kernel or
|
|
|
|
above. AUFS requires CONFIG\_AUFS\_XATTR=y set when building the kernel. On
|
|
|
|
Ubuntu, versions prior to 3.19 did not set this flag to be compatible with
|
|
|
|
Docker. If unable to upgrade the kernel, the Kolla community recommends using
|
2015-09-04 03:48:12 +00:00
|
|
|
a different storage backend such as btrfs when running Docker daemon.
|
2015-08-24 10:00:25 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
On the deployment host Ansible>=1.8.4 must be installed and is the only
|
|
|
|
requirement for deploying OpenStack. To build the Docker container images
|
2015-09-16 20:04:39 +00:00
|
|
|
locally the dependencies docker>=1.7.0 and the Python libraries
|
2015-08-21 09:05:23 +00:00
|
|
|
docker-py>=1.2.0 and Jinja2>=2.6 must be installed.
|
2015-06-25 16:02:56 +00:00
|
|
|
|
2015-09-04 03:48:12 +00:00
|
|
|
The deployment target nodes require the installation of docker>=1.7.0 and
|
2015-08-21 09:05:23 +00:00
|
|
|
docker-py>=1.2.0.
|
|
|
|
|
2015-09-04 03:48:12 +00:00
|
|
|
To install Kolla Python dependencies use:
|
2015-06-26 20:42:15 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
|
|
|
|
2015-09-13 04:42:04 +00:00
|
|
|
git clone https://git.openstack.org/openstack/kolla
|
2015-06-26 20:42:15 +00:00
|
|
|
cd kolla
|
|
|
|
sudo pip install -r requirements.txt
|
2015-03-20 02:01:24 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Since Docker is required to build images as well as be present on all deployed
|
|
|
|
targets, the Kolla community recommends installing the Docker Inc. packaged
|
2015-09-18 04:18:53 +00:00
|
|
|
version of Docker for maximum stability and compatibility with the following
|
2015-08-21 09:05:23 +00:00
|
|
|
command:
|
2015-08-06 01:41:38 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
2015-08-15 03:03:22 +00:00
|
|
|
|
2015-08-06 01:41:38 +00:00
|
|
|
curl -sSL https://get.docker.io | bash
|
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
On the system where the OpenStack CLI/Python code is run, the Kolla community
|
|
|
|
recommends installing the OpenStack python clients if they are not installed.
|
|
|
|
This could be a completely different machine then the deployment host or
|
2015-08-24 10:00:25 +00:00
|
|
|
deployment targets. Before installing the OpenStack python client, there are
|
|
|
|
the following requirements needed by your system:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
# Ubuntu
|
2015-09-28 05:47:55 +00:00
|
|
|
apt-get install -y python-dev python-pip libffi-dev libssl-dev
|
2015-08-24 10:00:25 +00:00
|
|
|
|
|
|
|
# Fedora
|
2015-09-28 05:47:55 +00:00
|
|
|
yum install -y python-devel python-pip libffi-devel openssl-devel
|
2015-08-24 10:00:25 +00:00
|
|
|
|
|
|
|
# Centos
|
2015-09-28 05:47:55 +00:00
|
|
|
easy_install pip
|
|
|
|
yum install -y python-devel libffi-devel openssl-devel
|
2015-08-24 10:00:25 +00:00
|
|
|
|
|
|
|
To install these clients use:
|
2015-04-24 20:33:53 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
|
|
|
|
2015-09-28 05:47:55 +00:00
|
|
|
pip install -U python-openstackclient
|
2015-04-24 20:33:53 +00:00
|
|
|
|
2015-10-11 08:17:54 +00:00
|
|
|
OpenStack uses healthcheck timers which run off wall-clock time rather then
|
|
|
|
starting a timer and expring the timer, encoding the expiration in the message
|
|
|
|
contents. In some cases, this timer interval can be on the order of 60
|
|
|
|
seconds. For OpenStack to Operate correctly with these tight health-check
|
|
|
|
timer intervals, the Kolla community highly recommends running the ntpd
|
|
|
|
service on all deployment targets. To install, start, and enable ntp on
|
|
|
|
CentOS execute the following:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
yum -y install ntp
|
|
|
|
chkconfig ntpd enable
|
|
|
|
service ntpd start
|
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Libvirt is started by default on many operating systems. Please disable libvirt
|
|
|
|
on any machines that will be deployment targets. Only one copy of libvirt may
|
2015-08-21 06:06:10 +00:00
|
|
|
be running at a time.
|
2015-03-27 00:33:09 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
2015-03-27 00:33:09 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
service libvirtd disable
|
2015-08-21 06:06:10 +00:00
|
|
|
service libvirtd stop
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Kolla deploys OpenStack using
|
2015-08-28 01:38:42 +00:00
|
|
|
`Ansible <http://www.ansible.com>`__. Install Ansible from distribution
|
2015-08-21 09:05:23 +00:00
|
|
|
packaging if the distro packaging has 1.8.4 or greater available. Currently
|
|
|
|
Ubuntu's version of Ansible is too old to use from packaging. On RPM
|
|
|
|
based systems install from packaging using:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
yum -y install ansible
|
|
|
|
|
|
|
|
On DEB based systems this can be done using:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
apt-get install ansible
|
|
|
|
|
|
|
|
If the distro packaged version of Ansible is too old, install Ansible using
|
|
|
|
pip:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
pip install -U ansible
|
|
|
|
|
2015-09-28 05:47:55 +00:00
|
|
|
Building Container Images
|
2015-08-21 09:05:23 +00:00
|
|
|
--------------------------
|
|
|
|
|
|
|
|
The Kolla community does not currently generate new images for each commit
|
|
|
|
to the repository. The push time for a full image build to the docker registry
|
|
|
|
is about 5 hours on 100mbit Internet, so there are technical limitations to
|
|
|
|
using the Docker Hub registry with our current OpenStack CI/CD systems.
|
|
|
|
|
|
|
|
The Kolla community builds and pushes tested images for each tagged release of
|
|
|
|
Kolla, but if running from master, it is recommended to build images locally.
|
2015-08-24 10:00:25 +00:00
|
|
|
All Docker images can be built as follows.
|
|
|
|
|
2015-09-18 04:18:53 +00:00
|
|
|
Before running the below instructions, ensure the docker daemon is running
|
2015-08-24 10:00:25 +00:00
|
|
|
or the build process would fail:
|
2015-08-21 09:05:23 +00:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2015-09-04 05:24:22 +00:00
|
|
|
tools/build.py
|
2015-08-21 09:05:23 +00:00
|
|
|
|
2015-09-04 05:24:22 +00:00
|
|
|
A docker build of all containers on Xeon hardware with SSDs and 100mbit network
|
|
|
|
takes roughly 30 minutes. The CentOS mirrors are flakey and the RDO delorean
|
|
|
|
repository is not mirrored at all. As a result occasionally some containers
|
|
|
|
fail to build. To rectify this, the build tool will automatically attempt three
|
|
|
|
retries of a build operation if the first one fails.
|
|
|
|
|
|
|
|
It is also possible to build individual containers. If for some reason the glance
|
|
|
|
containers failed to build, all glance related containers can be rebuilt as follows:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
tools/build.py glance
|
2015-04-01 01:37:20 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
Starting Kolla
|
|
|
|
--------------
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Configure Ansible by reading the
|
2015-09-04 12:21:01 +00:00
|
|
|
:doc:`Kolla Ansible configuration Guide <ansible-deployment>` documentation.
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Finally, run the deploy operation:
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
|
|
|
|
2015-09-28 05:47:55 +00:00
|
|
|
./tools/kolla-ansible deploy
|
2015-04-24 20:33:53 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
A bare metal system takes three minutes to deploy AIO. A virtual machine
|
2015-08-21 09:05:23 +00:00
|
|
|
deployment takes five minutes to deploy AIO. These are estimates; different
|
|
|
|
hardware may be faster or slower but should be near these results.
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
Debugging Kolla
|
|
|
|
---------------
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
The container's status can be determined on the deployment targets by
|
|
|
|
executing:
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
|
|
|
|
2015-09-28 05:47:55 +00:00
|
|
|
docker ps -a
|
2015-08-21 09:05:23 +00:00
|
|
|
|
|
|
|
If any of the containers exited, this indicates a bug in the container. Please
|
|
|
|
seek help by filing a bug or contacting the developers via IRC.
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
the logs can be examined by executing:
|
2015-03-16 14:27:03 +00:00
|
|
|
|
2015-08-21 06:06:10 +00:00
|
|
|
::
|
|
|
|
|
2015-09-28 05:47:55 +00:00
|
|
|
docker logs <container-name>
|
2015-08-21 09:05:23 +00:00
|
|
|
|
|
|
|
Note some of the containers don't log to stdout at present so the above
|
|
|
|
command will provide no information. Instead they log to files
|
2015-08-28 01:38:42 +00:00
|
|
|
in /var/log/<service_> inside the container. The Kolla community is
|
2015-08-21 09:05:23 +00:00
|
|
|
working to improve auditing and make things more consistent. The Kolla
|
|
|
|
community expects this work to complete by Liberty rc1. An example of
|
|
|
|
reading the logs for nova-api:
|
|
|
|
|
|
|
|
::
|
2015-08-28 01:38:42 +00:00
|
|
|
|
2015-09-28 05:47:55 +00:00
|
|
|
docker exec -t nova_api more /var/log/nova/nova-api.log
|
2015-08-21 06:06:10 +00:00
|
|
|
|
2015-08-21 09:05:23 +00:00
|
|
|
Note reading the logs via an exec operation can only be done if the
|
|
|
|
container is running.
|