From 2f10f6f34d3497f8592a934cc05178135c7d2e43 Mon Sep 17 00:00:00 2001 From: Abraham Arce Date: Tue, 24 Jul 2018 10:16:37 -0500 Subject: [PATCH] Add virtual environemnt deployment scripts This adds two sets of deployments scripts to aid in setting up virtual environments for testing StarligX, for libvirt/qemu and VirtualBox. This is the first exposure of an internal project and is not fully error-proofed, it should be examined carefully to understand what the scripts will do to your system before running them. The first set of fixes for this to make it less instrusive and work in a shared server follow in https://review.openstack.org/#/c/597643. There are also a couple of bashate errors fixed since that is now a voting job... [NOTE(dtroyer): I converted the original commit message into a README because that's information that needs to be with the scripts.] Needed-by: https://review.openstack.org/#/c/597643 Change-Id: I0a6a148720b7a239380fd48f7ffdab272472e664 Co-authored-by: Lianhao Lu Co-authored-by: Brian Avery Co-authored-by: Nakul Dahiwade Co-authored-by: Yan Chen Co-authored-by: Ruijing Guo Co-authored-by: Shuicheng Lin Co-authored-by: Felipe de Jesus Ruiz Garcia Co-authored-by: Jose Perez Carranza Co-authored-by: Eddie Ramirez Co-authored-by: Kailun Qin Co-authored-by: Forrest Zhao Co-authored-by: Kailun Qin Signed-off-by: Abraham Arce Signed-off-by: Dean Troyer --- centos-mirror-tools/dl_rpms.sh | 7 +- deployment/README.rst | 141 ++++++++++++++++ deployment/libvirt/compute.xml | 115 +++++++++++++ deployment/libvirt/controller.xml | 130 ++++++++++++++ deployment/libvirt/controller_allinone.xml | 130 ++++++++++++++ deployment/libvirt/destroy_allinone.sh | 29 ++++ .../libvirt/destroy_standard_controller.sh | 46 +++++ deployment/libvirt/install_packages.sh | 24 +++ deployment/libvirt/setup_allinone.sh | 78 +++++++++ .../libvirt/setup_standard_controller.sh | 93 +++++++++++ deployment/provision/simplex_stage_1.sh | 121 ++++++++++++++ deployment/provision/simplex_stage_2.sh | 56 +++++++ deployment/virtualbox/all_in_one.conf | 26 +++ deployment/virtualbox/serial_vm.sh | 3 + deployment/virtualbox/setup_vm.sh | 158 ++++++++++++++++++ .../virtualbox/standard_controller.conf | 20 +++ deployment/virtualbox/start_vm.sh | 19 +++ deployment/virtualbox/stop_vm.sh | 5 + tox.ini | 5 +- 19 files changed, 1203 insertions(+), 3 deletions(-) create mode 100644 deployment/README.rst create mode 100644 deployment/libvirt/compute.xml create mode 100644 deployment/libvirt/controller.xml create mode 100644 deployment/libvirt/controller_allinone.xml create mode 100755 deployment/libvirt/destroy_allinone.sh create mode 100755 deployment/libvirt/destroy_standard_controller.sh create mode 100755 deployment/libvirt/install_packages.sh create mode 100755 deployment/libvirt/setup_allinone.sh create mode 100755 deployment/libvirt/setup_standard_controller.sh create mode 100755 deployment/provision/simplex_stage_1.sh create mode 100755 deployment/provision/simplex_stage_2.sh create mode 100644 deployment/virtualbox/all_in_one.conf create mode 100755 deployment/virtualbox/serial_vm.sh create mode 100755 deployment/virtualbox/setup_vm.sh create mode 100644 deployment/virtualbox/standard_controller.conf create mode 100755 deployment/virtualbox/start_vm.sh create mode 100755 deployment/virtualbox/stop_vm.sh diff --git a/centos-mirror-tools/dl_rpms.sh b/centos-mirror-tools/dl_rpms.sh index 327f2143..e4784fdd 100755 --- a/centos-mirror-tools/dl_rpms.sh +++ b/centos-mirror-tools/dl_rpms.sh @@ -180,8 +180,8 @@ download () { local _file=$1 local _level=$2 - local _list=$(cat $_file) - local _from=$(get_from $_file) + local _list + local _from local _type="" local rc=0 @@ -191,6 +191,9 @@ download () { local rpm_url="" local SFILE="" + _list=$(cat $_file) + _from=$(get_from $_file) + echo "now the rpm will come from: $_from" for ff in $_list; do download_cmd="" diff --git a/deployment/README.rst b/deployment/README.rst new file mode 100644 index 00000000..9bcb7a14 --- /dev/null +++ b/deployment/README.rst @@ -0,0 +1,141 @@ +StarlingX Deployment in Virtualized Environments +================================================ + +A StarlingX system can be installed in a variety of platforms with the following +deployment options: + +- Standard Controller + + - Dedicated Storage + - Controller Storage + +- All-in-one + + - Duplex + - Simplex + +Deployment options uses a variety of configurations based on 3 node identities: + +- Controller +- Storage +- Compute + +Standard Controller :: Dedicated Storage +---------------------------------------- + +The software installation workflow for an initial Ceph-backed block +storage on dedicated storage nodes is: + +- Controller-0 Installation and Provisioning +- Controller-1 / Compute Host / Storage Host Installation +- Controller-1 Provisioning +- Provider Network Configuration +- Compute Host Provisioning +- Storage Host Provisioning + +Standard Controller :: Controller Storage +----------------------------------------- + +The software installation workflow for an initial LVM-backed block +storage on controller nodes is: + +- Controller-0 Installation +- Controller-0 and System Provisioning +- Controller-1 / Compute Host Installation +- Controller-1 Provisioning +- Compute Host Provisioning + +All-in-one :: Duplex +-------------------- + +The software installation workflow for two combined controller / compute +nodes is: + +- Controller-0 Installation and Provisioning +- Controller-1 Installation and Provisioning + +All-in-one :: Simplex +--------------------- + +The software installation workflow for a single combined controller / compute +node is: + +- Controller-0 Installation and Provisioning + +Virtualization Environments +--------------------------- + +The available virtualization products where StarlingX has been deployed +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 +~~~~~~~~~~~~~~~~~~ + +Deployment under Libvirt/QEMU uses a set of xml files to define the node +identity: + +- Controller All-in-one +- Controller +- Compute + +These nodes are used to create the virtual machines and the network interfaces +to setup the StarlingX system: + +- Setup All-in-one + + - 2 Controllers + +- Setup Standard Controller + + - 2 Controllers + - 2 Computes + +Directory: virtualbox +~~~~~~~~~~~~~~~~~~~~~ + +Deployment under VirtualBox uses a set of configuration files to define the +StarlingX system: + +- All-in-one Configuration +- Standard Controller Configuration + +These configurations files are used to create the virtual machines and the +network interfaces from a single script: + +- Setup VM + +Directory: provision +~~~~~~~~~~~~~~~~~~~~ + +A set of scripts are provided to automate the provisioning of data interfaces and +local storage resources for the compute function for StarlingX Duplex or Simplex. diff --git a/deployment/libvirt/compute.xml b/deployment/libvirt/compute.xml new file mode 100644 index 00000000..9e7c699a --- /dev/null +++ b/deployment/libvirt/compute.xml @@ -0,0 +1,115 @@ + + NAME + 16777216 + 16777216 + 4 + + /machine + + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + +
+ + + + + + + +
+ + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + +