Browse Source

Merge "[Doc] Check and Include Configuration Names"

Zuul 2 months ago
parent
commit
b2cb51b295

+ 3
- 1
deployment/libvirt/destroy_configuration.sh View File

@@ -22,6 +22,8 @@ if [[ -z ${CONFIGURATION} ]]; then
22 22
     exit -1
23 23
 fi
24 24
 
25
+configuration_check ${CONFIGURATION}
26
+
25 27
 CONFIGURATION=${CONFIGURATION:-allinone}
26 28
 CONTROLLER=${CONTROLLER:-controller}
27 29
 DOMAIN_DIRECTORY=vms
@@ -32,7 +34,7 @@ if ([ "$CONFIGURATION" == "standardcontroller" ]); then
32 34
     COMPUTE=${COMPUTE:-compute}
33 35
     COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
34 36
     for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
35
-        COMPUTE_NODE=${COMPUTE}-${i}
37
+        COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
36 38
         destroy_compute $COMPUTE_NODE
37 39
     done
38 40
 fi

+ 11
- 2
deployment/libvirt/functions.sh View File

@@ -25,6 +25,15 @@ iso_image_check() {
25 25
     fi
26 26
 }
27 27
 
28
+configuration_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 37
 # delete a node's disk file in a safe way
29 38
 delete_disk() {
30 39
     local fpath="$1"
@@ -74,7 +83,7 @@ create_controller() {
74 83
         CONTROLLER_NODE_NUMBER=1
75 84
     fi
76 85
     for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
77
-        CONTROLLER_NODE=${CONTROLLER}-${i}
86
+        CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
78 87
         DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml
79 88
         if ([ "$CONFIGURATION" == "allinone" ]); then
80 89
             DISK_0_SIZE=600
@@ -122,7 +131,7 @@ destroy_controller() {
122 131
         CONTROLLER_NODE_NUMBER=1
123 132
     fi
124 133
     for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
125
-        CONTROLLER_NODE=${CONTROLLER}-${i}
134
+        CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
126 135
         DOMAIN_FILE=$DOMAIN_DIRECTORY/$CONTROLLER_NODE.xml
127 136
         if virsh list --all --name | grep ${CONTROLLER_NODE}; then
128 137
             STATUS=$(virsh list --all | grep ${CONTROLLER_NODE} | awk '{ print $3}')

+ 2
- 1
deployment/libvirt/setup_configuration.sh View File

@@ -25,6 +25,7 @@ if [[ -z ${CONFIGURATION} ]] || [[ -z "${ISOIMAGE}" ]]; then
25 25
 fi
26 26
 
27 27
 iso_image_check ${ISOIMAGE}
28
+configuration_check ${CONFIGURATION}
28 29
 
29 30
 CONFIGURATION=${CONFIGURATION:-allinone}
30 31
 BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
@@ -41,7 +42,7 @@ create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
41 42
 
42 43
 if ([ "$CONFIGURATION" == "standardcontroller" ]); then
43 44
     for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
44
-        COMPUTE_NODE=${COMPUTE}-${i}
45
+        COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
45 46
         create_compute ${COMPUTE_NODE}
46 47
     done
47 48
 fi

Loading…
Cancel
Save