kolla-ansible ----- rally module

About Rally

Rally is the introduction of open-source OpenStack community testing tool that can be used for performance testing various components of OpenStack.

By using Rally assembly, the user can complete the installation and deployment OpenStack cloud computing platform, functional verification, test load mass (performance tests), a series of test report output operation.

Rally installation

In icos environment, directly open rally in globals.yml in.

enable_rally: "yes"

Then install the tag can be deployed.

If the host is a performance test designed to close the like, it is recommended rally machine installed on a non-testing node.

Installing the following parameters optimization, rally profile location: /etc/rally/rally.conf

Default comment all the options, testing encounter the following problems:

  1. Gets the instance state Timeout
  2. Connection timed out

Make the following settings to avoid timeouts affect the test results, the time setting 1800s:

[DEFAULT]
openstack_client_http_timeout = 1800.0
[benchmark]
cinder_volume_create_timeout = 1800.0
cinder_volume_delete_timeout = 1800.0
nova_server_boot_timeout = 1800.0
nova_server_boot_timeout = 1800.0

rally use

Creating Deployment

For already installed systems deployed OpenStack, there are two ways to create deployment

1) use environment variables to create

(rally)[root@node135 ~]# more openrc
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=xxxx
export OS_AUTH_URL=http://100.2.28.139:35357
#生效一下
source openrc
#创建
rally deployment create --fromenv --name=existing

2) using the json file creation

rally deployment create--file=existing.json --name=existing

existing template file default location / rally-openstack / samples / deployments

existing.json document reads as follows:

 {

    "type":"ExistingCloud",
    "auth_url": "http://10.25.*.*:35357/v3",
    "region_name":"RegionOne",
    "endpoint_type":"public",
    "admin": {
        "username":"admin",
        "password": "****",
        "tenant_name": "admin"
    },
    "users": [
        {
            "username": "nsp_test_1",
            "password":"password",
            "tenant_name":"nsp_tenant_1"
        },
        {
            "username":"nsp_test_2",
            "password":"password2",
            "tenant_name":"nsp_tenant_2"
        }
    ]
}

 

View a list of all deployment

rally deployment list

View deployment details have been created

rally deployment show existing

Check the deployment

rally deployment check

deployment of services created to check whether it is normal, the following are the results

 

Task execution

Rally is a test unit Task performed, specify Task execution file entry, file or may be json file yaml

The following is the implementation of the form:

rally task start  /rally-openstack/samples/tasks/scenarios/nova/boot_ljy.yaml

Frequently used scene

The default template position scene / rally-openstack / samples / tasks / scenarios

Create and delete virtual machines

boot-and-delete.yaml
{% set flavor_name = flavor_name or "m1.tiny" %}   #资源规格
---
  NovaServers.boot_and_delete_server:
    -
      args:
        flavor:
            name: "{{flavor_name}}"
        image:
            name: "TestVM"    #镜像名称
        force_delete: false
      runner:
        type: "constant"
        times: 10      #测试次数
        concurrency: 2  #并发数
      context:
        users:
          tenants: 3
          users_per_tenant: 2 
      sla:
        failure_rate:
          max: 0
    -
      args:
        flavor:
            name: "{{flavor_name}}"
        image:
            name: "TestVM"
        auto_assign_nic: true
      runner:
        type: "constant"
        times: 10
        concurrency: 2
      context:
        users:
          tenants: 3
          users_per_tenant: 2
        network:
          start_cidr: "192.168.190.0/24"
          networks_per_tenant: 2
      sla:
        failure_rate:
          max: 0
 

Create a cloud disk

(rally)[root@control01 ljy]# more create-volume.yaml
---
  CinderVolumes.create_volume:
    -
      args:
        size: 1
      runner:
        type: "constant"
        times: 3
        concurrency: 2
      context:
        users:
          tenants: 2
          users_per_tenant: 2
      sla:
        failure_rate:
          max: 0
    -
      args:
        size:
          min: 1
          max: 5
      runner:
        type: "constant"
        times: 3
        concurrency: 2
      context:
        users:
          tenants: 2
          users_per_tenant: 2
      sla:
        failure_rate:
          max: 0

Create and delete network

 

(rally)[root@control01 ljy]# more create-and-delete-networks.yaml
---
  NeutronNetworks.create_and_delete_networks:
    -
      args:
        network_create_args: {}
      runner:
        type: "constant"
        times: 10
        concurrency: 1
      context:
        users:
          tenants: 3
          users_per_tenant: 3
        quotas:
          neutron:
            network: -1
      sla:
        failure_rate:
          max: 0

View Task

Can be used Rally task List , to list the task has been executed

 

Web generated test report

Use rally task report [task_id] --out = [outfile.html] can generate a test report format web

 

Possible at this time there will be an error to open the html file because report.html file uses some css, js library, these libraries on the google on the site, and therefore will appear so strange phenomenon.

Libs need to report.html which follows four lines in the URL:

  <link rel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css">

  <script type="text/javascript"src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script>

  <script type="text/javascript"src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js"></script>

  <script type="text/javascript"src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js"></script>

Replace libs web site can be accessed bootcss static library, as follows:

  <link rel="stylesheet"href="http://cdn.bootcss.com/nvd3/1.1.15-beta/nv.d3.css">

  <script type="text/javascript"src="http://cdn.bootcss.com/angular.js/1.3.3/angular.min.js"></script>

  <script type="text/javascript"src="http://cdn.bootcss.com/d3/3.4.13/d3.min.js"></script>

  <script type="text/javascript"src="http://cdn.bootcss.com/nvd3/1.1.15-beta/nv.d3.min.js"></script>

Then it can open. Or directly to the corresponding row report.html modify the template file out such that the resulting report will automatically replace the web page.

Template file location: /usr/lib/python2.7/site-packages/rally/ui/templates/task/report.html

The above command is successful, you can see files generated Html, Html files can be viewed in a browser. Display of results as follows:

 

Guess you like

Origin www.cnblogs.com/jinyuanliu/p/10948292.html