adding control of number of virtual compute nodes 33/14633/7
authorDan Radez <dradez@redhat.com>
Wed, 25 May 2016 00:26:03 +0000 (20:26 -0400)
committerDan Radez <dradez@redhat.com>
Fri, 27 May 2016 15:48:52 +0000 (11:48 -0400)
JIRA: APEX-86

Change-Id: Iae2f34337479ad0a399eecc46459f5afea938d57
Signed-off-by: Dan Radez <dradez@redhat.com>
ci/deploy.sh

index 6b38c33..a3b17ba 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"
@@ -43,6 +42,8 @@ CONFIG=${CONFIG:-'/var/opt/opnfv'}
 OPNFV_NETWORK_TYPES="admin_network private_network public_network storage_network"
 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"
@@ -494,6 +495,16 @@ function setup_virtual_baremetal {
 EOF
 
   # next create the virtual machines and add their definitions to the file
+  if [ ha_enabled != "FALSE" && "$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
@@ -1109,7 +1120,6 @@ parse_cmdline() {
             ;;
         --no-ha )
                 ha_enabled="False"
-                vm_index=1
                 echo "HA Deployment Disabled"
                 shift 1
             ;;
@@ -1143,6 +1153,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