summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-28 22:07:45 +0000
committerGerrit Code Review <review@openstack.org>2019-01-28 22:07:45 +0000
commitb2cb51b2955f9c6cd1e4ca2cb3060659dce675c9 (patch)
treecead1542f89bb1e1ce4facb06e4d2bd436a7b35a
parent60cbbf508c008e882cffa53586ae0b68b6119037 (diff)
parentce407f198e96b1e90c77f00c4a4b4004ae825187 (diff)
Merge "[Doc] Check and Include Configuration Names"
-rwxr-xr-xdeployment/libvirt/destroy_configuration.sh4
-rw-r--r--deployment/libvirt/functions.sh13
-rwxr-xr-xdeployment/libvirt/setup_configuration.sh3
3 files changed, 16 insertions, 4 deletions
diff --git a/deployment/libvirt/destroy_configuration.sh b/deployment/libvirt/destroy_configuration.sh
index 8d4d329..1e071f2 100755
--- a/deployment/libvirt/destroy_configuration.sh
+++ b/deployment/libvirt/destroy_configuration.sh
@@ -22,6 +22,8 @@ if [[ -z ${CONFIGURATION} ]]; then
22 exit -1 22 exit -1
23fi 23fi
24 24
25configuration_check ${CONFIGURATION}
26
25CONFIGURATION=${CONFIGURATION:-allinone} 27CONFIGURATION=${CONFIGURATION:-allinone}
26CONTROLLER=${CONTROLLER:-controller} 28CONTROLLER=${CONTROLLER:-controller}
27DOMAIN_DIRECTORY=vms 29DOMAIN_DIRECTORY=vms
@@ -32,7 +34,7 @@ if ([ "$CONFIGURATION" == "standardcontroller" ]); then
32 COMPUTE=${COMPUTE:-compute} 34 COMPUTE=${COMPUTE:-compute}
33 COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1} 35 COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
34 for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do 36 for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
35 COMPUTE_NODE=${COMPUTE}-${i} 37 COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
36 destroy_compute $COMPUTE_NODE 38 destroy_compute $COMPUTE_NODE
37 done 39 done
38fi 40fi
diff --git a/deployment/libvirt/functions.sh b/deployment/libvirt/functions.sh
index e0efe36..e4d085c 100644
--- a/deployment/libvirt/functions.sh
+++ b/deployment/libvirt/functions.sh
@@ -25,6 +25,15 @@ iso_image_check() {
25 fi 25 fi
26} 26}
27 27
28configuration_check() {
29 local CONFIGURATION=$1
30 if [ $CONFIGURATION != "allinone" ] && [ $CONFIGURATION != "standardcontroller" ]; then
31 echo "Please check your configuration name, available configurations:"
32 echo "allinone, standardcontroller"
33 exit 1
34 fi
35}
36
28# delete a node's disk file in a safe way 37# delete a node's disk file in a safe way
29delete_disk() { 38delete_disk() {
30 local fpath="$1" 39 local fpath="$1"
@@ -74,7 +83,7 @@ create_controller() {
74 CONTROLLER_NODE_NUMBER=1 83 CONTROLLER_NODE_NUMBER=1
75 fi 84 fi
76 for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do 85 for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
77 CONTROLLER_NODE=${CONTROLLER}-${i} 86 CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
78 DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml 87 DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml
79 if ([ "$CONFIGURATION" == "allinone" ]); then 88 if ([ "$CONFIGURATION" == "allinone" ]); then
80 DISK_0_SIZE=600 89 DISK_0_SIZE=600
@@ -122,7 +131,7 @@ destroy_controller() {
122 CONTROLLER_NODE_NUMBER=1 131 CONTROLLER_NODE_NUMBER=1
123 fi 132 fi
124 for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do 133 for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
125 CONTROLLER_NODE=${CONTROLLER}-${i} 134 CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
126 DOMAIN_FILE=$DOMAIN_DIRECTORY/$CONTROLLER_NODE.xml 135 DOMAIN_FILE=$DOMAIN_DIRECTORY/$CONTROLLER_NODE.xml
127 if virsh list --all --name | grep ${CONTROLLER_NODE}; then 136 if virsh list --all --name | grep ${CONTROLLER_NODE}; then
128 STATUS=$(virsh list --all | grep ${CONTROLLER_NODE} | awk '{ print $3}') 137 STATUS=$(virsh list --all | grep ${CONTROLLER_NODE} | awk '{ print $3}')
diff --git a/deployment/libvirt/setup_configuration.sh b/deployment/libvirt/setup_configuration.sh
index 3b17ace..62bfbc9 100755
--- a/deployment/libvirt/setup_configuration.sh
+++ b/deployment/libvirt/setup_configuration.sh
@@ -25,6 +25,7 @@ if [[ -z ${CONFIGURATION} ]] || [[ -z "${ISOIMAGE}" ]]; then
25fi 25fi
26 26
27iso_image_check ${ISOIMAGE} 27iso_image_check ${ISOIMAGE}
28configuration_check ${CONFIGURATION}
28 29
29CONFIGURATION=${CONFIGURATION:-allinone} 30CONFIGURATION=${CONFIGURATION:-allinone}
30BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr} 31BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
@@ -41,7 +42,7 @@ create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
41 42
42if ([ "$CONFIGURATION" == "standardcontroller" ]); then 43if ([ "$CONFIGURATION" == "standardcontroller" ]); then
43 for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do 44 for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
44 COMPUTE_NODE=${COMPUTE}-${i} 45 COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
45 create_compute ${COMPUTE_NODE} 46 create_compute ${COMPUTE_NODE}
46 done 47 done
47fi 48fi