modify daisy install interface and modify check_openstack_progress targetnode nums 87/30387/1
authorzhouya <zhou.ya@zte.com.cn>
Tue, 14 Mar 2017 06:59:35 +0000 (14:59 +0800)
committerzhouya <zhou.ya@zte.com.cn>
Tue, 14 Mar 2017 06:59:35 +0000 (14:59 +0800)
Change-Id: I19f8c18f8b977619c9bbf6f1e80f7c48f8f5db9e
Signed-off-by: zhouya <zhou.ya@zte.com.cn>
ci/deploy/deploy.sh
deploy/check_openstack_progress.sh
deploy/check_os_progress.sh
deploy/tempest.py

index efae838..3caacde 100755 (executable)
@@ -337,7 +337,7 @@ 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"
+ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_openstack_progress.sh -n $TARGET_HOSTS_NUM"
 if [ $? -ne 0 ]; then
     exit 1;
 fi
index f4baff1..3512d6b 100755 (executable)
@@ -1,4 +1,35 @@
 #!/bin/bash
+usage()
+{
+    cat << EOF
+USAGE: `basename $0`  [-n hosts_num]
+
+OPTIONS:
+  -n target node numbers
+
+EXAMPLE:
+    sudo `basename $0` -d 1 -n 5
+EOF
+}
+
+while getopts "n:h" OPTION
+do
+    case $OPTION in
+        n)
+            hosts_num=${OPTARG}
+            ;;
+        h)
+            usage
+            exit 0
+            ;;
+        *)
+            echo "${OPTION} is not a valid argument"
+            usage
+            exit 0
+            ;;
+    esac
+done
+
 source /root/daisyrc_admin
 echo "check openstack installing progress..."
 cluster_id=`daisy cluster-list | awk -F "|" '{print $2}' | sed -n '4p' | tr -d " "`
@@ -15,7 +46,7 @@ while true; do
 
     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
+    if [ $openstack_install_active -eq $hosts_num ]; then
         echo "openstack installing successful ..."
         break
     elif [ $openstack_install_failed -gt 0 ]; then
index f76af9b..bb2b334 100755 (executable)
@@ -37,9 +37,7 @@ done
 source /root/daisyrc_admin
 cluster_id=`daisy cluster-list | awk -F "|" '{print $2}' | sed -n '4p' | tr -d " "`
 hosts_id=`daisy host-list | awk -F "|" '{print $2}'| grep -o "[^ ]\+\( \+[^ ]\+\)*"|tail -n +2`
-skip=false
 if [ $deploy_env == 0 ];then
-    skip=true
     for host_id in $hosts_id
     do
         echo "detail info of host $host_id:"
@@ -54,9 +52,6 @@ else
     echo "update all hosts ipmi user and passwd ok!"
 fi
 
-echo "run daisy install command"
-daisy install $cluster_id --skip-pxe-ipmi $skip
-
 echo "check os installing progress..."
 maxcount=180
 count=0
index 2b72cbc..f01aa77 100644 (file)
@@ -87,7 +87,9 @@ def prepare_install():
             add_hosts_interface(cluster_id, hosts_info, hosts_name,
                                 host_interface_map, vip)
             if 'env' in conf and conf['env'] == 0:
-                build_pxe_for_os(cluster_id)
+                build_pxe_without_ipmi(cluster_id)
+            else:
+                build_pxe_with_ipmi(cluster_id)
     except Exception:
         print("Deploy failed!!!.%s." % traceback.format_exc())
     else:
@@ -100,12 +102,18 @@ def build_pxe_for_discover(cluster_id):
     client.install.install(**cluster_meta)
 
 
-def build_pxe_for_os(cluster_id):
+def build_pxe_without_ipmi(cluster_id):
     cluster_meta = {'cluster_id': cluster_id,
                     'pxe_only': "true"}
     client.install.install(**cluster_meta)
 
 
+def build_pxe_with_ipmi(cluster_id):
+    cluster_meta = {'cluster_id': cluster_id,
+                    'pxe_only': "false"}
+    client.install.install(**cluster_meta)
+
+
 def discover_host(hosts_name):
     while True:
         hosts_info = get_hosts()