Rally plugin patch

Allow the user to create guests with multiple interfaces.

Change-Id: I759df2a13e64dabbd4e5e53e15bc132239857a05
This commit is contained in:
Joe Talerico 2016-05-13 07:51:23 -04:00
parent a9730a6f61
commit 5ea5948aaf

View File

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