Allow multiple VMs per network

Ping floating ip test is creating one network and
one vm per network for the ping. One VM per network
is not realistic scenario. This patch allows users
to spawn multiple vms per network for the ping test.

Change-Id: Ic18f37a2fb978047252b6e2f33f80b18cc27ce7b
This commit is contained in:
venkata anil 2020-03-04 12:38:48 +05:30
parent d6bba83c90
commit 37196babc4
3 changed files with 9 additions and 5 deletions

View File

@ -287,6 +287,7 @@ workloads:
file: rally/rally-plugins/netcreate-boot/netcreate_nova_boot_vms_on_single_network.yml
- name: netcreate-boot-ping
enabled: true
num_vms: 4
image_name: cirros
flavor_name: m1.xtiny
ext_net_id:

View File

@ -29,7 +29,7 @@ from rally.task import validation
class CreateNetworkNovaBootPing(vm_utils.VMScenario,
neutron_utils.NeutronScenario):
def run(self, image, flavor, ext_net_id, router_create_args=None,
def run(self, image, flavor, ext_net_id, num_vms=1, router_create_args=None,
network_create_args=None, subnet_create_args=None, **kwargs):
ext_net_name = None
if ext_net_id:
@ -44,10 +44,11 @@ class CreateNetworkNovaBootPing(vm_utils.VMScenario,
network = self._create_network(network_create_args or {})
subnet = self._create_subnet(network, subnet_create_args or {})
self._add_interface_router(subnet['subnet'], router['router'])
kwargs["nics"] = [{'net-id': network['network']['id']}]
guest = self._boot_server_with_fip(image, flavor, True,
ext_net_name, **kwargs)
self._wait_for_ping(guest[1]['ip'])
for i in range(num_vms):
kwargs["nics"] = [{'net-id': network['network']['id']}]
guest = self._boot_server_with_fip(image, flavor, True,
ext_net_name, **kwargs)
self._wait_for_ping(guest[1]['ip'])
@atomic.action_timer("neutron.create_router")
def _create_router(self, router_create_args):

View File

@ -1,5 +1,6 @@
{% set image_name = image_name or 'cirros' %}
{% set flavor_name = flavor_name or 'm1.xtiny' %}
{% set num_vms = num_vms or 1 %}
{% 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 %}
@ -12,6 +13,7 @@ BrowbeatPlugin.create_network_nova_boot_ping:
name: '{{flavor_name}}'
image:
name: '{{image_name}}'
num_vms: {{num_vms}}
ext_net_id: '{{ext_net_id}}'
network_create_args: {}
router_create_args: {}