OpenStack 性能测试项目Rally 部署

OpenStack 已经成为企业构建私有云的首选,部署openstack 的方式有很多种,那么如何对openstack 环境做性能评估呢?  Rally 就是你想要的测试项目。

OpenStack 性能测试项目Rally 部署

下载安装Rally

参考

git clone https://github.com/stackforge/rally.git
./rally/install_rally.sh -v

配置测试环境

参考

rally 代码的 samples/deployments 目录下有模板可以参考

[root@localhost deployments]# pwd
/root/rally/samples/deployments
[root@localhost deployments]# ll
total 24
-rw-r--r--. 1 root root  313 Apr  8 14:52 existing.json
-rw-r--r--. 1 root root  430 Apr  8 14:52 existing-keystone-v3.json
-rw-r--r--. 1 root root  423 Apr  8 14:52 existing-with-given-endpoint.json
-rw-r--r--. 1 root root  558 Apr  8 14:52 existing-with-predefined-users.json
drwxr-xr-x. 2 root root 4096 Apr  8 14:52 for_deploying_openstack_with_rally
-rw-r--r--. 1 root root 1396 Apr  8 14:52 README.rst

我的existing.json

[root@localhost rally]# cat existing.json
{
    "type": "ExistingCloud",
    "auth_url": "http://192.168.132.53:5000/v3/",
    "region_name": "RegionOne",
    "endpoint_type": "public",
    "admin": {
        "username": "admin",
        "password": "admin",
        "tenant_name": "admin"
    },
    "https_insecure": false,
    "https_cacert": ""
}

创建deployment

[root@localhost rally]# rally deployment create --filename=existing.json --name=existing
2016-04-09 14:51:24.557 19950 INFO rally.deployment.engine [-] Deployment 301118b9-c4cc-4e60-8761-57bbdffb392e | Starting:  OpenStack cloud deployment.
2016-04-09 14:51:24.583 19950 INFO rally.deployment.engine [-] Deployment 301118b9-c4cc-4e60-8761-57bbdffb392e | Completed: OpenStack cloud deployment.
+--------------------------------------+----------------------------+----------+------------------+--------+
| uuid                                | created_at                | name    | status          | active |
+--------------------------------------+----------------------------+----------+------------------+--------+
| 301118b9-c4cc-4e60-8761-57bbdffb392e | 2016-04-09 18:51:24.549769 | existing | deploy->finished |        |
+--------------------------------------+----------------------------+----------+------------------+--------+
Using deployment: 301118b9-c4cc-4e60-8761-57bbdffb392e
~/.rally/openrc was updated

HINTS:
* To get your cloud resources, run:
        rally show [flavors|images|keypairs|networks|secgroups]

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

检查测试环境

[root@localhost rally]# rally deployment check
keystone endpoints are valid and following services are available:
+-------------+----------------+-----------+
| services    | type          | status    |
+-------------+----------------+-----------+
| __unknown__ | volumev2      | Available |
| ceilometer  | metering      | Available |
| cinder      | volume        | Available |
| cloud      | cloudformation | Available |
| glance      | image          | Available |
| heat        | orchestration  | Available |
| keystone    | identity      | Available |
| neutron    | network        | Available |
| nova        | compute        | Available |
+-------------+----------------+-----------+
NOTE: '__unknown__' service name means that Keystone service catalog doesn't return name for this service and Rally can not identify service by its type. BUT you still can use such services with api_versions context, specifying type of service (execute `rally plugin show api_versions` for more details).
[

测试

[root@localhost rally]# cp ./samples/tasks/scenarios/keystone/create-and-delete-user.json .
[root@localhost rally]# vi create-and-delete-user.json

{
    "KeystoneBasic.create_delete_user": [
        {
            "args": {},
            "runner": {
                "type": "constant",
                "times": 100,
                "concurrency": 10
            }
        }
    ]
}

运行测试

[root@localhost rally]# rally -v task start create-and-delete-user.json

测试结果

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/93ce942161734f130876be64eecff1bc.html