From c2a1cc2930be76efe92aad1831b1d8ca47b396e5 Mon Sep 17 00:00:00 2001 From: Abraham Arce Date: Wed, 31 Oct 2018 05:00:27 -0600 Subject: [PATCH] All In One Configurations All In One can be configured as: - Simplex - Duplex Story: 2004780 Task: 28996 Change-Id: I8a1ec35a525babdc44fe0df65fa58d49257d83f4 Signed-off-by: Abraham Arce --- deployment/README.rst | 34 ++------------------- deployment/libvirt/README.rst | 7 +++-- deployment/libvirt/destroy_configuration.sh | 2 +- deployment/libvirt/functions.sh | 18 +++++------ deployment/libvirt/setup_configuration.sh | 2 +- 5 files changed, 18 insertions(+), 45 deletions(-) diff --git a/deployment/README.rst b/deployment/README.rst index 9bcb7a14..50f22eb4 100644 --- a/deployment/README.rst +++ b/deployment/README.rst @@ -71,33 +71,6 @@ are: - VirtualBox - Libvirt/QEMU -Directory Structure -------------------- - -Deployment directory hosts a total of 3 directories and 18 files:: - - $ tree -L 3 deployment/ - deployment/ - ├── libvirt - │   ├── compute.xml - │   ├── controller_allinone.xml - │   ├── controller.xml - │   ├── destroy_allinone.sh - │   ├── destroy_standard_controller.sh - │   ├── install_packages.sh - │   ├── setup_allinone.sh - │   └── setup_standard_controller.sh - ├── provision - │   ├── simplex_stage_1.sh - │   └── simplex_stage_2.sh - └── virtualbox - ├── all_in_one.conf - ├── serial_vm.sh - ├── setup_vm.sh - ├── standard_controller.conf - ├── start_vm.sh - └── stop_vm.sh - Directory: libvirt ~~~~~~~~~~~~~~~~~~ @@ -111,12 +84,11 @@ identity: These nodes are used to create the virtual machines and the network interfaces to setup the StarlingX system: -- Setup All-in-one - +- Setup Simplex + - 1 Controller +- Setup Duplex - 2 Controllers - - Setup Standard Controller - - 2 Controllers - 2 Computes diff --git a/deployment/libvirt/README.rst b/deployment/libvirt/README.rst index a2004777..92399c24 100644 --- a/deployment/libvirt/README.rst +++ b/deployment/libvirt/README.rst @@ -48,14 +48,15 @@ Controllers There is one script for creating the controllers: ``setup_configuration.sh``. It builds different StarlingX cloud configurations: -- allinone +- simplex +- duplex - 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:: - ./setup_configuration.sh -c allinone -i stx-2018-08-28-93.iso + ./setup_configuration.sh -c simplex -i stx-2018-08-28-93.iso 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 @@ -69,4 +70,4 @@ Continue the usual StarlingX installation from this point forward. Tear down the VMs giving the configuration name with the ``-c`` option:: ->-------./destroy_configuration.sh -c allinone +>-------./destroy_configuration.sh -c simplex diff --git a/deployment/libvirt/destroy_configuration.sh b/deployment/libvirt/destroy_configuration.sh index 1e071f2a..5b9ec6e3 100755 --- a/deployment/libvirt/destroy_configuration.sh +++ b/deployment/libvirt/destroy_configuration.sh @@ -24,7 +24,7 @@ fi configuration_check ${CONFIGURATION} -CONFIGURATION=${CONFIGURATION:-allinone} +CONFIGURATION=${CONFIGURATION:-simplex} CONTROLLER=${CONTROLLER:-controller} DOMAIN_DIRECTORY=vms diff --git a/deployment/libvirt/functions.sh b/deployment/libvirt/functions.sh index d7ff03a9..0c875199 100644 --- a/deployment/libvirt/functions.sh +++ b/deployment/libvirt/functions.sh @@ -4,7 +4,7 @@ usage() { echo "$0 [-h] [-c ] [-i ]" echo "" echo "Options:" - echo " -c: Configuration: allinone, standardcontroller" + echo " -c: Configuration: simplex, duplex, standardcontroller" echo " -i: StarlingX ISO image" echo "" } @@ -13,7 +13,7 @@ usage_destroy() { echo "$0 [-h] [-c ]" echo "" echo "Options:" - echo " -c: Configuration: allinone, standardcontroller" + echo " -c: Configuration: simplex, duplex, standardcontroller" echo "" } @@ -28,9 +28,9 @@ iso_image_check() { configuration_check() { local CONFIGURATION=$1 - if [ $CONFIGURATION != "allinone" ] && [ $CONFIGURATION != "standardcontroller" ]; then + if [ $CONFIGURATION != "simplex" ] && [ $CONFIGURATION != "duplex" ] && [ $CONFIGURATION != "standardcontroller" ]; then echo "Please check your configuration name, available configurations:" - echo "allinone, standardcontroller" + echo "simplex, duplex, standardcontroller" exit 1 fi } @@ -78,7 +78,7 @@ create_controller() { local BRIDGE_INTERFACE=$3 local ISOIMAGE=$4 local DOMAIN_FILE - if ([ "$CONFIGURATION" == "allinone" ]); then + if ([ "$CONFIGURATION" == "simplex" ]); then CONTROLLER_NODE_NUMBER=0 else CONTROLLER_NODE_NUMBER=1 @@ -86,7 +86,7 @@ create_controller() { for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i} DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml - if ([ "$CONFIGURATION" == "allinone" ]); then + if ([ "$CONFIGURATION" == "simplex" ] || [ "$CONFIGURATION" == "duplex" ]); then DISK_0_SIZE=600 cp controller_allinone.xml ${DOMAIN_FILE} else @@ -104,7 +104,7 @@ create_controller() { " ${DOMAIN_FILE} sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img ${DISK_0_SIZE}G sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img 200G - if ([ "$CONFIGURATION" == "allinone" ]); then + if ([ "$CONFIGURATION" == "simplex" ] || [ "$CONFIGURATION" == "duplex" ]); then sed -i -e " s,DISK2,/var/lib/libvirt/images/${CONTROLLER_NODE}-2.img, " ${DOMAIN_FILE} @@ -126,7 +126,7 @@ create_controller() { destroy_controller() { local CONFIGURATION=$1 local CONTROLLER=$2 - if ([ "$CONFIGURATION" == "allinone" ]); then + if ([ "$CONFIGURATION" == "simplex" ]); then CONTROLLER_NODE_NUMBER=0 else CONTROLLER_NODE_NUMBER=1 @@ -143,7 +143,7 @@ destroy_controller() { sudo virsh undefine ${CONTROLLER_NODE} delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img - if ([ "$CONFIGURATION" == "allinone" ]); then + if ([ "$CONFIGURATION" == "simplex" ] || [ "$CONFIGURATION" == "duplex" ]); then delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-2.img fi [ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE} diff --git a/deployment/libvirt/setup_configuration.sh b/deployment/libvirt/setup_configuration.sh index 62bfbc95..4c6f44a3 100755 --- a/deployment/libvirt/setup_configuration.sh +++ b/deployment/libvirt/setup_configuration.sh @@ -27,7 +27,7 @@ fi iso_image_check ${ISOIMAGE} configuration_check ${CONFIGURATION} -CONFIGURATION=${CONFIGURATION:-allinone} +CONFIGURATION=${CONFIGURATION:-simplex} BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr} CONTROLLER=${CONTROLLER:-controller} COMPUTE=${COMPUTE:-compute}