简介
rally 中 openstack 相关的部分已经独立为 rally-openstack 项目
所以 rally, rally-openstack 都可以关注一下:
https://github.com/openstack/rally
rally 的帮助文档:
https://rally.readthedocs.io/en/latest/quick_start/index.html
tempest github
https://github.com/openstack/tempest
https://docs.openstack.org/tripleo-docs/latest/install/basic_deployment/tempest.html
rally-openstack
https://github.com/openstack/rally-openstack
查看版本
root@sheo4-k1:~# rally --version
Rally version: 1.6.0
Installed Plugins:
rally-openstack: 1.5.0
root@sheo2-consul3:~# rally --version
Rally version: 1.6.1~dev5
Installed Plugins:
rally-openstack: 1.5.0
安装: consul3 试一下
安装rally:
这里安装是从github 源码下载。需要的话可以代码库的版本类型
$ curl https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh | bash
Building wheels for collected packages: rally
Building wheel for rally (setup.py) ... done
Created wheel for rally: filename=rally-1.6.1.dev5-py2.py3-none-any.whl size=473626 sha256=d56b873ae4f8277db836d98cf827b1cd55d5f2df001424babe622d2cba3e3f91
Stored in directory: /tmp/pip-ephem-wheel-cache-ipaKrU/wheels/19/10/32/1ad0f14fae642167ff9de2c00c11686b482811149a04c140a6
Successfully built rally
Installing collected packages: rally
Successfully installed rally-1.6.1.dev5
Recreating database: sqlite:////var/lib/rally/database/rally.sqlite
Database deleted successfully
Database created successfully
==============================
Installation of Rally is done!
==============================
Rally is now installed in your system. Information about your Rally
installation:
- Method: system
- Database at: /var/lib/rally/database
- Configuration file at: /etc/rally
- Samples at: /usr/share/rally/samples
安装 rally-openstack 插件
root@sheo4-k1:~# pip install rally-openstack
查看安装的组件
root@sheo2-k1:~# rally plugin list |wc
2019-07-30 10:26:23.965 1191584 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-07-30 10:26:23.966 1191584 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-07-30 10:26:23.966 1191584 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
500 7446 88500
root@sheo2-k1:~# rally plugin list -h
usage: rally plugin list [-h] [--name ] [--platform ]
[--namespace ACTION_KWARG_PLATFORM]
[--plugin-base ]
[action_args [action_args ...]]
List all Rally plugins that match name and platform.
optional arguments:
-h, --help show this help message and exit
--name List only plugins that match the given name.
--platform
List only plugins that are in the specified platform.
--namespace ACTION_KWARG_PLATFORM
[Deprecated since Rally 0.10.0] Use '--platform'
instead.
--plugin-base
Plugin base class.
查看 openstack 平台相关的插件
root@sheo2-k1:~# rally plugin list --platform openstack |wc
2019-07-30 10:32:16.226 1193474 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-07-30 10:32:16.226 1193474 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-07-30 10:32:16.226 1193474 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
427 6334 73444
加载一个openstack的环境变量
root@sheo4-k1:~# source admin-openrc
创建 rally 所需要的db:
root@sheo4-k1:~# rally db create
查看帮助
root@sheo2-k1:~# rally db -h
usage: rally db [-h] {create,ensure,recreate,revision,show,upgrade} ...
CLI commands for DB management.
Commands:
create Create Rally database.
ensure Creates Rally database if it doesn't exists.
recreate Drop and create Rally database.
revision Print current Rally database revision UUID.
show Show the connection string.
upgrade Upgrade Rally database to the latest state.
optional arguments:
-h, --help show this help message and exit
对于已经存在DB的情况,重复create 会报错:
root@sheo2-k1:~# rally db create
2019-07-30 10:46:36.358 1198203 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-07-30 10:46:36.359 1198203 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-07-30 10:46:36.359 1198203 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
Creating database: sqlite:////var/lib/rally/database/rally.sqlite
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils [-] Unexpected exception in CLI: DBMigrationError: DB Migration Error: 'DB schema is already under version control. Use upgrade() instead'
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils Traceback (most recent call last):
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils File "/usr/local/lib/python2.7/dist-packages/rally/cli/cliutils.py", line 674, in run
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils ret = fn(*fn_args, **fn_kwargs)
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils File "/usr/local/lib/python2.7/dist-packages/rally/cli/commands/db.py", line 46, in create
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils db.schema.schema_create()
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils File "/usr/local/lib/python2.7/dist-packages/rally/common/db/schema.py", line 135, in schema_create
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils raise exceptions.DBMigrationError("DB schema is already under version"
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils DBMigrationError: DB Migration Error: 'DB schema is already under version control. Use upgrade() instead'
2019-07-30 10:46:36.430 1198203 ERROR rally.cli.cliutils
root@sheo2-k1:~#
root@sheo2-k1:~#
root@sheo2-k1:~# rally db upgrade
2019-07-30 10:47:06.371 1198391 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-07-30 10:47:06.371 1198391 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-07-30 10:47:06.372 1198391 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
Upgrading database: sqlite:////var/lib/rally/database/rally.sqlite
Database is already up to date
root@sheo2-k1:~#
root@sheo2-k1:~#
root@sheo2-k1:~# rally db show
2019-07-30 10:47:33.572 1198519 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-07-30 10:47:33.573 1198519 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-07-30 10:47:33.573 1198519 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
sqlite:////var/lib/rally/database/rally.sqlite
或者重建DB
root@sheo2-consul3:~# rally db recreate
Recreating database: sqlite:////var/lib/rally/database/rally.sqlite
Database deleted successfully
Database created successfully
根据openstack的环境,创建一个deployment
root@sheo4-k1:~# rally deployment create --fromenv --name=existing
+--------------------------------------+----------------------------+----------+------------------+--------+
| uuid | created_at | name | status | active |
+--------------------------------------+----------------------------+----------+------------------+--------+
| 1ffaf7a8-eb8c-40fa-bbc6-ee1dbd5b4ecc | 2019-07-16T09:08:41.740726 | existing | deploy->finished | |
+--------------------------------------+----------------------------+----------+------------------+--------+
Using deployment: 1ffaf7a8-eb8c-40fa-bbc6-ee1dbd5b4ecc
~/.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
查看创建的deployent:
root@sheo2-k1:~# rally deployment list
2019-07-30 10:50:34.494 1200005 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-07-30 10:50:34.494 1200005 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-07-30 10:50:34.494 1200005 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
+--------------------------------------+----------------------------+----------+------------------+--------+
| uuid | created_at | name | status | active |
+--------------------------------------+----------------------------+----------+------------------+--------+
| 1ffaf7a8-eb8c-40fa-bbc6-ee1dbd5b4ecc | 2019-07-16T09:08:41.740726 | existing | deploy->finished | * |
+--------------------------------------+----------------------------+----------+------------------+--------+
查看已有的 image
root@sheo4-k1:~# openstack image list
+--------------------------------------+--------------------------------------+--------+
| ID | Name | Status |
+--------------------------------------+--------------------------------------+--------+
| a1e93e09-8652-4a5b-8a7e-15742b8f0c66 | centos-7-uefi-stress | active |
| 4ea51e14-c7ee-47fc-8aaf-5e625d8f3f1b | centos-7-uefi.710 | active |
| 744dd9de-8f0b-4a20-b5d4-0ace65bd981e | migrate-server | active |
| be92da34-7f6d-4540-8c00-902814882289 | new-centos-7-uefi | active |
| d6d02c40-4c79-4e1a-8f48-6802af77b677 | new2-centos-7-uefi | active |
| 2f7c2185-27fb-48ad-852d-ec5e4ddc1bbe | redhat-7-uefi-beta | active |
| f7a92b52-8944-4ba9-a0bf-7aac10e138b2 | redhat-7-uefi-release | active |
| 2e8571e2-c5ca-4d68-a484-fe72d323f9f6 | rhosp-v2v-appliance-14 | active |
| 0b2be664-35eb-489e-9e88-5df43b10fa1e | sle-12-sp3-SAP-uefi-beta | active |
| 847837e7-2ac8-4878-b771-a37806843003 | ubuntu-18.04-uefi-beta | active |
| 1a1c2a00-8a56-44e4-b6f1-63e9eaf65fed | windows-ip-cloudbase-init | active |
| 4f97ab6e-5224-4726-a791-c6594ba2995f | windows-server-2012r2-ch-uefi-beta | active |
| 4f831867-a700-483f-be78-a9d48fb9d865 | windows-server-2012r2-en-uefi-0709 | active |
| 36d77a11-9393-42b0-9b4b-3b30284a5420 | windows-server-2012r2-en-uefi-beta | active |
| 99932992-b0f7-4fac-9cbd-63916d8bbc11 | windows-server-2016-ch-uefi-beta | active |
| d9425804-9ca9-47bb-8125-32c6d3a51d30 | windows-server-2016-en-uefi-beta | active |
| 844f5458-38fc-4081-a91d-fc9677a6a343 | windows-server-2016-en-uefi-stress-2 | active |
| 0fa39d8f-740d-4455-b02e-259e01463315 | windows-server-2016-en-uefi-stress-3 | active |
+--------------------------------------+--------------------------------------+--------+
查看已有的flavor:
root@sheo4-k1:~# openstack flavor list
+--------------------------------------+----------+--------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+----------+--------+------+-----------+-------+-----------+
| 14430634-bfcd-463c-9f43-d9a14bef3806 | 4-8-0 | 8192 | 0 | 0 | 4 | True |
| 1732d515-aedc-432a-94ae-bcbcb210d802 | 4-128-0 | 131072 | 0 | 0 | 4 | True |
| 2-4 | 2-4 | 4096 | 0 | 0 | 2 | True |
| 245f829f-b9cb-4cc9-aae2-64195d1b1b10 | 12-96-0 | 98304 | 0 | 0 | 12 | True |
| 26453722-6f7d-46f6-b0be-ad4e46cc789d | 16-16-0 | 16384 | 0 | 0 | 16 | True |
| 2dc9c85d-4f00-4a57-aa5d-5cfc5f9bada9 | 16-32-0 | 32768 | 0 | 0 | 16 | True |
| 39d8a815-1e6e-4f39-9e27-f461130a5c46 | 16-128-0 | 131072 | 0 | 0 | 16 | True |
| 4-4 | 4-4 | 4096 | 0 | 0 | 4 | True |
| 50e5a4b2-23ac-4600-b488-eabdc89c48ba | 8-16-0 | 16384 | 0 | 0 | 8 | True |
| 5bc1e571-bdbb-43d5-9ad4-fa2853699c68 | 16-256-0 | 262144 | 0 | 0 | 16 | True |
| 6479c0d7-7271-472e-986f-daad8ba4674c | 24-32-0 | 32768 | 0 | 0 | 24 | True |
| 64f7e731-bf23-4e0d-a3a1-f99534715b13 | 12-128-0 | 131072 | 0 | 0 | 12 | True |
| 6c698f11-aa54-45ec-a5cd-1d64d61976f8 | 32-128-0 | 131072 | 0 | 0 | 32 | True |
| 70973c81-061c-4faf-b39c-4fee3fc81c37 | 8-32-0 | 32768 | 0 | 0 | 8 | True |
| 73c60fe3-3e40-4427-8fc1-c0e0593e2494 | migrate | 16384 | 30 | 0 | 8 | True |
| 7a3a0ca0-5b46-482a-828c-388cc4ddacf2 | 16-64-0 | 65536 | 0 | 0 | 16 | True |
| 7b6a2b7d-0201-494d-9bed-3380dd8fcce9 | 24-128-0 | 131072 | 0 | 0 | 24 | True |
| 80614a48-d27c-40ac-8001-9f6dfc17eb52 | 4-16-0 | 16384 | 0 | 0 | 4 | True |
| 86fed44a-88e4-455c-ab26-71bde6fce6fb | 2-16-0 | 16384 | 0 | 0 | 2 | True |
| 94090278-c906-47cd-92d9-cdfe17187da3 | 12-48-0 | 49152 | 0 | 0 | 12 | True |
| a56f36a5-3166-40f0-9121-16f2845525f0 | 4-64-0 | 65536 | 0 | 0 | 4 | True |
| ad8293da-6b89-4874-8d60-7821c41b334d | 8-8-0 | 8192 | 0 | 0 | 8 | True |
| b4e3b1cb-e906-49b0-bf7d-37ad25dfdf38 | 8-64-0 | 65536 | 0 | 0 | 8 | True |
| bace6791-8947-439d-b5e4-06ffe2b97ed6 | 32-256-0 | 262144 | 0 | 0 | 32 | True |
| bf7d33e7-de01-48c5-8a76-215f842e21c3 | 16-48-0 | 49152 | 0 | 0 | 16 | True |
| d46d3d1a-df37-4c8f-8dbb-42f4018168a5 | 12-32-0 | 32768 | 0 | 0 | 12 | True |
| df0df6ef-6891-4884-8cc0-d14089e9e02b | 8-128-0 | 131072 | 0 | 0 | 8 | True |
| e01b2fe3-ba7d-4bfd-a2d0-13190513b5d6 | 2-8-0 | 8192 | 0 | 0 | 2 | True |
| e4302c14-cafc-42a0-824e-f3057e8a55fd | 4-32-0 | 32768 | 0 | 0 | 4 | True |
+--------------------------------------+----------+--------+------+-----------+-------+-----------+
查看 deployment
root@sheo4-k1:~# rally deployment list
+--------------------------------------+----------------------------+----------+------------------+--------+
| uuid | created_at | name | status | active |
+--------------------------------------+----------------------------+----------+------------------+--------+
| 1ffaf7a8-eb8c-40fa-bbc6-ee1dbd5b4ecc | 2019-07-16T09:08:41.740726 | existing | deploy->finished | * |
+--------------------------------------+----------------------------+----------+------------------+--------+
检查一下deployment
root@sheo4-k1:~# rally deployment check
2019-07-16 17:09:15.400 923724 INFO keyring.backend [-] Loading Windows (alt)
2019-07-16 17:09:15.419 923724 INFO keyring.backend [-] Loading pyfs
2019-07-16 17:09:15.421 923724 INFO keyring.backend [-] Loading multi
2019-07-16 17:09:15.422 923724 INFO keyring.backend [-] Loading Google
2019-07-16 17:09:15.424 923724 INFO keyring.backend [-] Loading Gnome
2019-07-16 17:09:15.431 923724 INFO keyring.backend [-] Loading keyczar
2019-07-16 17:09:15.431 923724 INFO keyring.backend [-] Loading file
--------------------------------------------------------------------------------
Platform openstack:
--------------------------------------------------------------------------------
Available services:
+-------------+-------------------------+-----------+
| Service | Service Type | Status |
+-------------+-------------------------+-----------+
| __unknown__ | baremetal-introspection | Available |
| __unknown__ | compute_legacy | Available |
| __unknown__ | placement | Available |
| __unknown__ | sharev2 | Available |
| cinder | volume | Available |
| cinder | volumev2 | Available |
| cinder | volumev3 | Available |
| cloud | cloudformation | Available |
| glance | image | Available |
| heat | orchestration | Available |
| ironic | baremetal | Available |
| keystone | identity | Available |
| manila | share | Available |
| neutron | network | Available |
| nova | compute | Available |
+-------------+-------------------------+-----------+
# 有的缺少 ironic
Platform openstack:
--------------------------------------------------------------------------------
Available services:
+-------------+----------------+-----------+
| Service | Service Type | Status |
+-------------+----------------+-----------+
| __unknown__ | compute_legacy | Available |
| __unknown__ | placement | Available |
| __unknown__ | sharev2 | Available |
| cinder | volume | Available |
| cinder | volumev2 | Available |
| cinder | volumev3 | Available |
| cloud | cloudformation | Available |
| glance | image | Available |
| heat | orchestration | Available |
| keystone | identity | Available |
| manila | share | Available |
| neutron | network | Available |
| nova | compute | Available |
+-------------+----------------+-----------+
执行task 测试一下:
rally 会在 /usr/share/rally/samples/tasks 提供样例文件,这里可以基于样例文件做自己的task 文件
root@sheo4-k1:~# rally task start /usr/share/rally/samples/tasks/contexts/dummy-context.json
--------------------------------------------------------------------------------
Preparing input task
--------------------------------------------------------------------------------
Task is:
{
"Dummy.dummy": [
{
"args": {
"sleep": 0.1
},
"runner": {
"type": "constant",
"times": 4,
"concurrency": 2
},
"context": {
"dummy_context": {
"fail_setup": false,
"fail_cleanup": false
}
}
}
]
}
Task syntax is correct :)
Running Rally version 1.6.1~dev5
--------------------------------------------------------------------------------
Task 865f6e6c-23ea-4173-af65-bd785b9579c0: started
--------------------------------------------------------------------------------
Running Task... This can take a while...
To track task status use:
rally task status
or
rally task detailed
Using task: 865f6e6c-23ea-4173-af65-bd785b9579c0
2019-07-16 17:15:09.432 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Starting: Task validation.
2019-07-16 17:15:09.438 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Starting: Task validation of syntax.
2019-07-16 17:15:09.443 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Completed: Task validation of syntax.
2019-07-16 17:15:09.443 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Starting: Task validation of required platforms.
2019-07-16 17:15:09.451 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Completed: Task validation of required platforms.
2019-07-16 17:15:09.452 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Starting: Task validation of semantic.
2019-07-16 17:15:09.452 929113 INFO rally.task.engine [-] Check health of the environment '1ffaf7a8-eb8c-40fa-bbc6-ee1dbd5b4ecc'.
2019-07-16 17:15:09.963 929113 INFO keyring.backend [-] Loading Windows (alt)
2019-07-16 17:15:09.971 929113 INFO keyring.backend [-] Loading pyfs
2019-07-16 17:15:09.972 929113 INFO keyring.backend [-] Loading multi
2019-07-16 17:15:09.972 929113 INFO keyring.backend [-] Loading Google
2019-07-16 17:15:09.973 929113 INFO keyring.backend [-] Loading Gnome
2019-07-16 17:15:09.979 929113 INFO keyring.backend [-] Loading keyczar
2019-07-16 17:15:09.979 929113 INFO keyring.backend [-] Loading file
2019-07-16 17:15:10.420 929113 INFO rally.task.engine [-] Platform existing@openstack (available: True): OK!
2019-07-16 17:15:13.207 929113 INFO rally.task.context [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Context users@openstack setup() finished in 2.78 sec
2019-07-16 17:15:13.212 929113 INFO rally.task.context [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Context users@openstack cleanup() started
2019-07-16 17:15:16.817 929113 INFO rally.task.context [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Context users@openstack cleanup() finished in 3.61 sec
2019-07-16 17:15:16.818 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Completed: Task validation of semantic.
2019-07-16 17:15:16.818 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Completed: Task validation.
2019-07-16 17:15:16.818 929113 INFO rally.api [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 input file is valid.
2019-07-16 17:15:16.818 929113 INFO rally.api [-] Run Task 865f6e6c-23ea-4173-af65-bd785b9579c0 against Deployment 1ffaf7a8-eb8c-40fa-bbc6-ee1dbd5b4ecc
2019-07-16 17:15:16.818 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Starting: Running task.
2019-07-16 17:15:16.840 929113 INFO rally.task.engine [-] Running workload:
position = 0
config = {
"version": 2,
"title": "A cropped version of a bigger task.",
"description": "Auto-generated task from a single workload (uuid=f162d815-6bea-46c5-b6a6-af77706a401c)",
"subtasks": [
{
"title": "Dummy.dummy",
"description": "Do nothing and sleep for the given number of seconds (0 by default).",
"scenario": {
"Dummy.dummy": {
"sleep": 0.1
}
},
"contexts": {
"dummy_context": {
"fail_setup": false,
"fail_cleanup": false
}
},
"runner": {
"constant": {
"times": 4,
"concurrency": 2
}
},
"hooks": [],
"sla": {
"failure_rate": {
"max": 0
}
}
}
]
}
2019-07-16 17:15:16.850 929113 INFO rally.task.context [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Context dummy_context@default setup() finished in 0.02 msec
2019-07-16 17:15:16.879 929224 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 1 START
2019-07-16 17:15:16.881 929225 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 2 START
2019-07-16 17:15:16.980 929224 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 1 END: OK
2019-07-16 17:15:16.982 929224 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 3 START
2019-07-16 17:15:16.983 929225 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 2 END: OK
2019-07-16 17:15:16.985 929225 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 4 START
2019-07-16 17:15:17.083 929224 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 3 END: OK
2019-07-16 17:15:17.085 929225 INFO rally.task.runner [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | ITER: 4 END: OK
2019-07-16 17:15:17.110 929113 INFO rally.task.context [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Context dummy_context@default cleanup() started
2019-07-16 17:15:17.111 929113 INFO rally.task.context [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Context dummy_context@default cleanup() finished in 0.59 msec
2019-07-16 17:15:18.884 929113 INFO rally.task.engine [-] Load duration is: 0.205602
2019-07-16 17:15:18.884 929113 INFO rally.task.engine [-] Full runner duration is: 0.254205
2019-07-16 17:15:18.884 929113 INFO rally.task.engine [-] Full duration is: 0.262635
2019-07-16 17:15:18.912 929113 INFO rally.task.engine [-] Task 865f6e6c-23ea-4173-af65-bd785b9579c0 | Completed: Running task.
--------------------------------------------------------------------------------
Task 865f6e6c-23ea-4173-af65-bd785b9579c0: finished
--------------------------------------------------------------------------------
test scenario Dummy.dummy
args position 0
args values:
{
"runner": {
"concurrency": 2,
"times": 4
},
"contexts": {
"dummy_context": {
"fail_cleanup": false,
"fail_setup": false
}
},
"args": {
"sleep": 0.1
},
"sla": {
"failure_rate": {
"max": 0
}
},
"hooks": []
}
--------------------------------------------------------------------------------
Task 865f6e6c-23ea-4173-af65-bd785b9579c0 has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| foo | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 100.0% | 4 |
| -> bar | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 100.0% | 4 |
| total | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 100.0% | 4 |
| -> duration | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 0.1 | 100.0% | 4 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 4 |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 0.205602
Full duration: 0.262635
HINTS:
* To plot HTML graphics with this data, run:
rally task report 865f6e6c-23ea-4173-af65-bd785b9579c0 --out output.html
* To generate a JUnit report, run:
rally task export 865f6e6c-23ea-4173-af65-bd785b9579c0 --type junit --to output.xml
* To get raw JSON output of task results, run:
rally task report 865f6e6c-23ea-4173-af65-bd785b9579c0 --json --out output.json
下载 rally-openstack 插件,可以查看相关的sample:
root@sheo4-k1:~# git clone https://github.com/openstack/rally-openstack.git
root@sheo4-k1:~# cp rally-openstack/samples/tasks/scenarios/nova/boot-and-delete.yaml .
编辑 boot-and-delete.yaml,填写正确的flavor_name 和 image_name.
TODO: 示例...
root@sheo4-k1:~# rally task start boot-and-delete.yaml
create_delete_user
$ vim create_delete_user.json
{
"KeystoneBasic.create_delete_user": [{
"args": {},
"runner": {
"type": "constant",
"times": 10,
"concurrency": 3
}
}]
}
root@sheo4-k1:~# rally task start create_delete_user.json
--------------------------------------------------------------------------------
Task e3e77f74-8fe4-4d2b-9485-075da33aa010 has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| keystone_v3.create_user | 0.169 | 0.174 | 0.181 | 0.184 | 0.188 | 0.176 | 100.0% | 10 |
| keystone_v3.delete_user | 0.109 | 0.119 | 0.132 | 0.165 | 0.197 | 0.125 | 100.0% | 10 |
| total | 0.345 | 0.357 | 0.375 | 0.399 | 0.424 | 0.363 | 100.0% | 10 |
| -> duration | 0.345 | 0.357 | 0.375 | 0.399 | 0.424 | 0.363 | 100.0% | 10 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 10 |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 6.700492
Full duration: 18.784142
list-images
$ vim vim list-images.yaml
---
GlanceImages.list_images:
-
runner:
type: "constant"
times: 10
concurrency: 1
context:
users:
tenants: 2
users_per_tenant: 2
images:
image_url: "http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img"
disk_format: "qcow2"
container_format: "bare"
images_per_tenant: 4
sla:
failure_rate:
max: 0
root@sheo4-k1:~# rally task start list-images.yaml
create-user
root@sheo4-k1:~# vim create-user.json
{
"KeystoneBasic.create_user": [
{
"args": {},
"runner": {
"type": "constant",
"times": 100,
"concurrency": 10
},
"sla": {
"failure_rate": {
"max": 0
}
}
}
]
}
root@sheo4-k1:~# rally task start create-user.json
...
--------------------------------------------------------------------------------
Task 4737009e-5e90-48f5-aeca-15a5425d8595 has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| keystone_v3.create_user | 0.16 | 0.194 | 0.218 | 0.223 | 0.24 | 0.195 | 100.0% | 100 |
| total | 0.221 | 0.268 | 0.294 | 0.299 | 0.322 | 0.268 | 100.0% | 100 |
| -> duration | 0.221 | 0.268 | 0.294 | 0.299 | 0.322 | 0.268 | 100.0% | 100 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 100 |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 18.11646
Full duration: 44.631549
create-tenant:
$ vim create-tenant.json
{
"KeystoneBasic.create_tenant": [
{
"args": {},
"runner": {
"type": "constant",
"times": 100,
"concurrency": 10
},
"sla": {
"failure_rate": {
"max": 0
}
}
}
]
}
root@sheo4-k1:~# rally task start create-tenant.json
+-------------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+----------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+----------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| keystone_v3.create_project | 0.166 | 0.215 | 0.384 | 0.441 | 0.508 | 0.257 | 100.0% | 100 |
| total | 0.166 | 0.215 | 0.384 | 0.441 | 0.508 | 0.257 | 100.0% | 100 |
| -> duration | 0.166 | 0.215 | 0.384 | 0.441 | 0.508 | 0.257 | 100.0% | 100 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 100 |
+----------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 19.356316
Full duration: 45.69525
create-and-list-user
root@sheo4-k1:~# vim create-and-list-users.json
{
"KeystoneBasic.create_and_list_users": [
{
"args": {},
"runner": {
"type": "constant",
"times": 100,
"concurrency": 10
},
"sla": {
"failure_rate": {
"max": 0
}
}
}
]
}
root@sheo4-k1:~# rally task start create-and-list-users.json
--------------------------------------------------------------------------------
Task 640de0c1-a26f-43ad-b94d-544ac5e2245e has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| keystone_v3.create_user | 0.165 | 0.186 | 0.21 | 0.213 | 0.341 | 0.19 | 100.0% | 100 |
| keystone_v3.list_users | 0.069 | 0.088 | 0.106 | 0.114 | 0.233 | 0.093 | 100.0% | 100 |
| total | 0.302 | 0.342 | 0.378 | 0.407 | 0.486 | 0.351 | 100.0% | 100 |
| -> duration | 0.302 | 0.342 | 0.378 | 0.407 | 0.486 | 0.351 | 100.0% | 100 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 100 |
+-------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 18.81529
Full duration: 45.586152
create-and-list-services
root@sheo4-k1:~# vim create-and-list-services.json
{
"KeystoneBasic.create_and_list_services": [
{
"args": {
"service_type": "Rally_test_type",
"description": "test_description"
},
"runner": {
"type": "constant",
"times": 100,
"concurrency": 10
},
"sla": {
"failure_rate": {
"max": 0
}
}
}
]
}
root@sheo4-k1:~# rally task start create-and-list-services.json
--------------------------------------------------------------------------------
Task 6b24b1ec-d763-4dbc-8cf9-4a9d8eefcde5 has 0 error(s)
--------------------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+----------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+----------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| keystone_v3.create_service | 0.079 | 0.119 | 0.157 | 0.174 | 0.253 | 0.122 | 100.0% | 100 |
| keystone_v3.list_services | 0.052 | 0.088 | 0.125 | 0.132 | 0.225 | 0.091 | 100.0% | 100 |
| total | 0.148 | 0.209 | 0.255 | 0.274 | 0.353 | 0.213 | 100.0% | 100 |
| -> duration | 0.148 | 0.209 | 0.255 | 0.274 | 0.353 | 0.213 | 100.0% | 100 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 100 |
+----------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 17.681208
Full duration: 43.203098
constant-for-duration
root@sheo4-consul1:~# rally task start /usr/share/rally/samples/tasks/runners/constant/constant-for-duration.yaml
--------------------------------------------------------------------------------
Task 7a11ed15-995d-47ca-abaf-4bba1be1ba6e has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| foo | 5.006 | 5.007 | 5.007 | 5.007 | 5.008 | 5.007 | 100.0% | 30 |
| -> bar | 5.006 | 5.007 | 5.007 | 5.007 | 5.008 | 5.007 | 100.0% | 30 |
| total | 5.006 | 5.007 | 5.007 | 5.007 | 5.008 | 5.007 | 100.0% | 30 |
| -> duration | 5.006 | 5.007 | 5.007 | 5.007 | 5.008 | 5.007 | 100.0% | 30 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 30 |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 30.06032
Full duration: 30.125783
rps
root@sheo4-consul1:~# rally task start /usr/share/rally/samples/tasks/runners/rps/rps.yaml
--------------------------------------------------------------------------------
Task 71648453-1f89-4db4-9859-ab2131b19665 has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| foo | 5.007 | 5.007 | 5.007 | 5.007 | 5.008 | 5.007 | 100.0% | 20 |
| -> bar | 5.007 | 5.007 | 5.007 | 5.007 | 5.008 | 5.007 | 100.0% | 20 |
| total | 5.007 | 5.007 | 5.007 | 5.008 | 5.008 | 5.007 | 100.0% | 20 |
| -> duration | 5.007 | 5.007 | 5.007 | 5.008 | 5.008 | 5.007 | 100.0% | 20 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 20 |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 10.471025
Full duration: 10.544126
check-request
root@sheo4-consul1:~# rally task start /usr/share/rally/samples/tasks/scenarios/requests/check-request.yaml
--------------------------------------------------------------------------------
Task 207ea2ec-e2b7-4133-afc0-48599754daf5 has 0 error(s)
--------------------------------------------------------------------------------
+---------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| requests.check_request | 0.381 | 0.477 | 1.21 | 1.467 | 2.518 | 0.684 | 100.0% | 20 |
| total | 0.381 | 0.477 | 1.21 | 1.467 | 2.518 | 0.684 | 100.0% | 20 |
| -> duration | 0.381 | 0.477 | 1.21 | 1.467 | 2.518 | 0.684 | 100.0% | 20 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 20 |
+------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 3.398839
Full duration: 3.437189
check-random-request
root@sheo4-consul1:~# rally task start /usr/share/rally/samples/tasks/scenarios/requests/check-random-request.yaml
--------------------------------------------------------------------------------
Task da4e0164-4211-4ccd-a552-21912fd90264 has 0 error(s)
--------------------------------------------------------------------------------
+---------------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| requests.check_request | 0.38 | 1.79 | 4.043 | 4.405 | 4.786 | 1.982 | 100.0% | 20 |
| total | 0.38 | 1.791 | 4.043 | 4.405 | 4.786 | 1.982 | 100.0% | 20 |
| -> duration | 0.38 | 1.791 | 4.043 | 4.405 | 4.786 | 1.982 | 100.0% | 20 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 20 |
+------------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 8.830541
Full duration: 8.864117
dummy
root@sheo4-consul1:~# rally task start /usr/share/rally/samples/tasks/sla/dummy.yaml
Task 99718329-7c71-4462-92cc-6440cc24a0ec has 0 error(s)
--------------------------------------------------------------------------------
+----------------------------------------------------------------------------------------------------------------------+
| Response Times (sec) |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| Action | Min (sec) | Median (sec) | 90%ile (sec) | 95%ile (sec) | Max (sec) | Avg (sec) | Success | Count |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
| foo | 5.006 | 5.007 | 5.007 | 5.007 | 5.007 | 5.007 | 100.0% | 20 |
| -> bar | 5.006 | 5.007 | 5.007 | 5.007 | 5.007 | 5.007 | 100.0% | 20 |
| total | 5.007 | 5.007 | 5.007 | 5.007 | 5.007 | 5.007 | 100.0% | 20 |
| -> duration | 5.007 | 5.007 | 5.007 | 5.007 | 5.007 | 5.007 | 100.0% | 20 |
| -> idle_duration | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 100.0% | 20 |
+-------------------+-----------+--------------+--------------+--------------+-----------+-----------+---------+-------+
Load duration: 20.046757
Full duration: 20.077634
常见问题
问题:
root@sheo4-k1:~# rally deployment check
2019-07-16 11:43:35.374 723702 WARNING rally.common.plugin.discover [-] Failed to load plugins from module 'rally_openstack' (package: 'rally-openstack 1.5.0'): (keystoneauth1 3.10.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('keystoneauth1>=3.14.0'), set(['openstacksdk'])): ContextualVersionConflict: (keystoneauth1 3.10.0 (/usr/lib/python2.7/dist-packages), Requirement.parse('keystoneauth1>=3.14.0'), set(['openstacksdk']))
解决:
$ curl https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh | bash
...
Building wheels for collected packages: rally
Building wheel for rally (setup.py) ... done
Stored in directory: /tmp/pip-ephem-wheel-cache-9gyilV/wheels/19/10/32/1ad0f14fae642167ff9de2c00c11686b482811149a04c140a6
Successfully built rally
Installing collected packages: rally
Successfully installed rally-1.6.1.dev5
Recreating database: sqlite:////var/lib/rally/database/rally.sqlite
Database deleted successfully
Database created successfully
==============================
Installation of Rally is done!
==============================
Rally is now installed in your system. Information about your Rally
installation:
- Method: system
- Database at: /var/lib/rally/database
- Configuration file at: /etc/rally
- Samples at: /usr/share/rally/samples
扩展阅读
openstack 官网上的rally 文档
https://docs.openstack.org/rally/latest/quick_start/index.html
简介:
和rally 在 readthedocs 上的内容相同...
OpenStack Benchmarking on SoftLayer with Rally
https://www.mirantis.com/blog/openstack-benchmarking-softlayer-rally/
简介:
mirantis 关于 rally 的介绍
OpenStack接口测试工具rally/tempest环境搭建及使用
https://www.cnblogs.com/viviane/p/10476628.html
简介:
2019-04-02 15:34
这里提到了 rally 的安装, osprofiler 的安装, rally 和 tempest 的集成..
提到了 用 osprofiler 做性能分析...
几个扩展阅读:
性能调优工具OSProfiler
http://niusmallnan.com/_build/html/_templates/openstack/osprofiler.html
简介:
OSProfiler是Mirantis开发的用于做性能调试的工具,以切面编程的方式在程序中嵌入埋点,并将收集到的信息已MQ方式发送到ceilometer服务中, ceilometer将这些采样数据汇总,而后我们可以通过Ceilometer API来查看这些Profiler数据。
OSProfiler – Cross-project profiling library
https://docs.openstack.org/osprofiler/latest/#five-ways-to-add-a-new-trace-point
简介:
OSProfiler provides a tiny but powerful library that is used by most (soon to be all) OpenStack projects and their python clients. It provides functionality to generate 1 trace per request, that goes through all involved services. This trace can then be extracted and used to build a tree of calls which can be quite handy for a variety of reasons (for example in isolating cross-project performance issues).
openstack性能测试【rally】
https://blog.csdn.net/wylfengyujiancheng/article/details/70404392
简介:
centos7 下的安装...
report 生成的html 可以查看图表...
通过 Rally 进行 OpenStack Tempest 测试
https://www.linuxidc.com/Linux/2017-10/148030.htm
https://www.linuxidc.com/Linux/2017-10/148030.htm
简介:
2017-10
提到了 tempest 集成
rally verify create-verifier --type tempest --name tempest-verifier
rally verify start
rally verify start --pattern set=compute
--pattern set=compute 选项,只会执行compute相关的测试。当前可供选择的测试内容有 full, smoke, compute, identity, image, network, object_storage, orchestration, volume, scenario