Add Rally Plugins

Add Rally Plugin to our automation.

+ Restructure directory
+ Patch some of the code
+ Patched up lib/Rally, still need to finish a couple of changes
+ Added Plugin path to config
+ Remove debugging
+ Update the yml files for plugins

Change-Id: I6059ef55ecce1bd32301bdf8ad386d993bbdf757
This commit is contained in:
Joe 2016-03-15 16:55:06 -04:00 committed by Joe Talerico
parent 9ce7f65066
commit 5d84bdc3f2
8 changed files with 71 additions and 70 deletions

View File

@ -2,7 +2,7 @@
browbeat: browbeat:
results : results/ results : results/
sudo: true sudo: true
connmon: true connmon: false
rerun: 3 rerun: 3
ansible: ansible:
hosts: ansible/hosts hosts: ansible/hosts
@ -50,6 +50,9 @@ rally:
sleep_before: 5 sleep_before: 5
sleep_after: 5 sleep_after: 5
venv: /home/stack/rally-venv/bin/activate venv: /home/stack/rally-venv/bin/activate
plugins:
- netcreate-boot: rally/rally-plugins/netcreate-boot
- netcreate-boot-ping: rally/rally-plugins/netcreate-boot-ping
benchmarks: benchmarks:
authenticate: authenticate:
enabled: true enabled: true
@ -82,6 +85,23 @@ rally:
sla_max_avg_duration: 12 sla_max_avg_duration: 12
sla_max_seconds: 30 sla_max_seconds: 30
sla_max_failure: 0 sla_max_failure: 0
plugins:
enabled: true
concurrency:
- 16
- 32
- 48
- 64
times: 128
scenarios:
netcreate-boot:
enabled: true
image_name: cirros
flavor_name: m1.tiny
file: rally/rally-plugins/netcreate-boot/netcreate_boot.yml
sla_max_avg_duration: 12
sla_max_seconds: 30
sla_max_failure: 0
cinder: cinder:
enabled: true enabled: true
concurrency: concurrency:

View File

@ -32,9 +32,18 @@ class Rally:
if 'sleep_before' in self.config['rally']: if 'sleep_before' in self.config['rally']:
time.sleep(self.config['rally']['sleep_before']) time.sleep(self.config['rally']['sleep_before'])
task_args = str(scenario_args).replace("'", "\"") task_args = str(scenario_args).replace("'", "\"")
plugins = []
if "plugins" in self.config['rally']:
if len(self.config['rally']['plugins']) > 0 :
for plugin in self.config['rally']['plugins'] :
for name in plugin :
plugins.append(plugin[name])
plugin_string = ""
if len(plugins) > 0 :
plugin_string = "--plugin-paths {}".format(",".join(plugins))
cmd = "source {}; ".format(self.config['rally']['venv']) cmd = "source {}; ".format(self.config['rally']['venv'])
cmd += "rally task start {} --task-args \'{}\' 2>&1 | tee {}.log".format(task_file, cmd += "rally {} task start {} --task-args \'{}\' 2>&1 | tee {}.log".format(plugin_string,
task_args, test_name) task_file,task_args, test_name)
self.tools.run_cmd(cmd) self.tools.run_cmd(cmd)
if 'sleep_after' in self.config['rally']: if 'sleep_after' in self.config['rally']:
time.sleep(self.config['rally']['sleep_after']) time.sleep(self.config['rally']['sleep_after'])

View File

@ -1,4 +1,3 @@
{% set flavor_name = flavor_name or "m1.medium" %}
{ {
"NeutronBootFipPingPlugin.create_network_nova_boot_ping": [ "NeutronBootFipPingPlugin.create_network_nova_boot_ping": [
{ {
@ -8,23 +7,23 @@
"name": "{{flavor_name}}" "name": "{{flavor_name}}"
}, },
"image": { "image": {
"name": "CentOS-7-x86_64-GenericCloud-20141129_01" "name": "{{image_name}}"
}, },
"ext_net": { "ext_net": {
"id": "4d7d6ee4-4423-46c8-9e03-8f4ae8869841", "id": "{{net_id}}"
}, },
"network_create_args": {}, "network_create_args": {}
}, },
"runner": { "runner": {
"type": "serial", "type": "serial",
"times": 1, "times": 1
}, },
"context": { "context": {
"users": { "users": {
"tenants": 1, "tenants": 1,
"users_per_tenant": 1 "users_per_tenant": 1
}, }
}, }
} }
] ]
} }

