diff options
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/deploy.sh | 76 |
1 files changed, 19 insertions, 57 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh index 501a36c67..9a22e9ec5 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -35,14 +35,13 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $(notify "$(basename "$0"): Deploy the Fuel@OPNFV MCP stack" 3) $(notify "USAGE:" 2) - $(basename "$0") -b base-uri -l lab-name -p pod-name -s deploy-scenario \\ - [-B PXE Bridge [-B Mgmt Bridge [-B Internal Bridge [-B Public Bridge]]]] \\ + $(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]] [-F] [-e | -E[E]] [-d] [-D] $(notify "OPTIONS:" 2) -b Base-uri for the stack-configuration structure - -B Bridge(s): 1st usage = PXE, 2nd = Mgmt, 3rd = Internal, 4th = Public -d Dry-run -D Debug logging -e Do not launch environment deployment @@ -67,20 +66,14 @@ and provides a fairly simple mechanism to execute a deployment. $(notify "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) should be available at: + A POD Descriptor File (PDF) and its Installer Descriptor File (IDF) + companion should be available at: <base-uri>/labs/<lab-name>/<pod-name>.yaml - The default is './mcp/config'. --B Bridges to be used by deploy script. It can be specified several times, - or as a comma separated list of bridges, or both: -B br1 -B br2,br3 - First occurence sets PXE Brige, next Mgmt, then Internal and Public. - For an empty value, the deploy script will use virsh to create the default - expected network (e.g. -B pxe,,,public will use existing "pxe" and "public" - bridges, respectively create "mgmt" and "internal"). - Note that a virtual network "mcpcontrol" is always created. For virtual - deploys, "mcpcontrol" is also used for PXE, leaving the PXE bridge unused. - For baremetal deploys, PXE bridge is used for baremetal node provisioning, - while "mcpcontrol" is used to provision the infrastructure VMs only. - The default is 'pxebr'. + <base-uri>/labs/<lab-name>/idf-<pod-name>.yaml + An example config is provided inside current repo in + <./mcp/config>. + 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 @@ -141,9 +134,10 @@ DEPLOY_DIR=$(cd "${REPO_ROOT_PATH}/mcp/scripts"; pwd) STORAGE_DIR=$(cd "${REPO_ROOT_PATH}/mcp/deploy/images"; pwd) RECLASS_CLUSTER_DIR=$(cd "${REPO_ROOT_PATH}/mcp/reclass/classes/cluster"; pwd) DEPLOY_TYPE='baremetal' +BR_NAMES=('admin' 'mgmt' 'private' 'public') OPNFV_BRIDGES=('pxebr' 'mgmt' 'internal' 'public') URI_REGEXP='(file|https?|ftp)://.*' -BASE_CONFIG_URI="file://${REPO_ROOT_PATH}/mcp/config" +BASE_CONFIG_URI="file://${REPO_ROOT_PATH}/mcp/scripts/pharos" # Customize deploy workflow DRY_RUN=${DRY_RUN:-0} @@ -164,8 +158,7 @@ source "${DEPLOY_DIR}/lib.sh" # BEGIN of main # set +x -OPNFV_BRIDGE_IDX=0 -while getopts "b:B:dDfEFl:L:p:Ps:S:he" OPTION +while getopts "b:dDfEFl:L:p:Ps:S:he" OPTION do case $OPTION in b) @@ -176,18 +169,6 @@ do exit 1 fi ;; - B) - OIFS=${IFS} - IFS=',' - OPT_BRIDGES=($OPTARG) - for bridge in "${OPT_BRIDGES[@]}"; do - if [ -n "${bridge}" ]; then - OPNFV_BRIDGES[${OPNFV_BRIDGE_IDX}]="${bridge}" - fi - ((OPNFV_BRIDGE_IDX+=1)) - done - IFS=${OIFS} - ;; d) DRY_RUN=1 ;; @@ -321,13 +302,8 @@ fi # Check scenario file existence SCENARIO_DIR="../config/scenario" if [ ! -f "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml" ]; then - notify "[WARN] ${DEPLOY_SCENARIO}.yaml not found!\n" 3 - notify "[WARN] Setting simplest scenario (os-nosdn-nofeature-noha)\n" 3 - DEPLOY_SCENARIO='os-nosdn-nofeature-noha' - if [ ! -f "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml" ]; then - notify "[ERROR] Scenario definition file is missing!\n" 1>&2 - exit 1 - fi + notify "[ERROR] Scenario definition file is missing!\n" 1>&2 + exit 1 fi # Check defaults file existence @@ -392,26 +368,11 @@ if [ "${DEPLOY_TYPE}" = 'baremetal' ]; then done fi -# Map PDF networks 'admin', 'mgmt', 'private' and 'public' to bridge names -BR_NAMES=('admin' 'mgmt' 'private' 'public') -BR_NETS=( \ - "${paramaters__param_opnfv_infra_maas_pxe_address}" \ - "${parameters__param_opnfv_infra_config_address}" \ - "${parameters__param_opnfv_openstack_compute_node01_tenant_address}" \ - "${parameters__param_opnfv_openstack_compute_node01_external_address}" \ -) -for ((i = 0; i < ${#BR_NETS[@]}; i++)); do +# Determine 'admin', 'mgmt', 'private' and 'public' bridge names based on IDF +for ((i = 0; i < ${#BR_NAMES[@]}; i++)); do br_jump=$(eval echo "\$parameters__param_opnfv_jump_bridge_${BR_NAMES[i]}") - if [ -n "${br_jump}" ] && [ "${br_jump}" != 'None' ] && \ - [ -d "/sys/class/net/${br_jump}/bridge" ]; then - notify "[OK] Bridge found for '${BR_NAMES[i]}': ${br_jump}\n" 2 - OPNFV_BRIDGES[${i}]="${br_jump}" - elif [ -n "${BR_NETS[i]}" ]; then - bridge=$(ip addr | awk "/${BR_NETS[i]%.*}./ {print \$NF; exit}") - if [ -n "${bridge}" ] && [ -d "/sys/class/net/${bridge}/bridge" ]; then - notify "[OK] Bridge found for net ${BR_NETS[i]%.*}.0: ${bridge}\n" 2 - OPNFV_BRIDGES[${i}]="${bridge}" - fi + if [ -n "${br_jump}" ] && [ "${br_jump}" != 'None' ]; then + OPNFV_BRIDGES[${i}]="${br_jump}" fi done notify "[NOTE] Using bridges: ${OPNFV_BRIDGES[*]}\n" 2 @@ -428,6 +389,7 @@ else prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_repos_pkgs}" \ "${virtual_nodes[@]}" create_networks "${OPNFV_BRIDGES[@]}" + do_sysctl_cfg create_vms "${STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}" update_mcpcontrol_network start_vms "${virtual_nodes[@]}" |