End deployment when timeout 35/29635/1
authorAlex Yang <yangyang1@zte.com.cn>
Thu, 2 Mar 2017 12:08:35 +0000 (20:08 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Thu, 2 Mar 2017 12:08:35 +0000 (20:08 +0800)
Change-Id: Iaae02bfc69450d6138b7b187ec23e4ed2eef6138
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
ci/deploy/deploy.sh
deploy/check_openstack_progress.sh
deploy/check_os_progress.sh

index 7f57d01..e7aba37 100755 (executable)
@@ -49,7 +49,7 @@ sudo `basename $0` -b base_path
                    -l zte -p pod2 -B pxebr
                    -d ./deploy/config/vm_environment/zte-virtual1/deploy.yml
                    -n ./deploy/config/vm_environment/zte-virtual1/network.yml
-                   -r /opt/daisy -w /opt/daisy -l zte -p pod2
+                   -r /opt/daisy -w /opt/daisy
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 EOF
 }
@@ -323,12 +323,18 @@ ssh $SSH_PARAS $DAISY_IP "systemctl restart daisy-registry"
 
 echo "===========check install progress==========="
 ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_os_progress.sh -d $IS_BARE -n $TARGET_HOSTS_NUM"
+if [ $? -ne 0 ]; then
+    exit 1;
+fi
 sleep 10
 
 if [ $IS_BARE == 0 ];then
     virsh reboot all_in_one
 fi
 ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_openstack_progress.sh"
+if [ $? -ne 0 ]; then
+    exit 1;
+fi
 
 exit 0
 
index c1c88eb..bbd631b 100755 (executable)
@@ -2,7 +2,17 @@
 source /root/daisyrc_admin
 echo "check openstack installing progress..."
 cluster_id=`daisy cluster-list | awk -F "|" '{print $2}' | sed -n '4p'`
+
+maxcount=180
+count=0
+
 while true; do
+    if [ $count -gt $maxcount ]; then
+        echo "It took too long to install openstack, exit 1."
+        exit 1
+    fi
+    count=$[count + 1]
+
     openstack_install_active=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $12}' | grep -c "active" `
     openstack_install_failed=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $12}' | grep -c "install-failed" `
     if [ $openstack_install_active -eq 1 ]; then
index abbd7e5..c631a71 100755 (executable)
@@ -45,7 +45,15 @@ echo "run daisy install command"
 daisy install $cluster_id --skip-pxe-ipmi $skip
 
 echo "check os installing progress..."
+maxcount=180
+count=0
 while true; do
+    if [ $count -gt $maxcount ]; then
+        echo "It took too long to install the os, exit 1."
+        exit 1
+    fi
+    count=$[count + 1]
+
     os_install_active=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $8}' | grep -c "active" `
     os_install_failed=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $8}' | grep -c "install-failed" `
     if [ $os_install_active -eq $hosts_num ]; then
@@ -57,7 +65,7 @@ while true; do
     else
         progress=`daisy host-list --cluster-id $cluster_id |grep DISCOVERY_SUCCESSFUL |awk -F "|" '{print $7}'|sed s/[[:space:]]//g|sed ':a;N;$ s/\n/ /g;ba'`
         echo "os in installing, the progress of each node is $progress%"
-        sleep 10
+        sleep 30
     fi
 done
 systemctl disable dhcpd