summaryrefslogtreecommitdiffstats
path: root/core/component_factory.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-08-16 14:59:05 +0100
committerMartin Klozik <martinx.klozik@intel.com>2016-09-01 14:52:49 +0100
commitc9cd093f2f441adc9dd33627255326008e021a67 (patch)
treedcf81dde95fbc91e65f8670841ffdbfb65a6c4a6 /core/component_factory.py
parentb2289e1f6abab2d807eb55d9ec868039dc2384e2 (diff)
multi VM: Multi VMs in serial or parallel
Support for deployment scenarios with any number of VMs in both serial and parallel configuration. Detailed content of the patch: * VswitchControllerPXP class for multi VM support * pvvpxx and pvpvxx deployments for xx VMs in serial respective parallel configuration * special GUEST_ options expansion to requested number of VMs; * support of GUEST_ options specific macros #VMINDEX, #MAC(), #IP() and #EVAL() * all GUEST specific options are turned to lists to be VM specific * support for VM with 1 NIC * support for VM with multiple NIC pairs; traffic is routed in serial or parallel between NIC paris based on deployment scenario * support for PVVP and PVPV scenarios using VMs with different numbers of NICs JIRA: VSPERF-361 Change-Id: I05bedbdfa9a81ea0166d9b03d83ae49d6cb8b19b Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Bill Michalowski <bmichalo@redhat.com> Reviewed-by: Antonio Fischetti <antonio.fischetti@intel.com>
Diffstat (limited to 'core/component_factory.py')
-rw-r--r--core/component_factory.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/core/component_factory.py b/core/component_factory.py
index 258b7232..7f453bd2 100644
--- a/core/component_factory.py
+++ b/core/component_factory.py
@@ -18,8 +18,7 @@
from core.traffic_controller_rfc2544 import TrafficControllerRFC2544
from core.vswitch_controller_clean import VswitchControllerClean
from core.vswitch_controller_p2p import VswitchControllerP2P
-from core.vswitch_controller_pvp import VswitchControllerPVP
-from core.vswitch_controller_pvvp import VswitchControllerPVVP
+from core.vswitch_controller_pxp import VswitchControllerPXP
from core.vswitch_controller_op2p import VswitchControllerOP2P
from core.vswitch_controller_ptunp import VswitchControllerPtunP
from core.vnf_controller import VnfController
@@ -57,7 +56,7 @@ def create_vswitch(deployment_scenario, vswitch_class, traffic,
The returned controller is configured with the given vSwitch class.
- Deployment scenarios: 'p2p', 'pvp'
+ Deployment scenarios: e.g. 'p2p', 'pvp', 'pvpv12', etc.
:param deployment_scenario: The deployment scenario name
:param vswitch_class: Reference to vSwitch class to be used.
@@ -66,18 +65,22 @@ def create_vswitch(deployment_scenario, vswitch_class, traffic,
:return: IVSwitchController for the deployment_scenario
"""
deployment_scenario = deployment_scenario.lower()
- if deployment_scenario.find("p2p") == 0:
+ if deployment_scenario.startswith("p2p"):
return VswitchControllerP2P(vswitch_class, traffic)
- elif deployment_scenario.find("pvp") >= 0:
- return VswitchControllerPVP(vswitch_class, traffic)
- elif deployment_scenario.find("pvvp") >= 0:
- return VswitchControllerPVVP(vswitch_class, traffic)
- elif deployment_scenario.find("op2p") >= 0:
+ elif deployment_scenario.startswith("pvp"):
+ return VswitchControllerPXP(deployment_scenario, vswitch_class, traffic)
+ elif deployment_scenario.startswith("pvvp"):
+ return VswitchControllerPXP(deployment_scenario, vswitch_class, traffic)
+ elif deployment_scenario.startswith("pvpv"):
+ return VswitchControllerPXP(deployment_scenario, vswitch_class, traffic)
+ elif deployment_scenario.startswith("op2p"):
return VswitchControllerOP2P(vswitch_class, traffic, tunnel_operation)
- elif deployment_scenario.find("ptunp") >= 0:
+ elif deployment_scenario.startswith("ptunp"):
return VswitchControllerPtunP(vswitch_class, traffic)
- elif deployment_scenario.find("clean") >= 0:
+ elif deployment_scenario.startswith("clean"):
return VswitchControllerClean(vswitch_class, traffic)
+ else:
+ raise RuntimeError("Unknown deployment scenario '{}'.".format(deployment_scenario))
def create_vnf(deployment_scenario, vnf_class):