diff options
author | zhouya <zhou.ya@zte.com.cn> | 2017-03-14 14:59:35 +0800 |
---|---|---|
committer | zhouya <zhou.ya@zte.com.cn> | 2017-03-14 14:59:35 +0800 |
commit | a46f3e8c4ef7e09deb3d5dc2d1e6969b6375b905 (patch) | |
tree | 9a7a9b2fcc320989a4fb34912d0395d0c785b3ad | |
parent | c557362eb2a14055587feac228a4463bd96f6f4a (diff) |
modify daisy install interface and modify check_openstack_progress targetnode nums
Change-Id: I19f8c18f8b977619c9bbf6f1e80f7c48f8f5db9e
Signed-off-by: zhouya <zhou.ya@zte.com.cn>
-rwxr-xr-x | ci/deploy/deploy.sh | 2 | ||||
-rwxr-xr-x | deploy/check_openstack_progress.sh | 33 | ||||
-rwxr-xr-x | deploy/check_os_progress.sh | 5 | ||||
-rw-r--r-- | deploy/tempest.py | 12 |
4 files changed, 43 insertions, 9 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh index efae8387..3caacde4 100755 --- a/ci/deploy/deploy.sh +++ b/ci/deploy/deploy.sh @@ -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 diff --git a/deploy/check_openstack_progress.sh b/deploy/check_openstack_progress.sh index f4baff1e..3512d6bc 100755 --- a/deploy/check_openstack_progress.sh +++ b/deploy/check_openstack_progress.sh @@ -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 diff --git a/deploy/check_os_progress.sh b/deploy/check_os_progress.sh index f76af9b6..bb2b3340 100755 --- a/deploy/check_os_progress.sh +++ b/deploy/check_os_progress.sh @@ -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 diff --git a/deploy/tempest.py b/deploy/tempest.py index 2b72cbc2..f01aa77b 100644 --- a/deploy/tempest.py +++ b/deploy/tempest.py @@ -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() |