Fix kernel parameter setting
[apex.git] / ci / deploy.sh
index 639fd0f..bb4c1f8 100755 (executable)
@@ -22,7 +22,6 @@ blue=$(tput setaf 4 || echo "")
 red=$(tput setaf 1 || echo "")
 green=$(tput setaf 2 || echo "")
 
-vm_index=4
 interactive="FALSE"
 ping_site="8.8.8.8"
 ntp_server="pool.ntp.org"
@@ -45,6 +44,8 @@ OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_networ
 
 VM_CPUS=4
 VM_RAM=8
+VM_COMPUTES=2
+
 # Netmap used to map networks to OVS bridge names
 NET_MAP['admin_network']="br-admin"
 NET_MAP['private_network']="br-private"
@@ -501,6 +502,16 @@ function setup_virtual_baremetal {
 EOF
 
   # next create the virtual machines and add their definitions to the file
+  if [ ha_enabled == "False" ]; then
+      # 1 controller + computes
+      # zero based so just pass compute count
+      vm_index=$VM_COMPUTES
+  else
+      # 3 controller + computes
+      # zero based so add 2 to compute count
+      vm_index=$((2+$VM_COMPUTES))
+  fi
+
   for i in $(seq 0 $vm_index); do
     if ! virsh list --all | grep baremetal${i} > /dev/null; then
       define_vm baremetal${i} network 41 'admin_network' $vcpus $ramsize
@@ -640,7 +651,7 @@ function configure_network_environment {
   fi
 
   # check for ODL L3
-  if [ "${deploy_options_array['sdn_l3']}" == 'true' ]; then
+  if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then
       ext_net_type=br-ex
   fi
 
@@ -778,15 +789,15 @@ function undercloud_prep_overcloud_deploy {
   if [[ "${#deploy_options_array[@]}" -eq 0 || "${deploy_options_array['sdn_controller']}" == 'opendaylight' ]]; then
     if [ "${deploy_options_array['sdn_l3']}" == 'true' ]; then
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_l3.yaml"
-    elif [ "${deploy_options_array['sfc']}" == 'true' ]; then
+    elif [ "${deploy_options_array['sfc']}" == 'True' ]; then
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sfc.yaml"
-    elif [ "${deploy_options_array['vpn']}" == 'true' ]; then
+    elif [ "${deploy_options_array['vpn']}" == 'True' ]; then
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight_sdnvpn.yaml"
     else
       DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight.yaml"
     fi
     SDN_IMAGE=opendaylight
-    if [ "${deploy_options_array['sfc']}" == 'true' ]; then
+    if [ "${deploy_options_array['sfc']}" == 'True' ]; then
       SDN_IMAGE+=-sfc
       if [ ! -f $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 ]; then
           echo "${red} $RESOURCES/overcloud-full-${SDN_IMAGE}.qcow2 is required to execute an SFC deployment."
@@ -1000,7 +1011,7 @@ EOI
   fi
 
   # for sfc deployments we need the vxlan workaround
-  if [ "${deploy_options_array['sfc']}" == 'true' ]; then
+  if [ "${deploy_options_array['sfc']}" == 'True' ]; then
       ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <<EOI
 source stackrc
 set -o errexit
@@ -1054,7 +1065,6 @@ display_usage() {
   echo -e "   -n|--net-settings : Full path to network settings file. Optional."
   echo -e "   -p|--ping-site : site to use to verify IP connectivity. Optional. Defaults to 8.8.8.8"
   echo -e "   -v|--virtual : Virtualize overcloud nodes instead of using baremetal."
-  echo -e "   --no-ha : disable High Availability deployment scheme, this assumes a single controller and single compute node"
   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."
@@ -1102,12 +1112,6 @@ parse_cmdline() {
                 echo "Executing a Virtual Deployment"
                 shift 1
             ;;
-        --no-ha )
-                ha_enabled="False"
-                vm_index=1
-                echo "HA Deployment Disabled"
-                shift 1
-            ;;
         --flat )
                 net_isolation_enabled="FALSE"
                 echo "Underlay Network Isolation Disabled: using flat configuration"
@@ -1138,6 +1142,11 @@ parse_cmdline() {
                 echo "Amount of RAM per VM set to $VM_RAM"
                 shift 2
             ;;
+        --virtual-computes )
+                VM_COMPUTES=$2
+                echo "Virtual Compute nodes set to $VM_COMPUTES"
+                shift 2
+            ;;
         *)
                 display_usage
                 exit 1