Stop using context router for dynamic workloads

This patch removes the feature where router from Rally context
is used every fifth iteration in dynamic workloads.

Change-Id: I96aa4f4109df57fd0aa07700497ba61462d05696
This commit is contained in:
Sanjay Chari 2021-11-23 13:11:14 +05:30
parent 58ab0b3430
commit 9c2eaaece3
2 changed files with 7 additions and 26 deletions

View File

@ -104,18 +104,9 @@ class DynamicWorkload(vm.VMDynamicScenario, trunk.TrunkDynamicScenario,
if(workloads == "all" or "migrate_servers" in workloads_list or
"swap_floating_ips_between_servers" in workloads_list or
"stop_start_servers" in workloads_list):
if self.context["iteration"] % 5 != 0:
self.boot_servers_with_fip(smallest_image, smallest_flavor, context_ext_net_id,
num_vms_to_create_with_fip,
network_create_args, subnet_create_args, **kwargs)
else:
# Every 5th iteration uses the router from rally context, which uses
# the default external network provided in browbeat-config.yaml as
# gateway. So we pass this default external network as a parameter
# for every 5th iteration.
self.boot_servers_with_fip(smallest_image, smallest_flavor, ext_net_id,
num_vms_to_create_with_fip,
network_create_args, subnet_create_args, **kwargs)
self.boot_servers_with_fip(smallest_image, smallest_flavor, context_ext_net_id,
num_vms_to_create_with_fip,
network_create_args, subnet_create_args, **kwargs)
if workloads == "all" or "migrate_servers" in workloads_list:
self.migrate_servers_with_fip(num_vms_to_migrate)

View File

@ -90,20 +90,10 @@ class VMDynamicScenario(dynamic_utils.NovaUtils,
"name"
]
# Let every 5th iteration use router, network and subnet from context
if (self.context["iteration"] % 5 == 0):
router = self.get_router_from_context()
network = self.get_network_from_context()
subnet = self.get_subnet_from_context()
self.log_info("Re-use iteration: {} tenant: {} network: {} router: {}".format(
self.context["iteration"], self.context["tenant"]["id"],
self.context["tenant"]["networks"][0]["id"],
self.context["tenant"]["networks"][0]["router_id"]))
else:
router = self.router
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"])
router = self.router
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"])
keypair = self.context["user"]["keypair"]