Step 7. Working with multiple OpenStack clouds

Rally is an awesome tool that allows you to work with multiple clouds and can itself deploy them. We already know how to work with a single cloud. Let us now register 2 clouds in Rally: the one that we have access to and the other that we know is registered with wrong credentials.

This step shows the OpenStack side of it. Environments themselves are described in Environment Component.

$ . openrc admin admin  # openrc with correct credentials
$ rally env create --name=cloud-1 --from-sysenv
Your system environment includes specifications of 1 platform(s).
Discovery information:
     - existing@openstack : Available.
Using environment: 4251b491-73b2-422a-aecb-695a94165b5e
...

$ . bad_openrc admin admin  # openrc with wrong credentials
$ rally env create --name=cloud-2 --from-sysenv
Your system environment includes specifications of 1 platform(s).
Discovery information:
     - existing@openstack : Available.
Using environment: 658b9bae-1f9c-4036-9400-9e71e88864fc
...

Note that env create does not talk to the cloud, so the second environment is created just fine despite the wrong credentials. It is env check below that tells the two apart.

Let us now list the environments we have created:

$ rally env list
+--------------------------------------+---------+--------+----------------------------+-------------+---------+
| uuid                                 | name    | status | created_at                 | description | default |
+--------------------------------------+---------+--------+----------------------------+-------------+---------+
| 658b9bae-1f9c-4036-9400-9e71e88864fc | cloud-2 | READY  | 2025-01-05T00:40:58.451435 |             | *       |
| 4251b491-73b2-422a-aecb-695a94165b5e | cloud-1 | READY  | 2025-01-05T00:11:14.757203 |             |         |
+--------------------------------------+---------+--------+----------------------------+-------------+---------+

The second one is marked as “default”, because we created it last. Every command that needs an environment will use it, unless you pass –env:

$ rally env check
Env `cloud-2 (658b9bae-1f9c-4036-9400-9e71e88864fc)' :-(
+-----------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Available | Platform  | Message                                                                                                                                       |
+-----------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| :-(       | openstack | Failed to authenticate to http://example.net:5000/v3/ for user 'admin' in project 'admin': The request you have made requires authentication. |
+-----------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------+

$ rally env check --env=cloud-1
Env `cloud-1 (4251b491-73b2-422a-aecb-695a94165b5e)' :-)
+-----------+-----------+---------+
| Available | Platform  | Message |
+-----------+-----------+---------+
| :-)       | openstack | OK!     |
+-----------+-----------+---------+

You can also switch the default environment using the rally env use command:

$ rally env use cloud-1
Using environment: 4251b491-73b2-422a-aecb-695a94165b5e

$ rally env check
Env `cloud-1 (4251b491-73b2-422a-aecb-695a94165b5e)' :-)
+-----------+-----------+---------+
| Available | Platform  | Message |
+-----------+-----------+---------+
| :-)       | openstack | OK!     |
+-----------+-----------+---------+

Keep in mind that rally task list shows only the tasks of the current default environment. See Environment Component for that and for the rest of the environment commands.