View File

@ -9,26 +9,18 @@ from rally.task import validation
class NeutronPlugin(neutron_utils.NeutronScenario, class NeutronPlugin(neutron_utils.NeutronScenario,
nova_utils.NovaScenario, nova_utils.NovaScenario,
scenario.Scenario): scenario.Scenario):
#
# Create network # Create network
# Create subnet # Create subnet
# Attach to router
# Attach guest to new network # Attach guest to new network
# List
# Ping
# Cleanup # Cleanup
#
@types.set(image=types.ImageResourceType, @types.set(image=types.ImageResourceType,
flavor=types.FlavorResourceType) flavor=types.FlavorResourceType)
@validation.image_valid_on_flavor("flavor", "image") @validation.image_valid_on_flavor("flavor", "image")
@validation.required_openstack(users=True) @validation.required_openstack(users=True)
@scenario.configure(context={"cleanup": ["nova","neutron"]}) @scenario.configure(context={"cleanup": ["nova","neutron"]})
def create_network_nova_boot(self,image,flavor,router, def create_network_nova_boot(self,image,flavor,network_create_args=None,
network_create_args=None,subnet_create_args=None, subnet_create_args=None,**kwargs):
**kwargs):
network = self._create_network(network_create_args or {}) network = self._create_network(network_create_args or {})
subnet = self._create_subnet(network, subnet_create_args or {}) subnet = self._create_subnet(network, subnet_create_args or {})
self._add_interface_router(subnet['subnet'],router)
kwargs["nics"] = [{ 'net-id': network['network']['id']}] kwargs["nics"] = [{ 'net-id': network['network']['id']}]
self._boot_server(image, flavor, **kwargs) self._boot_server(image, flavor, **kwargs)

View File

@ -0,0 +1,31 @@
{% set sla_max_avg_duration = sla_max_avg_duration or 60 %}
{% set sla_max_failure = sla_max_failure or 0 %}
{% set sla_max_seconds = sla_max_seconds or 60 %}
---
NeutronPlugin.create_network_nova_boot:
-
args:
flavor:
name: '{{flavor_name}}'
image:
name: '{{image_name}}'
network_create_args: {}
runner:
concurrency: {{concurrency}}
times: {{times}}
type: "constant"
context:
users:
tenants: 1
users_per_tenant: 8
quotas:
neutron:
network: -1
port: -1
router: -1
subnet: -1
sla:
max_avg_duration: {{sla_max_avg_duration}}
max_seconds_per_iteration: {{sla_max_seconds}}
failure_rate:
max: {{sla_max_failure}}

View File

@ -1,32 +0,0 @@
{% set flavor_name = flavor_name or "m1.small" %}
{
"NeutronPlugin.create_network_nova_boot": [
{
"args": {
"flavor": {
"name": "{{flavor_name}}"
},
"image": {
"name": "centos7"
},
"network": {
"id": "a8443e27-c124-4774-a12d-7a0b9905e214",
},
"router": {
"id" : "d3a1f5a9-87b8-448d-b941-8ff40de84003",
},
"network_create_args": {},
},
"runner": {
"type": "serial",
"times": 5,
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
},
},
}
]
}

View File

@ -1,18 +0,0 @@
{
"type": "ExistingCloud",
"auth_url": "http://<deployment-ip>:5000/v2.0/",
"region_name": "regionOne",
"endpoint_type": "public",
"admin": {
"username": "admin",
"password": "",
"tenant_name": "admin"
},
"users": [
{
"username": "admin",
"password": "",
"tenant_name": "admin"
}
]
}