summaryrefslogtreecommitdiffstats
path: root/prototypes/xci
diff options
context:
space:
mode:
Diffstat (limited to 'prototypes/xci')
-rwxr-xr-xprototypes/xci/config/aio-vars18
-rwxr-xr-xprototypes/xci/config/env-vars17
-rwxr-xr-xprototypes/xci/config/ha-vars18
-rwxr-xr-xprototypes/xci/config/mini-vars18
-rwxr-xr-xprototypes/xci/config/noha-vars18
-rwxr-xr-xprototypes/xci/config/pinned-versions27
-rwxr-xr-xprototypes/xci/config/user-vars46
-rw-r--r--prototypes/xci/file/aio/flavor-vars.yml0
-rw-r--r--prototypes/xci/file/aio/inventory0
-rw-r--r--prototypes/xci/file/aio/openstack_user_config.yml0
-rw-r--r--prototypes/xci/file/cinder.yml0
-rw-r--r--prototypes/xci/file/exports0
-rw-r--r--prototypes/xci/file/ha/flavor-vars.yml0
-rw-r--r--prototypes/xci/file/ha/inventory0
-rw-r--r--prototypes/xci/file/ha/openstack_user_config.yml0
-rw-r--r--prototypes/xci/file/mini/flavor-vars.yml0
-rw-r--r--prototypes/xci/file/mini/inventory0
-rw-r--r--prototypes/xci/file/mini/openstack_user_config.yml0
-rw-r--r--prototypes/xci/file/modules0
-rw-r--r--prototypes/xci/file/noha/flavor-vars.yml0
-rw-r--r--prototypes/xci/file/noha/inventory0
-rw-r--r--prototypes/xci/file/noha/openstack_user_config.yml0
-rw-r--r--prototypes/xci/file/setup-openstack.yml0
-rw-r--r--prototypes/xci/file/user_variables.yml0
-rw-r--r--prototypes/xci/playbooks/configure-localhost.yml0
-rw-r--r--prototypes/xci/playbooks/inventory0
-rw-r--r--prototypes/xci/template/compute.interface.j20
-rw-r--r--prototypes/xci/template/controller.interface.j20
-rw-r--r--prototypes/xci/template/xci.interface.j20
-rw-r--r--prototypes/xci/var/ubuntu.yml0
-rwxr-xr-xprototypes/xci/xci-deploy.sh76
31 files changed, 238 insertions, 0 deletions
diff --git a/prototypes/xci/config/aio-vars b/prototypes/xci/config/aio-vars
new file mode 100755
index 000000000..48754e507
--- /dev/null
+++ b/prototypes/xci/config/aio-vars
@@ -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/config/env-vars b/prototypes/xci/config/env-vars
new file mode 100755
index 000000000..cebf7b423
--- /dev/null
+++ b/prototypes/xci/config/env-vars
@@ -0,0 +1,17 @@
+#-------------------------------------------------------------------------------
+# !!! Changing or overriding these will most likely break everything altogether !!!
+# Please do not change these settings if you are not developing for XCI!
+#-------------------------------------------------------------------------------
+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_FLAVOR_ANSIBLE_FILE_PATH=$OPNFV_RELENG_PATH/prototypes/xci/file/$XCI_FLAVOR
+export JOB_NAME=${JOB_NAME:-false}
+export ANSIBLE_HOST_KEY_CHECKING=False
+export DISTRO=${DISTRO:-ubuntu}
+export DIB_OS_RELEASE=${DIB_OS_RELEASE:-xenial}
+export DIB_OS_ELEMENT=${DIB_OS_ELEMENT:-ubuntu-minimal}
+export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"vlan,vim,less,bridge-utils,sudo,language-pack-en,iputils-ping,rsyslog,curl,python,debootstrap,ifenslave,ifenslave-2.6,lsof,lvm2,tcpdump,nfs-kernel-server,chrony,iptables"}
diff --git a/prototypes/xci/config/ha-vars b/prototypes/xci/config/ha-vars
new file mode 100755
index 000000000..8a045a3dd
--- /dev/null
+++ b/prototypes/xci/config/ha-vars
@@ -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/config/mini-vars b/prototypes/xci/config/mini-vars
new file mode 100755
index 000000000..4d720801f
--- /dev/null
+++ b/prototypes/xci/config/mini-vars
@@ -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=12288
+export VM_DISK_CACHE=unsafe
diff --git a/prototypes/xci/config/noha-vars b/prototypes/xci/config/noha-vars
new file mode 100755
index 000000000..22c68feeb
--- /dev/null
+++ b/prototypes/xci/config/noha-vars
@@ -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=12288
+export VM_DISK_CACHE=unsafe
diff --git a/prototypes/xci/config/pinned-versions b/prototypes/xci/config/pinned-versions
new file mode 100755
index 000000000..1cd33813c
--- /dev/null
+++ b/prototypes/xci/config/pinned-versions
@@ -0,0 +1,27 @@
+#-------------------------------------------------------------------------------
+# Pinned Component Versions
+#-------------------------------------------------------------------------------
+# You are free to override these versions in user-vars to experiment with
+# different branches or with different commits but be aware that things might
+# not work as expected. You can set the versions you want to use before running
+# the main script on your shell as shown on the examples below.
+#
+# It is important to be consistent between branches you use for OpenStack
+# projects OPNFV XCI uses.
+#
+# Examples:
+# export OPENSTACK_BIFROST_VERSION="stable/ocata"
+# export OPENSTACK_OSA_VERSION="stable/ocata"
+# or
+# export OPENSTACK_BIFROST_VERSION="master"
+# export OPENSTACK_OSA_VERSION="master"
+# or
+# export OPENSTACK_BIFROST_VERSION="a87f7ce6c8725b3bbffec7b2efa1e466796848a9"
+# export OPENSTACK_OSA_VERSION="4713cf45e11b4ebca9fbed25d1389854602213d8"
+#-------------------------------------------------------------------------------
+# use releng from master until the development work with the sandbox is complete
+export OPNFV_RELENG_VERSION="master"
+# HEAD of "master" as of 28.03.2017
+export OPENSTACK_BIFROST_VERSION=${OPENSTACK_BIFROST_VERSION:-"2600d546ed7116f5aad81972b0987a269f3c45b4"}
+# HEAD of "master" as of 26.03.2017
+export OPENSTACK_OSA_VERSION=${OPENSTACK_OSA_VERSION:-"baba7b317a5898cd73b4a11c4ce364c7e2d3d77f"}
diff --git a/prototypes/xci/config/user-vars b/prototypes/xci/config/user-vars
new file mode 100755
index 000000000..b326f5ce7
--- /dev/null
+++ b/prototypes/xci/config/user-vars
@@ -0,0 +1,46 @@
+#-------------------------------------------------------------------------------
+# Set Deployment Flavor
+#-------------------------------------------------------------------------------
+# OPNFV XCI currently supports 4 different types of flavors:
+# - 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="aio"
+# or
+# export XCI_FLAVOR="mini"
+# or
+# export XCI_FLAVOR="noha"
+# or
+# export XCI_FLAVOR="ha"
+#-------------------------------------------------------------------------------
+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
+#-------------------------------------------------------------------------------
+# Set the verbosity for ansible
+#
+# Examples:
+# ANSIBLE_VERBOSITY="-v"
+# or
+# ANSIBLE_VERBOSITY="-vvvv"
+export ANSIBLE_VERBOSITY=${ANSIBLE_VERBOSITY-""}
+export LOG_PATH=${LOG_PATH:-/opt/xci/logs}
+export RUN_TEMPEST=${RUN_TEMPEST:-false}
diff --git a/prototypes/xci/file/aio/flavor-vars.yml b/prototypes/xci/file/aio/flavor-vars.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/aio/flavor-vars.yml
diff --git a/prototypes/xci/file/aio/inventory b/prototypes/xci/file/aio/inventory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/aio/inventory
diff --git a/prototypes/xci/file/aio/openstack_user_config.yml b/prototypes/xci/file/aio/openstack_user_config.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/aio/openstack_user_config.yml
diff --git a/prototypes/xci/file/cinder.yml b/prototypes/xci/file/cinder.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/cinder.yml
diff --git a/prototypes/xci/file/exports b/prototypes/xci/file/exports
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/exports
diff --git a/prototypes/xci/file/ha/flavor-vars.yml b/prototypes/xci/file/ha/flavor-vars.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/ha/flavor-vars.yml
diff --git a/prototypes/xci/file/ha/inventory b/prototypes/xci/file/ha/inventory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/ha/inventory
diff --git a/prototypes/xci/file/ha/openstack_user_config.yml b/prototypes/xci/file/ha/openstack_user_config.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/ha/openstack_user_config.yml
diff --git a/prototypes/xci/file/mini/flavor-vars.yml b/prototypes/xci/file/mini/flavor-vars.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/mini/flavor-vars.yml
diff --git a/prototypes/xci/file/mini/inventory b/prototypes/xci/file/mini/inventory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/mini/inventory
diff --git a/prototypes/xci/file/mini/openstack_user_config.yml b/prototypes/xci/file/mini/openstack_user_config.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/mini/openstack_user_config.yml
diff --git a/prototypes/xci/file/modules b/prototypes/xci/file/modules
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/modules
diff --git a/prototypes/xci/file/noha/flavor-vars.yml b/prototypes/xci/file/noha/flavor-vars.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/noha/flavor-vars.yml
diff --git a/prototypes/xci/file/noha/inventory b/prototypes/xci/file/noha/inventory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/noha/inventory
diff --git a/prototypes/xci/file/noha/openstack_user_config.yml b/prototypes/xci/file/noha/openstack_user_config.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/noha/openstack_user_config.yml
diff --git a/prototypes/xci/file/setup-openstack.yml b/prototypes/xci/file/setup-openstack.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/setup-openstack.yml
diff --git a/prototypes/xci/file/user_variables.yml b/prototypes/xci/file/user_variables.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/file/user_variables.yml
diff --git a/prototypes/xci/playbooks/configure-localhost.yml b/prototypes/xci/playbooks/configure-localhost.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/playbooks/configure-localhost.yml
diff --git a/prototypes/xci/playbooks/inventory b/prototypes/xci/playbooks/inventory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/playbooks/inventory
diff --git a/prototypes/xci/template/compute.interface.j2 b/prototypes/xci/template/compute.interface.j2
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/template/compute.interface.j2
diff --git a/prototypes/xci/template/controller.interface.j2 b/prototypes/xci/template/controller.interface.j2
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/template/controller.interface.j2
diff --git a/prototypes/xci/template/xci.interface.j2 b/prototypes/xci/template/xci.interface.j2
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/template/xci.interface.j2
diff --git a/prototypes/xci/var/ubuntu.yml b/prototypes/xci/var/ubuntu.yml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/prototypes/xci/var/ubuntu.yml
diff --git a/prototypes/xci/xci-deploy.sh b/prototypes/xci/xci-deploy.sh
new file mode 100755
index 000000000..eb1e9d78e
--- /dev/null
+++ b/prototypes/xci/xci-deploy.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+set -o errexit
+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 )"
+
+# source pinned versions
+source $XCI_PATH/config/pinned-versions
+
+# source user vars
+source $XCI_PATH/config/user-vars
+
+# source flavor configuration
+source "$XCI_PATH/flavors/${XCI_FLAVOR}-vars"
+
+# 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"