summaryrefslogtreecommitdiffstats
path: root/apex/overcloud
diff options
context:
space:
mode:
authorRicardo Noriega <rnoriega@redhat.com>2018-02-12 12:58:14 +0100
committerRicardo Noriega <rnoriega@redhat.com>2018-03-15 21:12:34 +0100
commit974993a17188f10acd6a1f9b2f48002b9c77ef24 (patch)
tree8c269c3fe710f6687bcbf6a0a45f3a3112db06da /apex/overcloud
parent67e7b3c76402445d7e62d5953d661794ec1f7c6d (diff)
Adding SRIOV scenario
This scenario should enable SRIOV interfaces to be used by Neutron. Only will be supported in baremetal deployments with SRIOV capable NICs. The name of the interface must be known in advance and the physnet of the SRIOV network is set as nfv_sriov. Change-Id: Ie4295413e0be2197bd9ada4f887f6b47cd486765 Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
Diffstat (limited to 'apex/overcloud')
-rw-r--r--apex/overcloud/deploy.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py
index 5bbcaede..33641ed5 100644
--- a/apex/overcloud/deploy.py
+++ b/apex/overcloud/deploy.py
@@ -39,6 +39,7 @@ SDN_FILE_MAP = {
'default': 'neutron-opendaylight-honeycomb.yaml'
},
'l2gw': 'neutron-l2gw-opendaylight.yaml',
+ 'sriov': 'neutron-opendaylight-sriov.yaml',
'default': 'neutron-opendaylight.yaml',
},
'onos': {
@@ -137,6 +138,9 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir,
prep_storage_env(ds, tmp_dir)
deploy_options.append(os.path.join(con.THT_ENV_DIR,
'storage-environment.yaml'))
+ if ds_opts['sriov']:
+ prep_sriov_env(ds, tmp_dir)
+
if ds['global_params']['ha_enabled']:
deploy_options.append(os.path.join(con.THT_ENV_DIR,
'puppet-pacemaker.yaml'))
@@ -459,6 +463,13 @@ def prep_env(ds, ns, inv, opnfv_env, net_env, tmp_dir):
elif 'ComputeServices' in line:
output_line = (" ComputeServices:\n"
" - OS::TripleO::Services::NeutronDhcpAgent")
+ # SRIOV networks are VLAN based provider networks. In order to simplify
+ # the deployment, nfv_sriov will be the default physnet. VLANs are not
+ # needed in advance, and the user will have to create the network
+ # specifying the segmentation-id.
+ if ds_opts['sriov']:
+ if 'NeutronNetworkVLANRanges' in line:
+ output_line = ("{},nfv_sriov'".format(line[:-1]))
if perf:
for role in 'NovaCompute', 'Controller':
@@ -569,6 +580,46 @@ def prep_storage_env(ds, tmp_dir):
))
+def prep_sriov_env(ds, tmp_dir):
+ """
+ Creates SRIOV environment file for deployment. Source file is copied by
+ undercloud playbook to host.
+ :param ds:
+ :param tmp_dir:
+ :return:
+ """
+ ds_opts = ds['deploy_options']
+ sriov_iface = ds_opts['sriov']
+ sriov_file = os.path.join(tmp_dir, 'neutron-opendaylight-sriov.yaml')
+ if not os.path.isfile(sriov_file):
+ logging.error("sriov-environment file is not in tmp directory: {}. "
+ "Check if file was copied from "
+ "undercloud".format(tmp_dir))
+ raise ApexDeployException("sriov-environment file not copied from "
+ "undercloud")
+ # TODO(rnoriega): Instead of line editing, refactor this code to load
+ # yaml file into a dict, edit it and write the file back.
+ for line in fileinput.input(sriov_file, inplace=True):
+ line = line.strip('\n')
+ if 'NovaSchedulerDefaultFilters' in line:
+ print(" {}".format(line[3:]))
+ elif 'NovaSchedulerAvailableFilters' in line:
+ print(" {}".format(line[3:]))
+ elif 'NeutronPhysicalDevMappings' in line:
+ print(" NeutronPhysicalDevMappings: \"nfv_sriov:{}\""
+ .format(sriov_iface))
+ elif 'NeutronSriovNumVFs' in line:
+ print(" NeutronSriovNumVFs: \"{}:8\"".format(sriov_iface))
+ elif 'NovaPCIPassthrough' in line:
+ print(" NovaPCIPassthrough:")
+ elif 'devname' in line:
+ print(" - devname: \"{}\"".format(sriov_iface))
+ elif 'physical_network' in line:
+ print(" physical_network: \"nfv_sriov\"")
+ else:
+ print(line)
+
+
def external_network_cmds(ns):
"""
Generates external network openstack commands