summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-10-19 13:27:43 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-19 13:27:43 +0000
commit5a9a6460ab27d758ac72321998a5ffda3e98e931 (patch)
tree8ddf634cb6c4474ad68e159b5516f5f3c8e1a4f4
parent550c8c756b04af4e4038e42ea17478e851b2341d (diff)
parentda99ee8cf99824a7ee5ff19544d3eec4788edd68 (diff)
Merge "Fix interface role mapping config for odl-fdio scenarios"
-rw-r--r--apex/overcloud/deploy.py40
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py30
2 files changed, 48 insertions, 22 deletions
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py
index ef916a43..8016e1fd 100644
--- a/apex/overcloud/deploy.py
+++ b/apex/overcloud/deploy.py
@@ -306,8 +306,12 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir):
tmp_opnfv_env = os.path.join(tmp_dir, os.path.basename(opnfv_env))
shutil.copyfile(opnfv_env, tmp_opnfv_env)
tenant_nic_map = ns['networks']['tenant']['nic_mapping']
- tenant_ctrl_nic = tenant_nic_map['controller']['members'][0]
- tenant_comp_nic = tenant_nic_map['compute']['members'][0]
+ tenant_nic = dict()
+ tenant_nic['Controller'] = tenant_nic_map['controller']['members'][0]
+ tenant_nic['NovaCompute'] = tenant_nic_map['compute']['members'][0]
+ external_nic_map = ns['networks']['external'][0]['nic_mapping']
+ external_nic = dict()
+ external_nic['NovaCompute'] = external_nic_map['compute']['members'][0]
# SSH keys
private_key, public_key = make_ssh_key()
@@ -361,22 +365,10 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir):
output_line = (" opendaylight::vpp_routing_node: {}.{}"
.format(ds_opts['odl_vpp_routing_node'],
ns['domain_name']))
- elif 'ControllerExtraConfig' in line:
- output_line = (" ControllerExtraConfig:\n "
- "tripleo::profile::base::neutron::agents::"
- "honeycomb::interface_role_mapping:"
- " ['{}:tenant-interface]'"
- .format(tenant_ctrl_nic))
- elif 'NovaComputeExtraConfig' in line:
- output_line = (" NovaComputeExtraConfig:\n "
- "tripleo::profile::base::neutron::agents::"
- "honeycomb::interface_role_mapping:"
- " ['{}:tenant-interface]'"
- .format(tenant_comp_nic))
elif not ds_opts['sdn_controller'] and ds_opts['dataplane'] == 'fdio':
if 'NeutronVPPAgentPhysnets' in line:
output_line = (" NeutronVPPAgentPhysnets: 'datacentre:{}'".
- format(tenant_ctrl_nic))
+ format(tenant_nic['Controller']))
elif ds_opts['sdn_controller'] == 'opendaylight' and ds_opts.get(
'dvr') is True:
if 'OS::TripleO::Services::NeutronDhcpAgent' in line:
@@ -405,6 +397,24 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir):
perf_line += ("\n "
"fdio::vpp_cpu_corelist_workers: '{}'"
.format(perf_opts['corelist-workers']))
+ if ds_opts['sdn_controller'] == 'opendaylight' and \
+ ds_opts['dataplane'] == 'fdio':
+ if role == 'NovaCompute':
+ perf_line += ("\n "
+ "tripleo::profile::base::neutron::"
+ "agents::honeycomb::"
+ "interface_role_mapping:"
+ " ['{}:tenant-interface',"
+ "'{}:public-interface']"
+ .format(tenant_nic[role],
+ external_nic[role]))
+ else:
+ perf_line += ("\n "
+ "tripleo::profile::base::neutron::"
+ "agents::honeycomb::"
+ "interface_role_mapping:"
+ " ['{}:tenant-interface']"
+ .format(tenant_nic[role]))
if perf_line:
output_line = (" {}:{}".format(cfg, perf_line))
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index 1df10e4e..59e9048f 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -245,9 +245,14 @@ class TestOvercloudDeploy(unittest.TestCase):
'networks':
{'tenant':
{'nic_mapping': {'controller':
- {'members': ['test']},
+ {'members': ['tenant_nic']},
'compute':
- {'members': ['test']}}}}}
+ {'members': ['tenant_nic']}}},
+ 'external':
+ [{'nic_mapping': {'controller':
+ {'members': ['ext_nic']},
+ 'compute':
+ {'members': ['ext_nic']}}}]}}
inv = None
try:
# Swap stdout
@@ -279,9 +284,14 @@ class TestOvercloudDeploy(unittest.TestCase):
'networks':
{'tenant':
{'nic_mapping': {'controller':
- {'members': ['test']},
+ {'members': ['tenant_nic']},
'compute':
- {'members': ['test']}}}}}
+ {'members': ['tenant_nic']}}},
+ 'external':
+ [{'nic_mapping': {'controller':
+ {'members': ['ext_nic']},
+ 'compute':
+ {'members': ['ext_nic']}}}]}}
inv = None
try:
# Swap stdout
@@ -291,7 +301,8 @@ class TestOvercloudDeploy(unittest.TestCase):
# run test
prep_env(ds, ns, inv, 'opnfv-env.yml', '/net-env.yml', '/tmp')
output = out.getvalue().strip()
- assert_in('NeutronVPPAgentPhysnets: \'datacentre:test\'', output)
+ assert_in('NeutronVPPAgentPhysnets: \'datacentre:tenant_nic\'',
+ output)
assert_in('NeutronVPPAgentPhysnets', output)
finally:
# put stdout back
@@ -311,9 +322,14 @@ class TestOvercloudDeploy(unittest.TestCase):
'networks':
{'tenant':
{'nic_mapping': {'controller':
- {'members': ['test']},
+ {'members': ['tenant_nic']},
'compute':
- {'members': ['test']}}}}}
+ {'members': ['tenant_nic']}}},
+ 'external':
+ [{'nic_mapping': {'controller':
+ {'members': ['ext_nic']},
+ 'compute':
+ {'members': ['ext_nic']}}}]}}
inv = MagicMock()
inv.get_node_counts.return_value = (3, 2)
try: