User Tools

Site Tools


Khaleesi Guide


The purpose of this guide is to walk through necessary steps to install and run Khaleesi in order to control Foreman nodes and use Tempest.

Khaleesi is an Ansible framework used to run RDO CI. It contains the necessary playbooks, roles, and libraries in order to control Foreman nodes and install/execute Tempest on a node.


You should have BMC control enabled in Foreman via IPMI. Khaleesi will issue a REST API call to the Foreman server to reboot your nodes. Please see the "Using Foreman to Control Hardware" section in the Foreman Guide.


Khaleesi can be installed on your provisioning server. First you need EPEL and some other packages:

sudo rpm -i
sudo yum -y install python-pip python-virtualenv gcc git \
                    python-keystoneclient python-novaclient \
                    python-glanceclient python-neutronclient \
                    python-keystoneclient sshpass

Now clone Khaleesi where you like:

git clone -b foreman

Khaleesi recommeds using a virtual environment provided by python-virtualenv. Follow these steps to setup your virtualenv:

virtualenv khaleesi_venv
source khaleesi_venv/bin/activate
pip install ansible
cd khaleesi/tools/ksgen
python develop
cd ../..

From the above you can see that source khaleesi_venv/bin/activate will activate your virtual environment. Simply use deactivate to exit. Now we need to create a default Ansible config:

cat > ansible.cfg << EOF
host_key_checking = False
roles_path = ./roles
library = ./library:$VIRTUAL_ENV/share/ansible/
lookup_plugins = ./plugins/lookups


Khaleesi uses a ksgen_settings.yml file for directing Khaleesi's execution. It is a YAML file that contains variables and topology information. This file can either be edited manually or can be autogenerated using another project called khaleesi-settings.

For our purposes it is easier to just modify an existing ksgen_settings file. Please use this as a template: ksgen_settings Intel example. The configuration make look like a lot at first, but you only need to modify two pieces:

Modify External Network

You will notice part of the config that looks like this:

    files: null
    tests: null
  physnet: physnet1
  use_custom_repo: false

Simply modify these IP addresses and subnets to match your external Public network that will provide Neutron external network access. You can also just leave these alone and Tempest will still run while failing the external network test cases.

Modify Inventory

The second piece of the configuration you need to change is the nodes dictionary. This configuration provides your Host inventory to ansible:

    type: compute
    ansible_ssh_pass: "Op3nStack"
    admin_password: ""
    - compute
    - foreman_nodes
    - puppet
    - rdo
    - neutron
    name: tempest
    remote_user: ""
    type: tempest
    ansible_ssh_pass: "Op3nStack"
    admin_password: ""
    - tempest
    - foreman_nodes
    - puppet
    - rdo
    - neutron
    type: controller
    ansible_ssh_pass: "Op3nStack"
    admin_password: "octopus"
    - controller
    - foreman_nodes
    - puppet
    - rdo
    - neutron

Simply replace the hostnames with the hostnames of your nodes in Foreman. The "ansible_ssh_pass" is the ssh password to your provisioned hosts, and admin_password is the password for admin within your OpenStack context.

You also need to make sure that your provisioning server can access your your hosts via their FQDN. Therefore it is necessary to add them to /etc/hosts:

[root@foreman-server /]# cat /etc/hosts tempest1 oscontroller1 oscompute11

Note: This is also a good time to mention that you should have tempest.pp applied to your tempest host group in Foreman. It contains a package required for Tempest to run.

Running Khaleesi

Now that you have Khaleesi installed and a configuration file, you are ready to rebuild your nodes. To run simply execute the following inside of your Khaleesi directory:

./ --use ../ksgen_settings.yml playbooks/quickstack.yml --no-logs -vv

The sequence of execution is as follows:

  1. Issue a reboot and rebuild to Foreman nodes given in your configuration
  2. Wait for Foreman to finish installing CentOS7 on your nodes
  3. Wait for puppet to check in and OPNFV puppet to install OPNFV target system
  4. Install and Configure the Tempest node
  5. Execute Tempest

Checking Tempest Results

Assuming everything executed you will get a "nosetests.xml" file in your Khaleesi/playbooks directory. This contains all of your Tempest test case results.

The first line will give you the overall execution summary, followed by individual results:

<testsuite errors="0" failures="179" name="" tests="2141" time="880.284">
<testcase classname="" name="setUpClass (tempest.api.compute.flavors.test_flavors.FlavorsV3Test)" time="0.000">
<skipped>FlavorsV3Test skipped as nova v3 api is not available</skipped>
<testcase classname="tempest.api.compute.admin.test_quotas.QuotasAdminTestJSON" name="test_get_updated_quotas[gate]" time="0.394"/>

As you can see from the above, a skipped or failed test case will contain that XML tag inside of the testcase tag. If a test case passed it will smiply show up as you see in the 3rd entry with no subtag.

khaleesi_guide.txt · Last modified: 2015/04/07 22:23 by Daniel Farrell