X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=apex%2Fovercloud%2Fdeploy.py;h=5bbcaedef710545c4321295c764b9a0e6c51f802;hb=67e7b3c76402445d7e62d5953d661794ec1f7c6d;hp=809afc13a3a7adb85f74f1297b214b88f4b3d165;hpb=26b194b287340d4469bfcef0aaa5aacbd36c2dca;p=apex.git diff --git a/apex/overcloud/deploy.py b/apex/overcloud/deploy.py index 809afc13..5bbcaede 100644 --- a/apex/overcloud/deploy.py +++ b/apex/overcloud/deploy.py @@ -11,6 +11,7 @@ import base64 import fileinput import logging import os +import platform import shutil import uuid import struct @@ -37,6 +38,7 @@ SDN_FILE_MAP = { 'dvr': 'neutron-opendaylight-fdio-dvr.yaml', 'default': 'neutron-opendaylight-honeycomb.yaml' }, + 'l2gw': 'neutron-l2gw-opendaylight.yaml', 'default': 'neutron-opendaylight.yaml', }, 'onos': { @@ -71,14 +73,37 @@ ODL_NETVIRT_VPP_RPM = "/root/opendaylight-7.0.0-0.1.20170531snap665.el7" \ def build_sdn_env_list(ds, sdn_map, env_list=None): + """ + Builds a list of SDN environment files to be used in the deploy cmd. + + This function recursively searches an sdn_map. First the sdn controller is + matched and then the function looks for enabled features for that + controller to determine which environment files should be used. By + default the feature will be checked if set to true in deploy settings to be + added to the list. If a feature does not have a boolean value, then the + key and value pair to compare with are checked as a tuple (k,v). + + :param ds: deploy settings + :param sdn_map: SDN map to recursively search + :param env_list: recursive var to hold previously found env_list + :return: A list of env files + """ if env_list is None: env_list = list() for k, v in sdn_map.items(): if ds['sdn_controller'] == k or (k in ds and ds[k] is True): if isinstance(v, dict): + # Append default SDN env file first + # The assumption is that feature-enabled SDN env files + # override and do not conflict with previously set default + # settings + if ds['sdn_controller'] == k and 'default' in v: + env_list.append(os.path.join(con.THT_ENV_DIR, + v['default'])) env_list.extend(build_sdn_env_list(ds, v)) else: env_list.append(os.path.join(con.THT_ENV_DIR, v)) + # check if the value is not a boolean elif isinstance(v, tuple): if ds[k] == v[0]: env_list.append(os.path.join(con.THT_ENV_DIR, v[1])) @@ -128,6 +153,14 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir, raise ApexDeployException("Invalid number of control or computes") elif num_control > 1 and not ds['global_params']['ha_enabled']: num_control = 1 + if platform.machine() == 'aarch64': + # aarch64 deploys were not completing in the default 90 mins. + # Not sure if this is related to the hardware the OOO support + # was developed on or the virtualization support in CentOS + # Either way it will probably get better over time as the aarch + # support matures in CentOS and deploy time should be tested in + # the future so this multiplier can be removed. + con.DEPLOY_TIMEOUT *= 2 cmd = "openstack overcloud deploy --templates --timeout {} " \ .format(con.DEPLOY_TIMEOUT) # build cmd env args @@ -153,10 +186,11 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir, return cmd -def prep_image(ds, img, tmp_dir, root_pw=None): +def prep_image(ds, ns, img, tmp_dir, root_pw=None): """ Locates sdn image and preps for deployment. :param ds: deploy settings + :param ns: network settings :param img: sdn image :param tmp_dir: dir to store modified sdn image :param root_pw: password to configure for overcloud image @@ -186,6 +220,18 @@ def prep_image(ds, img, tmp_dir, root_pw=None): ".service" }]) + if ns.get('http_proxy', ''): + virt_cmds.append({ + con.VIRT_RUN_CMD: + "echo 'http_proxy={}' >> /etc/environment".format( + ns['http_proxy'])}) + + if ns.get('https_proxy', ''): + virt_cmds.append({ + con.VIRT_RUN_CMD: + "echo 'https_proxy={}' >> /etc/environment".format( + ns['https_proxy'])}) + if ds_opts['vpn']: virt_cmds.append({con.VIRT_RUN_CMD: "chmod +x /etc/rc.d/rc.local"}) virt_cmds.append({ @@ -510,6 +556,9 @@ def prep_storage_env(ds, tmp_dir): elif 'CephAdminKey' in line: print(" CephAdminKey: {}".format(generate_ceph_key().decode( 'utf-8'))) + elif 'CephClientKey' in line: + print(" CephClientKey: {}".format(generate_ceph_key().decode( + 'utf-8'))) else: print(line) if 'ceph_device' in ds_opts and ds_opts['ceph_device']: