Disables ODL clustering for FDIO+ODL scenarios
[apex.git] / ci / deploy.sh
index 39eba88..4df2d6a 100755 (executable)
@@ -24,35 +24,51 @@ green=$(tput setaf 2 || echo "")
 
 interactive="FALSE"
 ping_site="8.8.8.8"
-ntp_server="pool.ntp.org"
-net_isolation_enabled="TRUE"
-net_isolation_arg=""
+dnslookup_site="www.google.com"
 post_config="TRUE"
 debug="FALSE"
 
+ovs_rpm_name=openvswitch-2.5.90-1.el7.centos.x86_64.rpm
+ovs_kmod_rpm_name=openvswitch-kmod-2.5.90-1.el7.centos.x86_64.rpm
+
 declare -i CNT
 declare UNDERCLOUD
 declare -A deploy_options_array
 declare -a performance_options
 declare -A NET_MAP
 
+# Backwards compat for old ENV Vars
+# Remove in E Release
+if [ -n "$CONFIG" ]; then
+    echo -e "${red}WARNING: ENV var CONFIG is Deprecated, please unset CONFIG and export BASE in its place${reset}"
+    echo -e "${red}WARNING: CONFIG will be removed in E${reset}"
+    BASE=$CONFIG
+fi
+if [ -n "$RESOURCES" ]; then
+    echo -e "${red}WARNING: ENV var RESOURCES is Deprecated, please unset RESOURCES and export IMAGES in its place${reset}"
+    echo -e "${red}WARNING: RESOURCES will be removed in E${reset}"
+    IMAGES=$RESOURCES
+fi
+
+APEX_TMP_DIR=$(python3 -c "import tempfile; print(tempfile.mkdtemp())")
 SSH_OPTIONS=(-o StrictHostKeyChecking=no -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -o LogLevel=error)
 DEPLOY_OPTIONS=""
-CONFIG=${CONFIG:-'/var/opt/opnfv'}
-RESOURCES=${RESOURCES:-"$CONFIG/images"}
-LIB=${LIB:-"$CONFIG/lib"}
-OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network api_network"
+BASE=${BASE:-'/var/opt/opnfv'}
+IMAGES=${IMAGES:-"$BASE/images"}
+LIB=${LIB:-"$BASE/lib"}
+OPNFV_NETWORK_TYPES="admin tenant external storage api"
+ENV_FILE="opnfv-environment.yaml"
 
 VM_CPUS=4
 VM_RAM=8
 VM_COMPUTES=1
 
 # Netmap used to map networks to OVS bridge names
-NET_MAP['admin_network']="br-admin"
-NET_MAP['private_network']="br-private"
-NET_MAP['public_network']="br-public"
-NET_MAP['storage_network']="br-storage"
-NET_MAP['api_network']="br-api"
+NET_MAP['admin']="br-admin"
+NET_MAP['tenant']="br-tenant"
+NET_MAP['external']="br-external"
+NET_MAP['storage']="br-storage"
+NET_MAP['api']="br-api"
 ext_net_type="interface"
 ip_address_family=4
 
@@ -81,13 +97,14 @@ display_usage() {
   echo -e "   --inventory | -i : Full path to inventory yaml file. Required only for baremetal"
   echo -e "   --net-settings | -n : Full path to network settings file. Optional."
   echo -e "   --ping-site | -p : site to use to verify IP connectivity. Optional. Defaults to 8.8.8.8"
+  echo -e "   --dnslookup-site : site to use to verify DNS resolution. Optional. Defaults to www.google.com"
   echo -e "   --virtual | -v : Virtualize overcloud nodes instead of using baremetal."
-  echo -e "   --flat : disable Network Isolation and use a single flat network for the underlay network."
   echo -e "   --no-post-config : disable Post Install configuration."
   echo -e "   --debug : enable debug output."
   echo -e "   --interactive : enable interactive deployment mode which requires user to confirm steps of deployment."
   echo -e "   --virtual-cpus : Number of CPUs to use per Overcloud VM in a virtual deployment (defaults to 4)."
-  echo -e "   --virtual-ram : Amount of RAM to use per Overcloud VM in GB (defaults to 8)."
+  echo -e "   --virtual-default-ram : Amount of default RAM to use per Overcloud VM in GB (defaults to 8)."
+  echo -e "   --virtual-compute-ram : Amount of RAM to use per Overcloud Compute VM in GB (defaults to 8). Overrides --virtual-default-ram arg for computes"
 }
 
 ##translates the command line parameters into variables
@@ -118,22 +135,26 @@ parse_cmdline() {
                 echo "Network Settings Configuration file: $2"
                 shift 2
             ;;
+        -e|--environment-file)
+                ENV_FILE=$2
+                echo "Base OOO Environment file: $2"
+                shift 2
+            ;;
         -p|--ping-site)
                 ping_site=$2
                 echo "Using $2 as the ping site"
                 shift 2
             ;;
+        --dnslookup-site)
+                dnslookup_site=$2
+                echo "Using $2 as the dnslookup site"
+                shift 2
+            ;;
         -v|--virtual)
                 virtual="TRUE"
                 echo "Executing a Virtual Deployment"
                 shift 1
             ;;
-        --flat )
-                net_isolation_enabled="FALSE"
-                net_isolation_arg="--flat"
-                echo "Underlay Network Isolation Disabled: using flat configuration"
-                shift 1
-            ;;
         --no-post-config )
                 post_config="FALSE"
                 echo "Post install configuration disabled"
@@ -154,9 +175,9 @@ parse_cmdline() {
                 echo "Number of CPUs per VM set to $VM_CPUS"
                 shift 2
             ;;
-        --virtual-ram )
+        --virtual-default-ram )
                 VM_RAM=$2
-                echo "Amount of RAM per VM set to $VM_RAM"
+                echo "Amount of Default RAM per VM set to $VM_RAM"
                 shift 2
             ;;
         --virtual-computes )
@@ -164,6 +185,11 @@ parse_cmdline() {
                 echo "Virtual Compute nodes set to $VM_COMPUTES"
                 shift 2
             ;;
+        --virtual-compute-ram )
+                VM_COMPUTE_RAM=$2
+                echo "Virtual Compute RAM set to $VM_COMPUTE_RAM"
+                shift 2
+            ;;
         *)
                 display_usage
                 exit 1
@@ -172,9 +198,7 @@ parse_cmdline() {
   done
   sleep 2
 
-  if [[ ! -z "$NETSETS" && "$net_isolation_enabled" == "FALSE" ]]; then
-    echo -e "${red}INFO: Single flat network requested. Only admin_network settings will be used!${reset}"
-  elif [[ -z "$NETSETS" ]]; then
+  if [[ -z "$NETSETS" ]]; then
     echo -e "${red}ERROR: You must provide a network_settings file with -n.${reset}"
     exit 1
   fi
@@ -185,7 +209,7 @@ parse_cmdline() {
           echo -e "${red}ERROR: You should not specify an inventory file with virtual deployments${reset}"
           exit 1
       else
-          INVENTORY_FILE='/tmp/inventory-virt.yaml'
+          INVENTORY_FILE="$APEX_TMP_DIR/inventory-virt.yaml"
       fi
   elif [[ -z "$INVENTORY_FILE" ]]; then
     echo -e "${red}ERROR: You must specify an inventory file for baremetal deployments! Exiting...${reset}"
@@ -205,11 +229,6 @@ parse_cmdline() {
     exit 1
   fi
 
-  if [[ "$net_isolation_enabled" == "FALSE" && "$post_config" == "TRUE" ]]; then
-    echo -e "${blue}INFO: Post Install Configuration will be skipped.  It is not supported with --flat${reset}"
-    post_config="FALSE"
-  fi
-
 }
 
 main() {
@@ -246,7 +265,7 @@ main() {
     fi
   fi
   if [[ "${deploy_options_array['sdn_controller']}" == 'onos' ]]; then
-    if ! onos_update_gw_mac ${public_network_cidr} ${public_network_gateway}; then
+    if ! onos_update_gw_mac ${external_cidr} ${external_gateway}; then
       echo -e "${red}ERROR:ONOS Post Install Configuration Failed, Exiting.${reset}"
       exit 1
     else