3eb7e6467e
Duplex configuration may include worker nodes, as described in "Deployment Configurations" page of Starlingx docs. Allow the setup_configuration.sh and destroy_configuration.sh to include worker nodes. Test Plan: PASS setup/destroy configurations Story: 2010816 Task: 49219 Change-Id: I276002255f42ca68228d179777e717fc84ea2e9a Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
68 lines
1.5 KiB
Bash
Executable File
68 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Copyright (C) 2019 Intel Corporation
|
|
#
|
|
# Copyright (c) 2023 Wind River Systems, Inc.
|
|
#
|
|
|
|
source set_defaults.sh
|
|
|
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
|
source ${SCRIPT_DIR}/functions.sh
|
|
|
|
while getopts "c:i:" o; do
|
|
case "${o}" in
|
|
c)
|
|
CONFIGURATION="$OPTARG"
|
|
;;
|
|
i)
|
|
ISOIMAGE=$(readlink -f "$OPTARG")
|
|
;;
|
|
*)
|
|
usage
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
shift $((OPTIND-1))
|
|
|
|
if [[ -z ${CONFIGURATION} ]] || [[ -z "${ISOIMAGE}" ]]; then
|
|
usage
|
|
exit -1
|
|
fi
|
|
|
|
iso_image_check ${ISOIMAGE}
|
|
configuration_check ${CONFIGURATION}
|
|
|
|
bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
|
|
|
|
[ ! -d ${DOMAIN_DIRECTORY} ] && mkdir ${DOMAIN_DIRECTORY}
|
|
|
|
create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
WORK_CFGS="duplex controllerstorage dedicatedstorage"
|
|
if [[ " $WORK_CFGS " == *" $CONFIGURATION "* ]]; then
|
|
for ((i=0; i<=$WORKER_NODES_NUMBER; i++)); do
|
|
create_node "worker" ${i} ${CONFIGURATION} ${BRIDGE_INTERFACE}
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if ([ "$CONFIGURATION" == "dedicatedstorage" ]); then
|
|
for ((i=0; i<=$STORAGE_NODES_NUMBER; i++)); do
|
|
create_node "storage" ${i} ${CONFIGURATION} ${BRIDGE_INTERFACE}
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
done
|
|
fi
|
|
|
|
sudo virt-manager
|