From 1d715c681a1216b7b91f05a779df6e34b2179cef Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Mon, 27 Mar 2017 10:29:01 +0200 Subject: xci: Enable node provisioning and shuffle/rename stuff This change enables node provisioning using bifrost based on the chosen flavor. Other changes include - move flavor specific stuff (playbooks, inventory, vars) into their own folders so it is easier to copy them over. - rename flavors and get rid of xci from them. - introduce env-vars to keep variables that are not really user variables. Please note that this patch contains empty files and so on due to still trying to find best way to structurei things. Apart from this, there will probably be lots of duplications here and there which will be taken care of once things settle. Change-Id: I04a5d422e5b018439bafea5e68e65255ae38d22b Signed-off-by: Fatih Degirmenci --- prototypes/xci/config/env-vars | 12 +++++ prototypes/xci/config/pinned-versions | 8 +-- prototypes/xci/config/user-vars | 40 +++++++------- .../xci/file/aio/playbooks/configure-xcihost.yml | 0 prototypes/xci/file/aio/playbooks/inventory | 2 + prototypes/xci/file/aio/var/ubuntu.yml | 7 +++ prototypes/xci/file/configure-xci-aio.yml | 0 prototypes/xci/file/configure-xci-ha.yml | 0 prototypes/xci/file/configure-xci-mini.yml | 0 prototypes/xci/file/configure-xci-noha.yml | 0 prototypes/xci/file/ha/configure-targethosts.yml | 0 .../xci/file/ha/playbooks/configure-xcihost.yml | 0 prototypes/xci/file/ha/playbooks/inventory | 0 prototypes/xci/file/ha/var/ubuntu.yml | 0 prototypes/xci/file/mini/configure-targethosts.yml | 0 .../xci/file/mini/playbooks/configure-xcihost.yml | 0 prototypes/xci/file/mini/playbooks/inventory | 0 prototypes/xci/file/mini/var/ubuntu.yml | 0 prototypes/xci/file/noha/configure-targethosts.yml | 0 .../xci/file/noha/playbooks/configure-xcihost.yml | 0 prototypes/xci/file/noha/playbooks/inventory | 0 prototypes/xci/file/noha/var/ubuntu.yml | 0 prototypes/xci/file/xci-aio-inventory | 0 prototypes/xci/file/xci-aio-vars.yml | 0 prototypes/xci/file/xci-ha-inventory | 0 prototypes/xci/file/xci-ha-vars.yml | 0 prototypes/xci/file/xci-mini-inventory | 0 prototypes/xci/file/xci-mini-vars.yml | 0 prototypes/xci/file/xci-noha-inventory | 0 prototypes/xci/file/xci-noha-vars.yml | 0 prototypes/xci/flavors/aio | 18 +++++++ prototypes/xci/flavors/ha | 18 +++++++ prototypes/xci/flavors/mini | 18 +++++++ prototypes/xci/flavors/noha | 18 +++++++ prototypes/xci/flavors/xci-aio.sh | 27 ---------- prototypes/xci/flavors/xci-ha.sh | 27 ---------- prototypes/xci/flavors/xci-mini.sh | 27 ---------- prototypes/xci/flavors/xci-noha.sh | 27 ---------- prototypes/xci/xci-deploy.sh | 61 +++++++++++++++++++++- 39 files changed, 177 insertions(+), 133 deletions(-) create mode 100755 prototypes/xci/config/env-vars create mode 100644 prototypes/xci/file/aio/playbooks/configure-xcihost.yml create mode 100644 prototypes/xci/file/aio/playbooks/inventory create mode 100644 prototypes/xci/file/aio/var/ubuntu.yml delete mode 100644 prototypes/xci/file/configure-xci-aio.yml delete mode 100644 prototypes/xci/file/configure-xci-ha.yml delete mode 100644 prototypes/xci/file/configure-xci-mini.yml delete mode 100644 prototypes/xci/file/configure-xci-noha.yml create mode 100644 prototypes/xci/file/ha/configure-targethosts.yml create mode 100644 prototypes/xci/file/ha/playbooks/configure-xcihost.yml create mode 100644 prototypes/xci/file/ha/playbooks/inventory create mode 100644 prototypes/xci/file/ha/var/ubuntu.yml create mode 100644 prototypes/xci/file/mini/configure-targethosts.yml create mode 100644 prototypes/xci/file/mini/playbooks/configure-xcihost.yml create mode 100644 prototypes/xci/file/mini/playbooks/inventory create mode 100644 prototypes/xci/file/mini/var/ubuntu.yml create mode 100644 prototypes/xci/file/noha/configure-targethosts.yml create mode 100644 prototypes/xci/file/noha/playbooks/configure-xcihost.yml create mode 100644 prototypes/xci/file/noha/playbooks/inventory create mode 100644 prototypes/xci/file/noha/var/ubuntu.yml delete mode 100644 prototypes/xci/file/xci-aio-inventory delete mode 100644 prototypes/xci/file/xci-aio-vars.yml delete mode 100644 prototypes/xci/file/xci-ha-inventory delete mode 100644 prototypes/xci/file/xci-ha-vars.yml delete mode 100644 prototypes/xci/file/xci-mini-inventory delete mode 100644 prototypes/xci/file/xci-mini-vars.yml delete mode 100644 prototypes/xci/file/xci-noha-inventory delete mode 100644 prototypes/xci/file/xci-noha-vars.yml create mode 100644 prototypes/xci/flavors/aio create mode 100644 prototypes/xci/flavors/ha create mode 100644 prototypes/xci/flavors/mini create mode 100644 prototypes/xci/flavors/noha delete mode 100644 prototypes/xci/flavors/xci-aio.sh delete mode 100644 prototypes/xci/flavors/xci-ha.sh delete mode 100644 prototypes/xci/flavors/xci-mini.sh delete mode 100644 prototypes/xci/flavors/xci-noha.sh (limited to 'prototypes/xci') diff --git a/prototypes/xci/config/env-vars b/prototypes/xci/config/env-vars new file mode 100755 index 000000000..106a17930 --- /dev/null +++ b/prototypes/xci/config/env-vars @@ -0,0 +1,12 @@ +#------------------------------------------------------------------------------- +# Do not change these settings if you are not developing for XCI Sandbox! +#------------------------------------------------------------------------------- +export OPNFV_RELENG_GIT_URL=https://gerrit.opnfv.org/gerrit/releng.git +export OPENSTACK_BIFROST_GIT_URL=https://git.openstack.org/openstack/bifrost +export OPENSTACK_OSA_GIT_URL=https://git.openstack.org/openstack/openstack-ansible +export OPENSTACK_OSA_ETC_PATH=/etc/openstack_deploy +export CLEAN_DIB_IMAGES=false +export XCI_IP=192.168.122.2 +export XCI_ANSIBLE_PLAYBOOKS_PATH=$OPNFV_RELENG_PATH/prototypes/xci/file/$XCI_FLAVOR/playbooks +export XCI_ANSIBLE_VARS_PATH=$OPNFV_RELENG_PATH/prototypes/xci/file/$XCI_FLAVOR/var +export JOB_NAME=${JOB_NAME:-false} diff --git a/prototypes/xci/config/pinned-versions b/prototypes/xci/config/pinned-versions index c81fcc36b..2fe9eee42 100755 --- a/prototypes/xci/config/pinned-versions +++ b/prototypes/xci/config/pinned-versions @@ -20,7 +20,7 @@ #------------------------------------------------------------------------------- # use releng from master until the development work with the sandbox is complete export OPNFV_RELENG_VERSION="master" -# HEAD of "stable/ocata" as of 24.03.2017 - verified by OPNFV CI -export OPENSTACK_BIFROST_VERSION="a87f7ce6c8725b3bbffec7b2efa1e466796848a9" -# HEAD of "stable/ocata" as of 24.03.2017 - verified by OPNFV CI -export OPENSTACK_OSA_VERSION="4713cf45e11b4ebca9fbed25d1389854602213d8" +# HEAD of "master" as of 27.03.2017 - verified by OPNFV CI +export OPENSTACK_BIFROST_VERSION="7417ff36e4b5fc4e2a6ee7d9dddb7287be20c37d" +# HEAD of "master" as of 27.03.2017 - verified by OPNFV CI +export OPENSTACK_OSA_VERSION="baba7b317a5898cd73b4a11c4ce364c7e2d3d77f" diff --git a/prototypes/xci/config/user-vars b/prototypes/xci/config/user-vars index bb2bfe1d3..f29dda66f 100755 --- a/prototypes/xci/config/user-vars +++ b/prototypes/xci/config/user-vars @@ -1,36 +1,36 @@ -#------------------------------------------------------------------------------- -# Set Paths to where git repositories of XCI Components will be cloned -#------------------------------------------------------------------------------- -# OPNFV XCI Sandbox is not verified to be used as non-root user as of yet so -# changing these paths might break things. -#------------------------------------------------------------------------------- -export OPNFV_RELENG_PATH=/opt/releng -export OPENSTACK_BIFROST_PATH=/opt/bifrost -export OPENSTACK_OSA_PATH=/opt/openstack-ansible - #------------------------------------------------------------------------------- # Set Deployment Flavor #------------------------------------------------------------------------------- # OPNFV XCI currently supports 4 different types of flavors: -# - all in one (aio) - xci-aio.sh: 1 VM which acts as controller and compute node -# - mini opnfv: 3 VMs, 1 xcimaster, 1 controller, and 1 compute nodes -# - noha: 4 VMs, 1 xcimaster, 1 controller, and 2 compute nodes -# - ha: 6 VMs, 1 xcimaster, 3 controllers, and 2 compute nodes +# - all in one (aio): 1 xci VM which acts as controller and compute node +# - mini: 3 VMs, 1 xci VM, 1 controller, and 1 compute nodes +# - noha: 4 VMs, 1 xci VM, 1 controller, and 2 compute nodes +# - ha: 6 VMs, 1 xci VM, 3 controllers, and 2 compute nodes # # Apart from having different number of nodes, CPU, RAM, and disk allocations # also differ from each other. Please take a look at the env-vars files for # each of these flavors. # # Examples: -# export XCI_FLAVOR="xci-aio" +# export XCI_FLAVOR="aio" # or -# export XCI_FLAVOR="xci-mini" +# export XCI_FLAVOR="mini" # or -# export XCI_FLAVOR="xci-noha" +# export XCI_FLAVOR="noha" # or -# export XCI_FLAVOR="xci-ha" +# export XCI_FLAVOR="ha" #------------------------------------------------------------------------------- -export XCI_FLAVOR=${XCI_FLAVOR:-xci-mini} +export XCI_FLAVOR=${XCI_FLAVOR:-aio} + +#------------------------------------------------------------------------------- +# Set Paths to where git repositories of XCI Components will be cloned +#------------------------------------------------------------------------------- +# OPNFV XCI Sandbox is not verified to be used as non-root user as of yet so +# changing these paths might break things. +#------------------------------------------------------------------------------- +export OPNFV_RELENG_PATH=/opt/releng +export OPENSTACK_BIFROST_PATH=/opt/bifrost +export OPENSTACK_OSA_PATH=/opt/openstack-ansible #------------------------------------------------------------------------------- # Configure some other stuff @@ -41,4 +41,4 @@ export XCI_FLAVOR=${XCI_FLAVOR:-xci-mini} # ANSIBLE_VERBOSITY="-v" # or # ANSIBLE_VERBOSITY="-vvvv" -export ANSIBLE_VERBOSITY=${ANSIBLE_VERBOSITY:-""} +export ANSIBLE_VERBOSITY=${ANSIBLE_VERBOSITY-""} diff --git a/prototypes/xci/file/aio/playbooks/configure-xcihost.yml b/prototypes/xci/file/aio/playbooks/configure-xcihost.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/aio/playbooks/inventory b/prototypes/xci/file/aio/playbooks/inventory new file mode 100644 index 000000000..9283e516d --- /dev/null +++ b/prototypes/xci/file/aio/playbooks/inventory @@ -0,0 +1,2 @@ +[xciaio] +xciaio ansible_ssh_host=192.168.122.2 diff --git a/prototypes/xci/file/aio/var/ubuntu.yml b/prototypes/xci/file/aio/var/ubuntu.yml new file mode 100644 index 000000000..3a041b1cb --- /dev/null +++ b/prototypes/xci/file/aio/var/ubuntu.yml @@ -0,0 +1,7 @@ +--- +OPENSTACK_OSA_GIT_URL: "{{ lookup('env','OPENSTACK_OSA_GIT_URL') }}" +OPENSTACK_OSA_PATH: "{{ lookup('env','OPENSTACK_OSA_PATH') }}" +OPENSTACK_OSA_VERSION: "{{ lookup('env','OPENSTACK_OSA_VERSION') }}" +OPENSTACK_OSA_ETC_PATH: "{{ lookup('env','OPENSTACK_OSA_ETC_PATH') }}" +XCI_IP: "{{ lookup('env','XCI_IP') }}" +multi_host: "False" diff --git a/prototypes/xci/file/configure-xci-aio.yml b/prototypes/xci/file/configure-xci-aio.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/configure-xci-ha.yml b/prototypes/xci/file/configure-xci-ha.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/configure-xci-mini.yml b/prototypes/xci/file/configure-xci-mini.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/configure-xci-noha.yml b/prototypes/xci/file/configure-xci-noha.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/ha/configure-targethosts.yml b/prototypes/xci/file/ha/configure-targethosts.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/ha/playbooks/configure-xcihost.yml b/prototypes/xci/file/ha/playbooks/configure-xcihost.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/ha/playbooks/inventory b/prototypes/xci/file/ha/playbooks/inventory new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/ha/var/ubuntu.yml b/prototypes/xci/file/ha/var/ubuntu.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/mini/configure-targethosts.yml b/prototypes/xci/file/mini/configure-targethosts.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/mini/playbooks/configure-xcihost.yml b/prototypes/xci/file/mini/playbooks/configure-xcihost.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/mini/playbooks/inventory b/prototypes/xci/file/mini/playbooks/inventory new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/mini/var/ubuntu.yml b/prototypes/xci/file/mini/var/ubuntu.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/noha/configure-targethosts.yml b/prototypes/xci/file/noha/configure-targethosts.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/noha/playbooks/configure-xcihost.yml b/prototypes/xci/file/noha/playbooks/configure-xcihost.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/noha/playbooks/inventory b/prototypes/xci/file/noha/playbooks/inventory new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/noha/var/ubuntu.yml b/prototypes/xci/file/noha/var/ubuntu.yml new file mode 100644 index 000000000..e69de29bb diff --git a/prototypes/xci/file/xci-aio-inventory b/prototypes/xci/file/xci-aio-inventory deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-aio-vars.yml b/prototypes/xci/file/xci-aio-vars.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-ha-inventory b/prototypes/xci/file/xci-ha-inventory deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-ha-vars.yml b/prototypes/xci/file/xci-ha-vars.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-mini-inventory b/prototypes/xci/file/xci-mini-inventory deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-mini-vars.yml b/prototypes/xci/file/xci-mini-vars.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-noha-inventory b/prototypes/xci/file/xci-noha-inventory deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/file/xci-noha-vars.yml b/prototypes/xci/file/xci-noha-vars.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/prototypes/xci/flavors/aio b/prototypes/xci/flavors/aio new file mode 100644 index 000000000..48754e507 --- /dev/null +++ b/prototypes/xci/flavors/aio @@ -0,0 +1,18 @@ +#------------------------------------------------------------------------------- +# XCI Flavor Configuration +#------------------------------------------------------------------------------- +# You are free to modify parts of the configuration to fit into your environment. +# But before doing that, please ensure you checked other flavors to see if one +# them can be used instead, saving you some time. +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Configure VM Nodes +#------------------------------------------------------------------------------- +export TEST_VM_NUM_NODES=1 +export TEST_VM_NODE_NAMES=xci +export VM_DOMAIN_TYPE=kvm +export VM_CPU=8 +export VM_DISK=80 +export VM_MEMORY_SIZE=8192 +export VM_DISK_CACHE=unsafe diff --git a/prototypes/xci/flavors/ha b/prototypes/xci/flavors/ha new file mode 100644 index 000000000..8a045a3dd --- /dev/null +++ b/prototypes/xci/flavors/ha @@ -0,0 +1,18 @@ +#------------------------------------------------------------------------------- +# XCI Flavor Configuration +#------------------------------------------------------------------------------- +# You are free to modify parts of the configuration to fit into your environment. +# But before doing that, please ensure you checked other flavors to see if one +# them can be used instead, saving you some time. +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Configure VM Nodes +#------------------------------------------------------------------------------- +export TEST_VM_NUM_NODES=6 +export TEST_VM_NODE_NAMES="xci controller00 controller01 controller02 compute00 compute01" +export VM_DOMAIN_TYPE=kvm +export VM_CPU=8 +export VM_DISK=80 +export VM_MEMORY_SIZE=16384 +export VM_DISK_CACHE=unsafe diff --git a/prototypes/xci/flavors/mini b/prototypes/xci/flavors/mini new file mode 100644 index 000000000..44b015d9f --- /dev/null +++ b/prototypes/xci/flavors/mini @@ -0,0 +1,18 @@ +#------------------------------------------------------------------------------- +# XCI Flavor Configuration +#------------------------------------------------------------------------------- +# You are free to modify parts of the configuration to fit into your environment. +# But before doing that, please ensure you checked other flavors to see if one +# them can be used instead, saving you some time. +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Configure VM Nodes +#------------------------------------------------------------------------------- +export TEST_VM_NUM_NODES=3 +export TEST_VM_NODE_NAMES="xci controller00 compute00" +export VM_DOMAIN_TYPE=kvm +export VM_CPU=8 +export VM_DISK=80 +export VM_MEMORY_SIZE=8192 +export VM_DISK_CACHE=unsafe diff --git a/prototypes/xci/flavors/noha b/prototypes/xci/flavors/noha new file mode 100644 index 000000000..7f686e5e5 --- /dev/null +++ b/prototypes/xci/flavors/noha @@ -0,0 +1,18 @@ +#------------------------------------------------------------------------------- +# XCI Flavor Configuration +#------------------------------------------------------------------------------- +# You are free to modify parts of the configuration to fit into your environment. +# But before doing that, please ensure you checked other flavors to see if one +# them can be used instead, saving you some time. +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Configure VM Nodes +#------------------------------------------------------------------------------- +export TEST_VM_NUM_NODES=4 +export TEST_VM_NODE_NAMES="xci controller00 compute00 compute01" +export VM_DOMAIN_TYPE=kvm +export VM_CPU=8 +export VM_DISK=80 +export VM_MEMORY_SIZE=8192 +export VM_DISK_CACHE=unsafe diff --git a/prototypes/xci/flavors/xci-aio.sh b/prototypes/xci/flavors/xci-aio.sh deleted file mode 100644 index 9f9ea1be6..000000000 --- a/prototypes/xci/flavors/xci-aio.sh +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------- -# XCI Flavor Configuration -#------------------------------------------------------------------------------- -# This is the configuration for xci-aio. -# -# You are free to modify parts of the configuration to fit into your environment. -# But before doing that, please ensure you checked other flavors to see if one -# them can be used instead, saving you some time. -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Configure VM Nodes -#------------------------------------------------------------------------------- -export TEST_VM_NUM_NODES=1 -export TEST_VM_NODE_NAMES=xciaio -export VM_DOMAIN_TYPE=kvm -export VM_CPU=8 -export VM_DISK=80 -export VM_MEMORY_SIZE=12288 -export VM_DISK_CACHE=unsafe - -#------------------------------------------------------------------------------- -# Ansible Files for the Flavor -#------------------------------------------------------------------------------- -XCI_ANSIBLE_PLAYBOOK=$OPNFV_RELENG_PATH/prototypes/xci/file/configure-xci-aio.yml -XCI_ANSIBLE_INVENTORY=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-aio-inventory -XCI_ANSIBLE_VARS=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-aio-vars.yml diff --git a/prototypes/xci/flavors/xci-ha.sh b/prototypes/xci/flavors/xci-ha.sh deleted file mode 100644 index 442432fea..000000000 --- a/prototypes/xci/flavors/xci-ha.sh +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------- -# XCI Flavor Configuration -#------------------------------------------------------------------------------- -# This is the configuration for xci-aio. -# -# You are free to modify parts of the configuration to fit into your environment. -# But before doing that, please ensure you checked other flavors to see if one -# them can be used instead, saving you some time. -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Configure VM Nodes -#------------------------------------------------------------------------------- -export TEST_VM_NUM_NODES=6 -export TEST_VM_NODE_NAMES="xcimaster controller00 controller01 controller02 compute00 compute01" -export VM_DOMAIN_TYPE=kvm -export VM_CPU=8 -export VM_DISK=100 -export VM_MEMORY_SIZE=16384 -export VM_DISK_CACHE=unsafe - -#------------------------------------------------------------------------------- -# Ansible Files for the Flavor -#------------------------------------------------------------------------------- -XCI_ANSIBLE_PLAYBOOK=$OPNFV_RELENG_PATH/prototypes/xci/file/configure-xci-ha.yml -XCI_ANSIBLE_INVENTORY=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-ha-inventory -XCI_ANSIBLE_VARS=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-ha-vars.yml diff --git a/prototypes/xci/flavors/xci-mini.sh b/prototypes/xci/flavors/xci-mini.sh deleted file mode 100644 index 11048f6be..000000000 --- a/prototypes/xci/flavors/xci-mini.sh +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------- -# XCI Flavor Configuration -#------------------------------------------------------------------------------- -# This is the configuration for xci-aio. -# -# You are free to modify parts of the configuration to fit into your environment. -# But before doing that, please ensure you checked other flavors to see if one -# them can be used instead, saving you some time. -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Configure VM Nodes -#------------------------------------------------------------------------------- -export TEST_VM_NUM_NODES=3 -export TEST_VM_NODE_NAMES="xcimaster controller00 compute00" -export VM_DOMAIN_TYPE=kvm -export VM_CPU=8 -export VM_DISK=100 -export VM_MEMORY_SIZE=12288 -export VM_DISK_CACHE=unsafe - -#------------------------------------------------------------------------------- -# Ansible Files for the Flavor -#------------------------------------------------------------------------------- -XCI_ANSIBLE_PLAYBOOK=$OPNFV_RELENG_PATH/prototypes/xci/file/configure-xci-mini.yml -XCI_ANSIBLE_INVENTORY=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-mini-inventory -XCI_ANSIBLE_VARS=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-mini-vars.yml diff --git a/prototypes/xci/flavors/xci-noha.sh b/prototypes/xci/flavors/xci-noha.sh deleted file mode 100644 index 6a83f9962..000000000 --- a/prototypes/xci/flavors/xci-noha.sh +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------- -# XCI Flavor Configuration -#------------------------------------------------------------------------------- -# This is the configuration for xci-aio. -# -# You are free to modify parts of the configuration to fit into your environment. -# But before doing that, please ensure you checked other flavors to see if one -# them can be used instead, saving you some time. -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Configure VM Nodes -#------------------------------------------------------------------------------- -export TEST_VM_NUM_NODES=4 -export TEST_VM_NODE_NAMES="xcimaster controller00 compute00 compute01" -export VM_DOMAIN_TYPE=kvm -export VM_CPU=8 -export VM_DISK=100 -export VM_MEMORY_SIZE=12288 -export VM_DISK_CACHE=unsafe - -#------------------------------------------------------------------------------- -# Ansible Files for the Flavor -#------------------------------------------------------------------------------- -XCI_ANSIBLE_PLAYBOOK=$OPNFV_RELENG_PATH/prototypes/xci/file/configure-xci-mini.yml -XCI_ANSIBLE_INVENTORY=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-mini-inventory -XCI_ANSIBLE_VARS=$OPNFV_RELENG_PATH/prototypes/xci/file/xci-mini-vars.yml diff --git a/prototypes/xci/xci-deploy.sh b/prototypes/xci/xci-deploy.sh index 34149f22f..401c098c6 100755 --- a/prototypes/xci/xci-deploy.sh +++ b/prototypes/xci/xci-deploy.sh @@ -4,6 +4,12 @@ set -o nounset set -o pipefail set -o xtrace +# This script must run as root +if [[ $(whoami) != "root" ]]; then + echo "Error: This script must be run as root!" + exit 1 +fi + # find where are we XCI_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -14,4 +20,57 @@ source $XCI_PATH/config/pinned-versions source $XCI_PATH/config/user-vars # source flavor configuration -source $XCI_PATH/flavors/$XCI_FLAVOR.sh +source $XCI_PATH/flavors/$XCI_FLAVOR + +# source xci configuration +source $XCI_PATH/config/env-vars + +# log info to console +echo "Info: Starting XCI Deployment" +echo "Info: Deployment parameters" +echo "-------------------------------------------------------------------------" +echo "xci flavor: $XCI_FLAVOR" +echo "opnfv/releng version: $OPNFV_RELENG_VERSION" +echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION" +echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION" +echo "-------------------------------------------------------------------------" + +#------------------------------------------------------------------------------- +# Cleanup the leftovers from the previous deployment +#------------------------------------------------------------------------------- +echo "Info: Cleaning up the previous deployment" +$XCI_PATH/../bifrost/scripts/destroy-env.sh > /dev/null 2>&1 +/bin/rm -rf /opt/releng /opt/bifrost /opt/openstack-ansible /opt/stack + +#------------------------------------------------------------------------------- +# Clone the repositories and checkout the versions +#------------------------------------------------------------------------------- +echo "Info: Cloning repositories and checking out versions" +git clone --quiet $OPNFV_RELENG_GIT_URL $OPNFV_RELENG_PATH && \ + cd $OPNFV_RELENG_PATH +echo "Info: Cloned opnfv/releng. HEAD currently points at" +echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')" +git clone --quiet $OPENSTACK_BIFROST_GIT_URL $OPENSTACK_BIFROST_PATH && \ + cd $OPENSTACK_BIFROST_PATH +echo "Info: Cloned openstack/bifrost. HEAD currently points at" +echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')" + +#------------------------------------------------------------------------------- +# Combine opnfv and upstream scripts/playbooks +#------------------------------------------------------------------------------- +echo "Info: Combining opnfv/releng and opestack/bifrost scripts/playbooks" +/bin/cp -rf $OPNFV_RELENG_PATH/prototypes/bifrost/* $OPENSTACK_BIFROST_PATH/ + +#------------------------------------------------------------------------------- +# Start provisioning VM nodes +#------------------------------------------------------------------------------- +echo "Info: Starting provisining VM nodes using openstack/bifrost" +echo " This might take between 10 to 20 minutes depending on the flavor and the host" +echo "-------------------------------------------------------------------------" +cd $OPENSTACK_BIFROST_PATH +STARTTIME=$(date +%s) +./scripts/bifrost-provision.sh +ENDTIME=$(date +%s) +echo "-----------------------------------------------------------------------" +echo "Info: VM nodes are provisioned!" +echo "Info: It took $(($ENDTIME - $STARTTIME)) seconds to provising the VM nodes" -- cgit