Merge "Allow multiple VMs per network"

This commit is contained in:
Zuul 2020-03-17 09:38:06 +00:00 committed by Gerrit Code Review
commit 51882f8a07
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: {}