X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=apex%2Fdeploy.py;h=5ec0f7fa395b7e49d67b2366d8e8b7bc59f13e19;hb=1a824cf106f1996f184a7f699c754a7b72c501be;hp=9ebc3f624c46fe4b2379ea49c5994c0948242f10;hpb=18b0862b97850f3e4bfb9abf0dc5835e90f0dada;p=apex.git diff --git a/apex/deploy.py b/apex/deploy.py index 9ebc3f62..5ec0f7fa 100644 --- a/apex/deploy.py +++ b/apex/deploy.py @@ -20,7 +20,7 @@ import sys import tempfile import apex.virtual.configure_vm as vm_lib -import apex.virtual.virtual_utils as virt_utils +import apex.virtual.utils as virt_utils from apex import DeploySettings from apex import Inventory from apex import NetworkEnvironment @@ -58,6 +58,14 @@ def validate_cross_settings(deploy_settings, net_settings, inventory): raise ApexDeployException("Setting a DPDK based dataplane requires" "a dedicated NIC for tenant network") + if 'odl_vpp_routing_node' in deploy_settings['deploy_options']: + if deploy_settings['deploy_options']['dataplane'] != 'fdio': + raise ApexDeployException("odl_vpp_routing_node should only be set" + "when dataplane is set to fdio") + if deploy_settings['deploy_options'].get('dvr') is True: + raise ApexDeployException("odl_vpp_routing_node should only be set" + "when dvr is not enabled") + # TODO(trozet): add more checks here like RAM for ODL, etc # check if odl_vpp_netvirt is true and vpp is set # Check if fdio and nosdn: @@ -83,7 +91,7 @@ def build_vms(inventory, network_settings, name, volume_path, baremetal_interfaces=network_settings.enabled_network_list, memory=node['memory'], cpus=node['cpu'], - macs=[node['mac_address']], + macs=node['mac'], template_dir=template_dir) virt_utils.host_setup({name: node['pm_port']}) @@ -280,10 +288,8 @@ def main(): ansible_args = { 'virsh_enabled_networks': net_settings.enabled_network_list } - ansible_path = os.path.join(args.lib_dir, ANSIBLE_PATH) utils.run_ansible(ansible_args, - os.path.join(args.lib_dir, - ansible_path, + os.path.join(args.lib_dir, ANSIBLE_PATH, 'deploy_dependencies.yml')) uc_external = False if 'external' in net_settings.enabled_network_list: @@ -328,8 +334,7 @@ def main(): args.deploy_dir, APEX_TEMP_DIR) # Install Undercloud undercloud.configure(net_settings, - os.path.join(args.lib_dir, - ansible_path, + os.path.join(args.lib_dir, ANSIBLE_PATH, 'configure_undercloud.yml'), APEX_TEMP_DIR) @@ -339,12 +344,12 @@ def main(): overcloud_deploy.prep_image(deploy_settings, sdn_image, APEX_TEMP_DIR, root_pw=root_pw) opnfv_env = os.path.join(args.deploy_dir, args.env_file) - overcloud_deploy.prep_env(deploy_settings, net_settings, opnfv_env, - net_env_target, APEX_TEMP_DIR) + overcloud_deploy.prep_env(deploy_settings, net_settings, inventory, + opnfv_env, net_env_target, APEX_TEMP_DIR) overcloud_deploy.create_deploy_cmd(deploy_settings, net_settings, inventory, APEX_TEMP_DIR, args.virtual, args.env_file) - deploy_playbook = os.path.join(args.lib_dir, ansible_path, + deploy_playbook = os.path.join(args.lib_dir, ANSIBLE_PATH, 'deploy_overcloud.yml') virt_env = 'virtual-environment.yaml' bm_env = 'baremetal-environment.yaml' @@ -404,6 +409,9 @@ def main(): deploy_vars['congress'] = True else: deploy_vars['congress'] = False + deploy_vars['calipso'] = ds_opts.get('calipso', False) + deploy_vars['calipso_ip'] = net_settings['networks']['admin'][ + 'installer_vm']['ip'] # TODO(trozet): this is probably redundant with getting external # network info from undercloud.py if 'external' in net_settings.enabled_network_list: @@ -415,7 +423,7 @@ def main(): deploy_vars['external_network_ipv6'] = True else: deploy_vars['external_network_ipv6'] = False - post_undercloud = os.path.join(args.lib_dir, ansible_path, + post_undercloud = os.path.join(args.lib_dir, ANSIBLE_PATH, 'post_deploy_undercloud.yml') logging.info("Executing post deploy configuration undercloud playbook") try: @@ -432,7 +440,7 @@ def main(): deploy_vars['vpn'] = ds_opts['vpn'] # TODO(trozet): pull all logs and store in tmp dir in overcloud # playbook - post_overcloud = os.path.join(args.lib_dir, ansible_path, + post_overcloud = os.path.join(args.lib_dir, ANSIBLE_PATH, 'post_deploy_overcloud.yml') # Run per overcloud node for node, ip in deploy_vars['overcloud_nodes'].items():