Merge "[opendaylight] Update SQLAlchemy library"
[fuel.git] / ci / deploy.sh
index 103f83b..a61946e 100755 (executable)
@@ -32,7 +32,7 @@ usage ()
 {
 cat << EOF
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-$(notify "$(basename "$0"): Deploy the Fuel@OPNFV MCP stack" 3)
+$(notify "$(basename "$0"): Deploy the OPNFV Fuel MCP stack" 3)
 
 $(notify "USAGE:" 2)
   $(basename "$0") -l lab-name -p pod-name -s deploy-scenario \\
@@ -59,9 +59,9 @@ $(notify "OPTIONS:" 2)
   -N  Experimental: Do not virtualize control plane (novcp)
 
 $(notify_i "Description:" 2)
-Deploys the Fuel@OPNFV stack on the indicated lab resource.
+Deploys the OPNFV Fuel stack on the indicated lab resource.
 
-This script provides the Fuel@OPNFV deployment abstraction.
+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.
 
@@ -74,8 +74,6 @@ $(notify_i "Input parameters to the build script are:" 2)
    <base-uri>/labs/<lab-name>/idf-<pod-name>.yaml
    The default is using the git submodule tracking 'OPNFV Pharos' in
    <./mcp/scripts/pharos>.
-   An example config is provided inside current repo in
-   <./mcp/config>, automatically linked as <./mcp/scripts/pharos/labs/local>.
 -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
@@ -92,10 +90,7 @@ $(notify_i "Input parameters to the build script are:" 2)
 -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
-   For the sample configuration in <./mcp/config>, lab name is 'local'.
 -p POD name as defined in the configuration directory, e.g. pod2
-   For the sample configuration in <./mcp/config>, POD name is 'virtual1'
-   for virtual deployments or 'pod1' for baremetal (based on lf-pod2).
 -m Use single socket compute nodes. Instead of using default NUMA-enabled
    topology for virtual compute nodes created via libvirt, configure a
    single guest CPU socket.
@@ -150,6 +145,8 @@ MCP_CMP_SS=${MCP_CMP_SS:-0}
 source "${DEPLOY_DIR}/globals.sh"
 source "${DEPLOY_DIR}/lib.sh"
 source "${DEPLOY_DIR}/lib_template.sh"
+source "${DEPLOY_DIR}/lib_jump_common.sh"
+source "${DEPLOY_DIR}/lib_jump_deploy.sh"
 
 #
 # END of variables to customize
@@ -246,7 +243,7 @@ pushd "${DEPLOY_DIR}" > /dev/null
 
 # Install required packages on jump server
 sudo mkdir -p "${MCP_STORAGE_DIR}"
-sudo chown "${USER}:${USER}" "${MCP_STORAGE_DIR}"
+sudo chown -R "${USER}:${USER}" "${MCP_STORAGE_DIR}"
 if [ ${USE_EXISTING_PKGS} -eq 1 ]; then
     notify "[NOTE] Skipping distro pkg installation" 2
 else
@@ -256,7 +253,7 @@ else
     virtinst_install "${MCP_STORAGE_DIR}"
 fi
 
-if ! virsh list >/dev/null 2>&1; then
+if ! ${VIRSH} list >/dev/null 2>&1; then
     notify_e "[ERROR] This script requires hypervisor access"
 fi
 
@@ -278,6 +275,7 @@ generate_ssh_key
 export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")"
 
 # Expand jinja2 templates based on PDF data and env vars
+[[ "${DEPLOY_SCENARIO}" =~ -ha$ ]] || MCP_VCP=0
 export MCP_REPO_ROOT_PATH MCP_VCP MCP_STORAGE_DIR MCP_DOCKER_TAG MCP_CMP_SS \
        MCP_JUMP_ARCH=$(uname -i) MCP_DEPLOY_SCENARIO="${DEPLOY_SCENARIO}"
 do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
@@ -308,6 +306,7 @@ else
     do_sysctl_cfg
     do_udev_cfg
     create_vms "${MCP_STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}"
+    update_mcpcontrol_network
     start_vms "${virtual_nodes[@]}"
 
     # https://github.com/docker/libnetwork/issues/1743
@@ -336,9 +335,9 @@ else
             reset_vms "${virtual_nodes[@]}"
         fi
     done
-fi
 
-./log.sh "${DEPLOY_LOG}"
+    ./log.sh "${DEPLOY_LOG}"
+fi
 
 popd > /dev/null