Test #openstack #performance with #rally in a few steps

Before docker, install rally was… hmmm Sh***y
too many dependencies. I screwed my OpenStack controller once. Then started to use an external server. Now, I can even run that on my laptop with docker πŸ™‚

Ok, the steps on CentOS would be:

Step ONE: Install docker and pull rally image

yum -y update
yum -y install docker
systemctl start docker
systemctl enable docker
mkdir ~/rally_home
sudo chown 65500 ~/rally_home
docker pull rallyforge/rally
docker run -t -i -v ~/rally_home:/home/rally rallyforge/rally

Step TWO: Recreate Database

As soon as you get into the container, do the following just the first time or any time you want to reset the database:

rally-manage db recreate
rally deployment list

You will see something like this:

[root@rally ~]# docker run -t -i -v ~/rally_home:/home/rally rallyforge/rally
To run a command as administrator (user "root"), use "sudo ".
See "man sudo_root" for details.

╔═════════════════════════════════════════════════════════════════════════════╗
β•‘ Welcome to Rally Docker container!                                          β•‘
β•‘  Rally certification tasks, samples and docs are located at /opt/rally/     β•‘
β•‘  Rally at readthedocs - http://rally.readthedocs.org                        β•‘
β•‘  How to contribute - http://rally.readthedocs.org/en/latest/contribute.html β•‘
β•‘  If you have any questions, you can reach the Rally team by:                β•‘
β•‘    * e-mail - openstack-dev@lists.openstack.org with tag [Rally] in subject β•‘
β•‘    * irc - "#openstack-rally" channel at freenode.net                       β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

rally@6405e348b736:~$ rally-manage db recreate
rally@6405e348b736:~$ rally deployment list

Step THREE: Add your existing deployment

Now, It's time to add your deployment of openstack
Just go to your controller and copy your source file.
Mine is something like this:

[root@os-controller ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=nimad
export OS_AUTH_URL=http://10.0.0.10:5000/v2.0
export PS1='[\u@\h \W(keystone_admin)]\$ '

export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne

Copy that on your container:

rally@92ecf317fd3c:~$ vi keystone_admin
rally@92ecf317fd3c:~$ . keystone_admin
[rally@92ecf317fd3c ~(keystone_admin)]$ rally deployment create --fromenv --name=existing
2017-07-26 22:48:19.024 33 INFO rally.deployment.engines.existing [-] Save deployment 'existing' (uuid=59978924-7b65-4e4f-8658-253b2e4c6e31) with 'openstack' platform.
+--------------------------------------+---------------------+----------+------------------+--------+
| uuid                                 | created_at          | name     | status           | active |
+--------------------------------------+---------------------+----------+------------------+--------+
| 59978924-7b65-4e4f-8658-253b2e4c6e31 | 2017-07-26T22:48:18 | existing | deploy->finished |        |
+--------------------------------------+---------------------+----------+------------------+--------+
Using deployment: 59978924-7b65-4e4f-8658-253b2e4c6e31
~/.rally/openrc was updated

HINTS:

* To use standard OpenStack clients, set up your env by running:
source ~/.rally/openrc
OpenStack clients are now configured, e.g run:
openstack image list

Now you can use the source file at ~/.rally/openrc
Check if your deployment is active:

[rally@92ecf317fd3c ~(keystone_admin)]$ rally deployment check
--------------------------------------------------------------------------------
Platform openstack:
--------------------------------------------------------------------------------

Available services:
+-------------+---------------+-----------+
| Service     | Service Type  | Status    |
+-------------+---------------+-----------+
| __unknown__ | alarming      | Available |
| __unknown__ | computev3     | Available |
| __unknown__ | volumev2      | Available |
| __unknown__ | volumev3      | Available |
| ceilometer  | metering      | Available |
| cinder      | volume        | Available |
| glance      | image         | Available |
| gnocchi     | metric        | Available |
| heat        | orchestration | Available |
| keystone    | identity      | Available |
| neutron     | network       | Available |
| nova        | compute       | Available |
| swift       | object-store  | Available |
+-------------+---------------+-----------+

STEP FOUR: Execute your first testing

There're many yaml files you can use to test your openstack instance. Let's try one

[rally@92ecf317fd3c ~(keystone_admin)]$ rally task start /opt/rally/samples/tasks/scenarios/neutron/create-and-delete-routers.yaml
--------------------------------------------------------------------------------
Preparing input task
--------------------------------------------------------------------------------

Task is:
---
NeutronNetworks.create_and_delete_routers:
-
args:
network_create_args: {}
subnet_create_args: {}
subnet_cidr_start: "1.1.0.0/30"
subnets_per_network: 2
router_create_args: {}
runner:
type: "constant"
times: 30
concurrency: 10
context:
network: {}
users:
tenants: 3
users_per_tenant: 3
quotas:
neutron:
network: -1
subnet: -1
router: -1

Task syntax is correct πŸ™‚
Running Rally version 0.9.1~dev480
--------------------------------------------------------------------------------
Task  90fed736-590c-4455-99ae-64e6ec023241: started
--------------------------------------------------------------------------------

Benchmarking... This can take a while...

#### Many lines...
#### Many lines...

--------------------------------------------------------------------------------
Task 90fed736-590c-4455-99ae-64e6ec023241 has 0 error(s)
--------------------------------------------------------------------------------

+-----------------------------------------------------------------------------------------------------------------------------------------+
|                                                          Response Times (sec)                                                           |
+--------------------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action                               | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+--------------------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| neutron.create_network               | 0.363     | 0.844        | 1.141        | 1.295        | 1.426     | 0.852     | 100.0%  | 30    |
| neutron.create_subnet (x2)           | 0.628     | 1.342        | 2.667        | 2.776        | 2.858     | 1.519     | 100.0%  | 30    |
| neutron.create_router (x2)           | 0.112     | 0.359        | 0.642        | 0.954        | 1.058     | 0.404     | 100.0%  | 30    |
| neutron.add_interface_router (x2)    | 1.317     | 2.716        | 6.58         | 6.725        | 7.471     | 2.996     | 100.0%  | 30    |
| neutron.remove_interface_router (x2) | 1.734     | 3.169        | 5.849        | 6.204        | 6.413     | 3.261     | 100.0%  | 30    |
| neutron.delete_router (x2)           | 0.541     | 1.011        | 2.532        | 2.647        | 2.744     | 1.183     | 100.0%  | 30    |
| total                                | 4.852     | 9.645        | 20.153       | 20.185       | 20.202    | 10.215    | 100.0%  | 30    |
+--------------------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+

Load duration: 32.173798
Full duration: 64.289681

HINTS:
* To plot HTML graphics with this data, run:
rally task report 90fed736-590c-4455-99ae-64e6ec023241 --out output.html

* To generate a JUnit report, run:
rally task export 90fed736-590c-4455-99ae-64e6ec023241 --type junit --to output.xml

* To get raw JSON output of task results, run:
rally task results 90fed736-590c-4455-99ae-64e6ec023241

more details at https://rally.readthedocs.io/en/latest/install_and_upgrade/install.html#rally-docker
You can save the output to a HTML file and get a nice chart of your test.

See ya!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s