summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-10-19 20:51:07 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-19 20:51:07 +0000
commit2f1c99daeee9cf0e89a8e833e034e7a5979ae894 (patch)
tree71526dd83273292d399088e957b95dc199ab26d8
parent658392b4f6972711ff4ddff85a5c4f2107f05ab4 (diff)
parent909f355dd5195e81b45a14f88f6f879ee4c8867d (diff)
Merge "Fix interface role mapping config for odl-fdio scenarios" into stable/euphratesopnfv-5.0.0
-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 c0e9968b..bf209285 100644
--- a/apex/overcloud/deploy.py
+++ b/apex/overcloud/deploy.py
@@ -315,8 +315,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()
@@ -370,22 +374,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:
@@ -414,6 +406,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: