diff options
author | Zhijiang Hu <hu.zhijiang@zte.com.cn> | 2017-04-14 05:47:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-04-14 05:47:21 +0000 |
commit | a6b5bc153f14a3f1d10733fe7fb4bf457d0ecf5f (patch) | |
tree | 85818ae1880ee1be0d58f3e74b063b8979fc1c79 /ci | |
parent | 48883a8295c57a028ea1fe81ce14dfd7058840d1 (diff) | |
parent | 32028d091e6832704115f3ffa0013783feb6c48e (diff) |
Merge "support mutinode deploy in vm deployment env"
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/deploy/deploy.sh | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh index 4ec2c2f7..eba6b581 100755 --- a/ci/deploy/deploy.sh +++ b/ci/deploy/deploy.sh @@ -69,6 +69,7 @@ POD_NAME='' TARGET_HOSTS_NUM=0 DRY_RUN=0 IS_BARE=1 +VM_MULTINODE=("computer01" "computer02" "controller01" "controller02" "controller03") # # END of variables to customize ############################################################################ @@ -153,6 +154,11 @@ VMDEPLOY_TARGET_NODE_NET=$WORKSPACE/templates/virtual_environment/networks/os-al VMDEPLOY_DAISY_SERVER_VM=$WORKSPACE/templates/virtual_environment/vms/daisy.xml VMDEPLOY_TARGET_NODE_VM=$WORKSPACE/templates/virtual_environment/vms/all_in_one.xml +VMDEPLOY_NODE=[] +for ((i=0;i<${#VM_MULTINODE[@]};i++));do + VMDEPLOY_NODE[$i]=$WORKSPACE/templates/virtual_environment/vms/${VM_MULTINODE[$i]}.xml + echo ${VMDEPLOY_NODE[$i]} +done BMDEPLOY_DAISY_SERVER_NET=$WORKSPACE/templates/physical_environment/networks/daisy.xml BMDEPLOY_DAISY_SERVER_VM=$WORKSPACE/templates/physical_environment/vms/daisy.xml @@ -253,6 +259,10 @@ function clean_up echo "=====clean up all node and network======" if [ $IS_BARE == 0 ];then clean_up all_in_one daisy2 + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + virsh destroy ${VM_MULTINODE[$i]} + virsh undefine ${VM_MULTINODE[$i]} + done clean_up daisy daisy1 else virsh destroy daisy @@ -305,8 +315,19 @@ ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA -- echo "=====create and find node======" if [ $IS_BARE == 0 ];then - qemu-img create -f qcow2 ${VM_STORAGE}/all_in_one.qcow2 200G - create_node $VMDEPLOY_TARGET_NODE_NET daisy2 $VMDEPLOY_TARGET_NODE_VM all_in_one + if [ $TARGET_HOSTS_NUM == 1 ];then + qemu-img create -f qcow2 ${VM_STORAGE}/all_in_one.qcow2 200G + create_node $VMDEPLOY_TARGET_NODE_NET daisy2 $VMDEPLOY_TARGET_NODE_VM all_in_one + else + virsh net-define $VMDEPLOY_TARGET_NODE_NET + virsh net-autostart daisy2 + virsh net-start daisy2 + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + qemu-img create -f qcow2 ${VM_STORAGE}/${VM_MULTINODE[$i]}.qcow2 200G + virsh define ${VMDEPLOY_NODE[$i]} + virsh start ${VM_MULTINODE[$i]} + done + fi sleep 20 else for i in $(seq 106 110); do @@ -320,8 +341,15 @@ ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA - echo "======daisy virtual-deploy os and openstack===========" if [ $IS_BARE == 0 ];then - virsh destroy all_in_one - virsh start all_in_one + if [ $TARGET_HOSTS_NUM == 1 ];then + virsh destroy all_in_one + virsh start all_in_one + else + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + virsh destroy ${VM_MULTINODE[$i]} + virsh start ${VM_MULTINODE[$i]} + done + fi sleep 20 ssh $SSH_PARAS $DAISY_IP "python ${REMOTE_SPACE}/deploy/tempest.py --dha $DHA --network $NETWORK --install 'yes'" fi @@ -334,7 +362,13 @@ fi sleep 10 if [ $IS_BARE == 0 ];then - virsh reboot all_in_one + if [ $TARGET_HOSTS_NUM == 1 ];then + virsh reboot all_in_one + else + for ((i=0;i<${#VM_MULTINODE[@]};i++));do + virsh reboot ${VM_MULTINODE[$i]} + done + fi fi ssh $SSH_PARAS $DAISY_IP "${REMOTE_SPACE}/deploy/check_openstack_progress.sh -n $TARGET_HOSTS_NUM" if [ $? -ne 0 ]; then |