Manually testing the installation
Once the installation has completed successfully, the first step is to test the install. Testing OpenStack involves both automated and manual checks.
Manual tests verify user-journeys that may not normally be picked up through automated testing, such as ensuring horizon is displayed properly.
Automated tests can be invoked using a testing framework such as tempest or the OpenStack benchmarking tool—rally.
Getting ready
Ensure that you are root
on the first infrastructure controller node, infra01
.
How to do it…
The installation of OpenStack-Ansible creates several utility
containers on each of the infra nodes. These utility hosts provide all the command-line tools needed to try out OpenStack, using the command line of course. Carry out the following steps to get access to a utility host and run various commands in order to verify an installation of OpenStack manually:
First, view the running containers by issuing the following command:
lxc-ls -f
As you can see, this lists a number of containers because the OpenStack-Ansible installation uses isolated Linux containers for running each service. By the side of each one its IP address and running state will be listed. You can see here that the container network of
172.29.236.0/24
was used in this chapter and why this was named this way. One of the containers on here is the utility container, named with the following format:nodename_utility_container_randomuuid
. To access this container, you can SSH to it, or you can issue the following command:lxc-attach -n infra01_utility_container_34u477d
You will now be running a Terminal inside this container, with access only to the tools and services belonging to that containers. In this case, we have access to the required OpenStack clients. The first thing you need to do is source in your OpenStack credentials. The OpenStack-Ansible project writes out a generated bash environment file with an
admin
user and project that was set up during the installation. Load this into your bash environment with the following command:source openrc
Note
Tip: you can also use the following syntax in Bash: .
openrc
Now you can use the OpenStack CLI to view the services and status of the environment, as well as create networks, and launch instances. A few handy commands are listed here:
openstack server list openstack network list openstack endpoint list openstack network agent list
How it works…
The OpenStack-Ansible method of installing OpenStack installs OpenStack services into isolated containers on our Linux servers. On each of the controller (or infra) nodes are about 12 containers, each running a single service such as nova-api or RabbitMQ. You can view the running containers by logging into any of the servers as root and issuing a lxc-ls -f
command. The -f
parameter gives you a full listing showing the status of the instance such as whether it is running or stopped.
One of the containers on the infra nodes has utility
in its name, and this is known as a utility container in OpenStack-Ansible terminology. This container has OpenStack client tools installed, which makes it a great place to start manually testing an installation of OpenStack. Each container has at least an IP address on the container network—in the example used in this chapter this is the 172.29.236.0/24
subnet. You can SSH to the IP address of this container, or use another lxc
command to attach to it: lxc-attach -n
<name_of_container>
. Once you have a session inside the container, you can use it like any other system, provided those tools are available to the restricted four-walls of the container. To use OpenStack commands, however, you first need to source the resource environment file which is named openrc
. This is a normal bash environment file that has been prepopulated during the installation and provides all the required credentials needed to use OpenStack straight away.