[Doc] Check and Include Configuration Names
In preparation to support more configurations, use existing allinone and standardcontroller configurations names to: - check if configuration is available via a function before it is created. - to identify what configuration the compute node belongs to. Additional: - Fix linters issues Story: 2004780 Task: 28996 Change-Id: I94ca268760c2cf12072de676dbd19413ef96a1ab Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
This commit is contained in:
parent
716b8f57ef
commit
5e2573703b
@ -22,6 +22,8 @@ if [[ -z ${CONFIGURATION} ]]; then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
configuration_check ${CONFIGURATION}
|
||||
|
||||
CONFIGURATION=${CONFIGURATION:-allinone}
|
||||
CONTROLLER=${CONTROLLER:-controller}
|
||||
DOMAIN_DIRECTORY=vms
|
||||
@ -32,7 +34,7 @@ if ([ "$CONFIGURATION" == "standardcontroller" ]); then
|
||||
COMPUTE=${COMPUTE:-compute}
|
||||
COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
|
||||
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
||||
COMPUTE_NODE=${COMPUTE}-${i}
|
||||
COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
|
||||
destroy_compute $COMPUTE_NODE
|
||||
done
|
||||
fi
|
||||
|
@ -26,6 +26,15 @@ iso_image_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
configuration_check() {
|
||||
local CONFIGURATION=$1
|
||||
if [ $CONFIGURATION != "allinone" ] && [ $CONFIGURATION != "standardcontroller" ]; then
|
||||
echo "Please check your configuration name, available configurations:"
|
||||
echo "allinone, standardcontroller"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# delete a node's disk file in a safe way
|
||||
delete_disk() {
|
||||
local fpath="$1"
|
||||
@ -75,7 +84,7 @@ create_controller() {
|
||||
CONTROLLER_NODE_NUMBER=1
|
||||
fi
|
||||
for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
|
||||
CONTROLLER_NODE=${CONTROLLER}-${i}
|
||||
CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
|
||||
DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml
|
||||
if ([ "$CONFIGURATION" == "allinone" ]); then
|
||||
DISK_0_SIZE=600
|
||||
@ -123,7 +132,7 @@ destroy_controller() {
|
||||
CONTROLLER_NODE_NUMBER=1
|
||||
fi
|
||||
for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
|
||||
CONTROLLER_NODE=${CONTROLLER}-${i}
|
||||
CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
|
||||
DOMAIN_FILE=$DOMAIN_DIRECTORY/$CONTROLLER_NODE.xml
|
||||
if virsh list --all --name | grep ${CONTROLLER_NODE}; then
|
||||
STATUS=$(virsh list --all | grep ${CONTROLLER_NODE} | awk '{ print $3}')
|
||||
|
@ -25,6 +25,7 @@ if [[ -z ${CONFIGURATION} ]] || [[ -z "${ISOIMAGE}" ]]; then
|
||||
fi
|
||||
|
||||
iso_image_check ${ISOIMAGE}
|
||||
configuration_check ${CONFIGURATION}
|
||||
|
||||
CONFIGURATION=${CONFIGURATION:-allinone}
|
||||
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
|
||||
@ -41,7 +42,7 @@ create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
||||
|
||||
if ([ "$CONFIGURATION" == "standardcontroller" ]); then
|
||||
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
||||
COMPUTE_NODE=${COMPUTE}-${i}
|
||||
COMPUTE_NODE=${CONFIGURATION}-${COMPUTE}-${i}
|
||||
create_compute ${COMPUTE_NODE}
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user