From 48ec887dcf6d7e37d2bebece3bda357a7752dec2 Mon Sep 17 00:00:00 2001 From: zhouya Date: Mon, 31 Jul 2017 16:05:41 +0800 Subject: use template to replace duplicate xml file Change-Id: I9764612171ef3bf2cdfc652420a2b162fcbfab43 Signed-off-by: zhouya --- ci/deploy/deploy.sh | 9 +- templates/virtual_environment/vms/computer.xml | 12 +- templates/virtual_environment/vms/computer01.xml | 136 --------------------- templates/virtual_environment/vms/computer02.xml | 136 --------------------- templates/virtual_environment/vms/computer03.xml | 132 -------------------- templates/virtual_environment/vms/computer04.xml | 132 -------------------- templates/virtual_environment/vms/controller.xml | 12 +- templates/virtual_environment/vms/controller01.xml | 136 --------------------- templates/virtual_environment/vms/controller02.xml | 136 --------------------- templates/virtual_environment/vms/controller03.xml | 136 --------------------- 10 files changed, 28 insertions(+), 949 deletions(-) delete mode 100644 templates/virtual_environment/vms/computer01.xml delete mode 100644 templates/virtual_environment/vms/computer02.xml delete mode 100644 templates/virtual_environment/vms/computer03.xml delete mode 100644 templates/virtual_environment/vms/computer04.xml delete mode 100644 templates/virtual_environment/vms/controller01.xml delete mode 100644 templates/virtual_environment/vms/controller02.xml delete mode 100644 templates/virtual_environment/vms/controller03.xml diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh index 0abc4e25..f8250c26 100755 --- a/ci/deploy/deploy.sh +++ b/ci/deploy/deploy.sh @@ -157,8 +157,15 @@ 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 +for ((i=0; i < ${#VM_MULTINODE[@]}; i++)); do + if [[ ${VM_MULTINODE[$i]} == *controller* ]]; then + nodename_prefix="controller" + else + nodename_prefix="computer" + fi VMDEPLOY_NODE[$i]=$WORKSPACE/templates/virtual_environment/vms/${VM_MULTINODE[$i]}.xml + cp $WORKSPACE/templates/virtual_environment/vms/${nodename_prefix}.xml ${VMDEPLOY_NODE[$i]} + sed -i "s/nodename/${VM_MULTINODE[$i]}/g" ${VMDEPLOY_NODE[$i]} echo ${VMDEPLOY_NODE[$i]} done diff --git a/templates/virtual_environment/vms/computer.xml b/templates/virtual_environment/vms/computer.xml index 0add4367..d3c974ed 100644 --- a/templates/virtual_environment/vms/computer.xml +++ b/templates/virtual_environment/vms/computer.xml @@ -1,5 +1,5 @@ - computer + nodename 8388608 8388608 4 @@ -32,12 +32,20 @@ /usr/libexec/qemu-kvm - +
+ + + + + + +
+
diff --git a/templates/virtual_environment/vms/computer01.xml b/templates/virtual_environment/vms/computer01.xml deleted file mode 100644 index 5f7f88ba..00000000 --- a/templates/virtual_environment/vms/computer01.xml +++ /dev/null @@ -1,136 +0,0 @@ - - computer01 - 8388608 - 8388608 - 4 - - /machine - - - hvm - - - - - - - - - - - - - - destroy - restart - restart - - - - - - /usr/libexec/qemu-kvm - - - - - - -
- - - - - - - -
- - - -
- - - - -
- - - - -
- - - - -
- - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
- -