#!/bin/bash -e # shellcheck disable=SC2034,SC2154,SC1090,SC1091,SC2155 ############################################################################## # Copyright (c) 2018 Ericsson AB, Mirantis Inc., Enea AB and others. # jonas.bjurel@ericsson.com # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## ############################################################################## # BEGIN of Exit handlers # do_exit () { local RC=$? cleanup_mounts > /dev/null 2>&1 if [ ${RC} -eq 0 ]; then notify_n "[OK] MCP: Openstack installation finished succesfully!" 2 else notify_n "[ERROR] MCP: Openstack installation threw a fatal error!" fi } # # End of Exit handlers ############################################################################## ############################################################################## # BEGIN of usage description # usage () { cat << EOF xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $(notify "$(basename "$0"): Deploy the OPNFV Fuel MCP stack" 3) $(notify "USAGE:" 2) $(basename "$0") -l lab-name -p pod-name -s deploy-scenario \\ [-b Lab Config Base URI] \\ [-S storage-dir] [-L /path/to/log/file.tar.gz] \\ [-f] [-F] [-e | -E[E]] [-d] [-D] [-N] [-m] $(notify "OPTIONS:" 2) -b Base-uri for the stack-configuration structure -d Dry-run -D Debug logging -e Do not launch environment deployment -E Remove existing VCP VMs (use twice to redeploy baremetal nodes) -f Deploy on existing Salt master (use twice or more to skip states) -F Same as -e, do not launch environment deployment (legacy option) -h Print this message and exit -l Lab-name -p Pod-name -P Skip installation of package dependencies -s Deploy-scenario short-name -S Storage dir for VM images and other deploy artifacts -L Deployment log path and file name -m Use single socket CPU compute nodes (only affects virtual computes) -N Experimental: Do not virtualize control plane (novcp) $(notify_i "Description:" 2) Deploys the OPNFV Fuel stack on the indicated lab resource. This script provides the OPNFV Fuel deployment abstraction. It depends on the OPNFV official configuration directory/file structure and provides a fairly simple mechanism to execute a deployment. $(notify_i "Input parameters to the build script are:" 2) -b Base URI to the configuration directory (needs to be provided in URI style, it can be a local resource: file:// or a remote resource http(s)://). A POD Descriptor File (PDF) and its Installer Descriptor File (IDF) companion should be available at: /labs//.yaml /labs//idf-.yaml The default is using the git submodule tracking 'OPNFV Pharos' in <./mcp/scripts/pharos>. -d Dry-run - Produce deploy config files, but do not execute deploy -D Debug logging - Enable extra logging in sh deploy scripts (set -x) -e Do not launch environment deployment -E Remove existing VCP VMs. It will destroy and undefine all VCP VMs currently defined on cluster KVM nodes. If specified twice (e.g. -E -E), baremetal nodes (VCP too, implicitly) will be removed, then reprovisioned. Only applicable for baremetal deploys. -f Deploy on existing Salt master. It will skip infrastructure VM creation, but it will still sync reclass configuration from current repo to Salt Master node. Each additional use skips one more state file. For example, -fff would skip the first 3 state files (e.g. virtual_init, maas, baremetal_init). -F Same as -e, do not launch environment deployment (legacy option) -h Print this message and exit -L Deployment log path and name, eg. -L /home/jenkins/job.log.tar.gz -l Lab name as defined in the configuration directory, e.g. lf -p POD name as defined in the configuration directory, e.g. pod2 -m Use single socket compute nodes. Instead of using default NUMA-enabled topology for virtual compute nodes created via libvirt, config