Setup Configurations Clean Up
Combine setup_allinone.sh and setup_standard_controller.sh to have one single setup script to configure via input parameter allinone and standardcontroller configurations: - setup_configuration.sh - destroy_configuration.sh Change-Id: Id29d3eeeff43f0c0f43ab710a1179eaacdfb330d Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>
This commit is contained in:
parent
001bbdbcf6
commit
716b8f57ef
@ -5,8 +5,8 @@ This is a quick reference for deploying StarlingX on libvirt/qemu systems.
|
|||||||
It assumes you have a working libvirt/qemu installation for a non-root user
|
It assumes you have a working libvirt/qemu installation for a non-root user
|
||||||
and that your user has NOPASSWD sudo permissions.
|
and that your user has NOPASSWD sudo permissions.
|
||||||
|
|
||||||
Refer also to pages "Installation Guide Virtual Environment", "Testing Guide"
|
Refer also to pages "Installation Guide" on the StarlingX Documentation:
|
||||||
on the StarlingX wiki: https://wiki.openstack.org/wiki/StarlingX
|
https://docs.starlingx.io/installation_guide/index.html
|
||||||
|
|
||||||
Overview
|
Overview
|
||||||
--------
|
--------
|
||||||
@ -45,16 +45,19 @@ It should also only be used after all of the VMs created below have been destroy
|
|||||||
Controllers
|
Controllers
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
There are two scripts for creating the controllers: ``setup_allinone.sh`` and
|
There is one script for creating the controllers: ``setup_configuration.sh``. It
|
||||||
``setup_standard_controller.sh``. They are operated in the same manner but build
|
builds different StarlingX cloud configurations:
|
||||||
different StarlingX cloud configurations. Choose wisely.
|
|
||||||
|
|
||||||
You need an ISO file for the installation, these scripts take a name with the
|
- allinone
|
||||||
|
- standardcontroller
|
||||||
|
|
||||||
|
You need an StarlingX ISO file for the installation. The script takes the
|
||||||
|
configuration name with the ``-c`` option and the ISO file name with the
|
||||||
``-i`` option::
|
``-i`` option::
|
||||||
|
|
||||||
./setup_allinone.sh -i stx-2018-08-28-93.iso
|
./setup_configuration.sh -c allinone -i stx-2018-08-28-93.iso
|
||||||
|
|
||||||
And the setup will begin. The scripts create one or more VMs and start the boot
|
And the setup will begin. The script create one or more VMs and start the boot
|
||||||
of the first controller, named oddly enough ``controller-0``. If you have Xwindows
|
of the first controller, named oddly enough ``controller-0``. If you have Xwindows
|
||||||
available you will get virt-manager running.
|
available you will get virt-manager running.
|
||||||
If not, Ctrl-C out of that attempt if it doesn't return to a shell prompt.
|
If not, Ctrl-C out of that attempt if it doesn't return to a shell prompt.
|
||||||
@ -64,4 +67,6 @@ Then connect to the serial console::
|
|||||||
|
|
||||||
Continue the usual StarlingX installation from this point forward.
|
Continue the usual StarlingX installation from this point forward.
|
||||||
|
|
||||||
Tear down the VMs using ``destroy_allinone.sh`` and ``destroy_standard_controller.sh``.
|
Tear down the VMs giving the configuration name with the ``-c`` option::
|
||||||
|
|
||||||
|
>-------./destroy_configuration.sh -c allinone
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
|
||||||
|
|
||||||
source ${SCRIPT_DIR}/functions.sh
|
|
||||||
|
|
||||||
CONFIGURATION="allinone"
|
|
||||||
CONTROLLER=${CONTROLLER:-controller}
|
|
||||||
DOMAIN_DIRECTORY=vms
|
|
||||||
|
|
||||||
destroy_controller ${CONFIGURATION} ${CONTROLLER}
|
|
38
libvirt/destroy_configuration.sh
Executable file
38
libvirt/destroy_configuration.sh
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
||||||
|
|
||||||
|
source ${SCRIPT_DIR}/functions.sh
|
||||||
|
|
||||||
|
while getopts "c:" o; do
|
||||||
|
case "${o}" in
|
||||||
|
c)
|
||||||
|
CONFIGURATION=${OPTARG}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage_destroy
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
if [[ -z ${CONFIGURATION} ]]; then
|
||||||
|
usage_destroy
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CONFIGURATION=${CONFIGURATION:-allinone}
|
||||||
|
CONTROLLER=${CONTROLLER:-controller}
|
||||||
|
DOMAIN_DIRECTORY=vms
|
||||||
|
|
||||||
|
destroy_controller ${CONFIGURATION} ${CONTROLLER}
|
||||||
|
|
||||||
|
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}
|
||||||
|
destroy_compute $COMPUTE_NODE
|
||||||
|
done
|
||||||
|
fi
|
@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
|
||||||
|
|
||||||
source ${SCRIPT_DIR}/functions.sh
|
|
||||||
|
|
||||||
CONFIGURATION="standardcontroller"
|
|
||||||
CONTROLLER=${CONTROLLER:-controller}
|
|
||||||
COMPUTE=${COMPUTE:-compute}
|
|
||||||
COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
|
|
||||||
DOMAIN_DIRECTORY=vms
|
|
||||||
|
|
||||||
destroy_controller ${CONFIGURATION} ${CONTROLLER}
|
|
||||||
|
|
||||||
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
|
||||||
COMPUTE_NODE=${COMPUTE}-${i}
|
|
||||||
destroy_compute $COMPUTE_NODE
|
|
||||||
done
|
|
@ -1,13 +1,22 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "$0 [-h] [-i <iso image>]"
|
echo "$0 [-h] [-c <configuration>] [-i <iso image>]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
|
echo " -c: Configuration: allinone, standardcontroller"
|
||||||
echo " -i: StarlingX ISO image"
|
echo " -i: StarlingX ISO image"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usage_destroy() {
|
||||||
|
echo "$0 [-h] [-c <configuration>]"
|
||||||
|
echo ""
|
||||||
|
echo "Options:"
|
||||||
|
echo " -c: Configuration: allinone, standardcontroller"
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
iso_image_check() {
|
iso_image_check() {
|
||||||
local ISOIMAGE=$1
|
local ISOIMAGE=$1
|
||||||
FILETYPE=$(file --mime-type -b ${ISOIMAGE})
|
FILETYPE=$(file --mime-type -b ${ISOIMAGE})
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
|
||||||
source ${SCRIPT_DIR}/functions.sh
|
|
||||||
|
|
||||||
while getopts "i:" o; do
|
|
||||||
case "${o}" in
|
|
||||||
i)
|
|
||||||
ISOIMAGE=$(readlink -f "$OPTARG")
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
shift $((OPTIND-1))
|
|
||||||
|
|
||||||
if [ -z "${ISOIMAGE}" ]; then
|
|
||||||
usage
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
|
|
||||||
iso_image_check ${ISOIMAGE}
|
|
||||||
|
|
||||||
CONFIGURATION="allinone"
|
|
||||||
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
|
|
||||||
CONTROLLER=${CONTROLLER:-controller}
|
|
||||||
DOMAIN_DIRECTORY=vms
|
|
||||||
|
|
||||||
bash ${SCRIPT_DIR}/destroy_allinone.sh
|
|
||||||
|
|
||||||
[ ! -d ${DOMAIN_DIRECTORY} ] && mkdir ${DOMAIN_DIRECTORY}
|
|
||||||
|
|
||||||
create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
|
||||||
|
|
||||||
sudo virt-manager
|
|
@ -3,8 +3,11 @@
|
|||||||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
|
||||||
source ${SCRIPT_DIR}/functions.sh
|
source ${SCRIPT_DIR}/functions.sh
|
||||||
|
|
||||||
while getopts "i:" o; do
|
while getopts "c:i:" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
|
c)
|
||||||
|
CONFIGURATION="$OPTARG"
|
||||||
|
;;
|
||||||
i)
|
i)
|
||||||
ISOIMAGE=$(readlink -f "$OPTARG")
|
ISOIMAGE=$(readlink -f "$OPTARG")
|
||||||
;;
|
;;
|
||||||
@ -16,29 +19,31 @@ while getopts "i:" o; do
|
|||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
if [ -z "${ISOIMAGE}" ]; then
|
if [[ -z ${CONFIGURATION} ]] || [[ -z "${ISOIMAGE}" ]]; then
|
||||||
usage
|
usage
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iso_image_check ${ISOIMAGE}
|
iso_image_check ${ISOIMAGE}
|
||||||
|
|
||||||
CONFIGURATION="standardcontroller"
|
CONFIGURATION=${CONFIGURATION:-allinone}
|
||||||
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
|
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
|
||||||
CONTROLLER=${CONTROLLER:-controller}
|
CONTROLLER=${CONTROLLER:-controller}
|
||||||
COMPUTE=${COMPUTE:-compute}
|
COMPUTE=${COMPUTE:-compute}
|
||||||
COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
|
COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
|
||||||
DOMAIN_DIRECTORY=vms
|
DOMAIN_DIRECTORY=vms
|
||||||
|
|
||||||
bash ${SCRIPT_DIR}/destroy_standard_controller.sh
|
bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
|
||||||
|
|
||||||
[ ! -d ${DOMAIN_DIRECTORY} ] && mkdir ${DOMAIN_DIRECTORY}
|
[ ! -d ${DOMAIN_DIRECTORY} ] && mkdir ${DOMAIN_DIRECTORY}
|
||||||
|
|
||||||
create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
||||||
|
|
||||||
|
if ([ "$CONFIGURATION" == "standardcontroller" ]); then
|
||||||
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
||||||
COMPUTE_NODE=${COMPUTE}-${i}
|
COMPUTE_NODE=${COMPUTE}-${i}
|
||||||
create_compute ${COMPUTE_NODE}
|
create_compute ${COMPUTE_NODE}
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
sudo virt-manager
|
sudo virt-manager
|
Loading…
Reference in New Issue
Block a user