From 5cc5559348a8a18a41cfd25cce446955d63afb83 Mon Sep 17 00:00:00 2001 From: David Blaisonneau Date: Thu, 4 Aug 2016 17:37:15 +0200 Subject: New scripts for configs generation, based on jinja2 Signed-off-by: David Blaisonneau --- ci/00-maasdeploy.sh | 350 +++++++++++---------- ci/bundle_tpl/aodh.yaml | 5 - ci/bundle_tpl/bundle.yaml | 60 ---- ci/bundle_tpl/ceilometer.yaml | 18 -- ci/bundle_tpl/ceph.yaml | 36 --- ci/bundle_tpl/cinder.yaml | 16 - ci/bundle_tpl/congress.yaml | 9 - ci/bundle_tpl/glance.yaml | 14 - ci/bundle_tpl/haclusters.yaml | 53 ---- ci/bundle_tpl/harelations.yaml | 14 - ci/bundle_tpl/heat.yaml | 13 - ci/bundle_tpl/keystone.yaml | 16 - ci/bundle_tpl/mysql.yaml | 17 - ci/bundle_tpl/neutron-api.yaml | 26 -- ci/bundle_tpl/neutron-gateway.yaml | 46 --- ci/bundle_tpl/neutron-ovs.yaml | 31 -- ci/bundle_tpl/nova-cloud-controller.yaml | 21 -- ci/bundle_tpl/nova-compute.yaml | 18 -- ci/bundle_tpl/oclphase1.yaml | 58 ---- ci/bundle_tpl/odl.yaml | 17 - ci/bundle_tpl/onos.yaml | 9 - ci/bundle_tpl/openstack-dashboard.yaml | 16 - ci/bundle_tpl/opnfv-promise.yaml | 5 - ci/bundle_tpl/phase2-overrides.yaml | 25 -- ci/bundle_tpl/rabbitmq.yaml | 12 - ci/bundle_tpl/relations.yaml | 95 ------ ci/bundle_tpl/subordinate.yaml | 55 ---- ci/config_tpl/bundle_tpl/aodh.yaml | 5 + ci/config_tpl/bundle_tpl/bundle.yaml | 60 ++++ ci/config_tpl/bundle_tpl/ceilometer.yaml | 18 ++ ci/config_tpl/bundle_tpl/ceph.yaml | 36 +++ ci/config_tpl/bundle_tpl/cinder.yaml | 16 + ci/config_tpl/bundle_tpl/congress.yaml | 9 + ci/config_tpl/bundle_tpl/glance.yaml | 14 + ci/config_tpl/bundle_tpl/haclusters.yaml | 53 ++++ ci/config_tpl/bundle_tpl/harelations.yaml | 14 + ci/config_tpl/bundle_tpl/heat.yaml | 13 + ci/config_tpl/bundle_tpl/keystone.yaml | 16 + ci/config_tpl/bundle_tpl/mysql.yaml | 17 + ci/config_tpl/bundle_tpl/neutron-api.yaml | 26 ++ ci/config_tpl/bundle_tpl/neutron-gateway.yaml | 46 +++ ci/config_tpl/bundle_tpl/neutron-ovs.yaml | 31 ++ .../bundle_tpl/nova-cloud-controller.yaml | 21 ++ ci/config_tpl/bundle_tpl/nova-compute.yaml | 18 ++ ci/config_tpl/bundle_tpl/oclphase1.yaml | 58 ++++ ci/config_tpl/bundle_tpl/odl.yaml | 17 + ci/config_tpl/bundle_tpl/onos.yaml | 9 + ci/config_tpl/bundle_tpl/openstack-dashboard.yaml | 16 + ci/config_tpl/bundle_tpl/opnfv-promise.yaml | 5 + ci/config_tpl/bundle_tpl/phase2-overrides.yaml | 25 ++ ci/config_tpl/bundle_tpl/rabbitmq.yaml | 12 + ci/config_tpl/bundle_tpl/relations.yaml | 95 ++++++ ci/config_tpl/bundle_tpl/subordinate.yaml | 55 ++++ ci/config_tpl/deployconfig.yaml | 40 +++ ci/config_tpl/maas_tpl/deployment.yaml | 45 +++ ci/config_tpl/maas_tpl/juju-bootstrap.yaml | 13 + ci/config_tpl/maas_tpl/maas-network_config.yaml | 20 ++ ci/config_tpl/maas_tpl/maas-node_group_ifaces.yaml | 23 ++ ci/config_tpl/maas_tpl/maas-nodes.yaml | 28 ++ ci/genBundle.py | 15 +- ci/genDeploymentConfig.py | 103 ++++++ ci/genMAASConfig.py | 104 ++++++ 62 files changed, 1270 insertions(+), 881 deletions(-) delete mode 100644 ci/bundle_tpl/aodh.yaml delete mode 100644 ci/bundle_tpl/bundle.yaml delete mode 100644 ci/bundle_tpl/ceilometer.yaml delete mode 100644 ci/bundle_tpl/ceph.yaml delete mode 100644 ci/bundle_tpl/cinder.yaml delete mode 100644 ci/bundle_tpl/congress.yaml delete mode 100644 ci/bundle_tpl/glance.yaml delete mode 100644 ci/bundle_tpl/haclusters.yaml delete mode 100644 ci/bundle_tpl/harelations.yaml delete mode 100644 ci/bundle_tpl/heat.yaml delete mode 100644 ci/bundle_tpl/keystone.yaml delete mode 100644 ci/bundle_tpl/mysql.yaml delete mode 100644 ci/bundle_tpl/neutron-api.yaml delete mode 100644 ci/bundle_tpl/neutron-gateway.yaml delete mode 100644 ci/bundle_tpl/neutron-ovs.yaml delete mode 100644 ci/bundle_tpl/nova-cloud-controller.yaml delete mode 100644 ci/bundle_tpl/nova-compute.yaml delete mode 100644 ci/bundle_tpl/oclphase1.yaml delete mode 100644 ci/bundle_tpl/odl.yaml delete mode 100644 ci/bundle_tpl/onos.yaml delete mode 100644 ci/bundle_tpl/openstack-dashboard.yaml delete mode 100644 ci/bundle_tpl/opnfv-promise.yaml delete mode 100644 ci/bundle_tpl/phase2-overrides.yaml delete mode 100644 ci/bundle_tpl/rabbitmq.yaml delete mode 100644 ci/bundle_tpl/relations.yaml delete mode 100644 ci/bundle_tpl/subordinate.yaml create mode 100644 ci/config_tpl/bundle_tpl/aodh.yaml create mode 100644 ci/config_tpl/bundle_tpl/bundle.yaml create mode 100644 ci/config_tpl/bundle_tpl/ceilometer.yaml create mode 100644 ci/config_tpl/bundle_tpl/ceph.yaml create mode 100644 ci/config_tpl/bundle_tpl/cinder.yaml create mode 100644 ci/config_tpl/bundle_tpl/congress.yaml create mode 100644 ci/config_tpl/bundle_tpl/glance.yaml create mode 100644 ci/config_tpl/bundle_tpl/haclusters.yaml create mode 100644 ci/config_tpl/bundle_tpl/harelations.yaml create mode 100644 ci/config_tpl/bundle_tpl/heat.yaml create mode 100644 ci/config_tpl/bundle_tpl/keystone.yaml create mode 100644 ci/config_tpl/bundle_tpl/mysql.yaml create mode 100644 ci/config_tpl/bundle_tpl/neutron-api.yaml create mode 100644 ci/config_tpl/bundle_tpl/neutron-gateway.yaml create mode 100644 ci/config_tpl/bundle_tpl/neutron-ovs.yaml create mode 100644 ci/config_tpl/bundle_tpl/nova-cloud-controller.yaml create mode 100644 ci/config_tpl/bundle_tpl/nova-compute.yaml create mode 100644 ci/config_tpl/bundle_tpl/oclphase1.yaml create mode 100644 ci/config_tpl/bundle_tpl/odl.yaml create mode 100644 ci/config_tpl/bundle_tpl/onos.yaml create mode 100644 ci/config_tpl/bundle_tpl/openstack-dashboard.yaml create mode 100644 ci/config_tpl/bundle_tpl/opnfv-promise.yaml create mode 100644 ci/config_tpl/bundle_tpl/phase2-overrides.yaml create mode 100644 ci/config_tpl/bundle_tpl/rabbitmq.yaml create mode 100644 ci/config_tpl/bundle_tpl/relations.yaml create mode 100644 ci/config_tpl/bundle_tpl/subordinate.yaml create mode 100644 ci/config_tpl/deployconfig.yaml create mode 100644 ci/config_tpl/maas_tpl/deployment.yaml create mode 100644 ci/config_tpl/maas_tpl/juju-bootstrap.yaml create mode 100644 ci/config_tpl/maas_tpl/maas-network_config.yaml create mode 100644 ci/config_tpl/maas_tpl/maas-node_group_ifaces.yaml create mode 100644 ci/config_tpl/maas_tpl/maas-nodes.yaml create mode 100644 ci/genDeploymentConfig.py create mode 100644 ci/genMAASConfig.py diff --git a/ci/00-maasdeploy.sh b/ci/00-maasdeploy.sh index f25a36d9..8b8a8d44 100755 --- a/ci/00-maasdeploy.sh +++ b/ci/00-maasdeploy.sh @@ -20,84 +20,66 @@ sudo apt-get install openssh-server bzr git maas-deployer juju juju-deployer \ # absolute location of file (including file name) or url of the # file to download. -if [ "$1" == "custom" ]; then - if [ -e $2 ]; then - cp $2 ./labconfig.yaml || true - python genmaasconfig.py - else - wget $2 -t 3 -T 10 -O ./labconfig.yaml || true - count=`wc -l labconfig.yaml | cut -d " " -f 1` - - if [ $count -lt 10 ]; then - rm -rf labconfig.yaml +labname=$1 +labfile=$2 + +# +# Config preparation +# + +# Get labconfig and generate deployment.yaml for MAAS and deployconfig.yaml +case "$labname" in + intelpod[569]|orangepod[12]|cengnpod[12] ) + array=(${labname//pod/ }) + cp maas/${array[0]}/pod${array[0]}/labconfig.yaml . + python genDeploymentConfig.py > deployment.yaml + python genMAASConfig.py > deployconfig.yaml + ;; + 'attvirpod1' ) + cp maas/att/virpod1/labconfig.yaml . + python genDeploymentConfig.py > deployment.yaml + python genMAASConfig.py > deployconfig.yaml + ;; + 'juniperpod1' ) + cp maas/juniper/pod1/deployment.yaml ./deployment.yaml + ;; + 'custom') + if [ -e $labfile ]; then + cp $labfile ./labconfig.yaml || true else - python genmaasconfig.py + wget $labconfigfile -t 3 -T 10 -O ./labconfig.yaml || true + count=`wc -l labconfig.yaml | cut -d " " -f 1` + if [ $count -lt 10 ]; then + rm -rf labconfig.yaml + fi fi - fi - - if [ ! -e ./labconfig.yaml ]; then - virtinstall=1 - cp ../labconfig/default/deployment.yaml ./ - cp ../labconfig/default/labconfig.yaml ./ - fi - labname=`grep "maas_name" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //'` -else - case "$1" in - 'intelpod5' ) - cp ../labconfig/intel/pod5/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'intelpod6' ) - cp ../labconfig/intel/pod6/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'intelpod9' ) - cp ../labconfig/intel/pod6/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'orangepod1' ) - cp ../labconfig/orange/pod1/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'orangepod2' ) - cp ../labconfig/orange/pod1/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'attvirpod1' ) - cp ../labconfig/att/virpod1/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'juniperpod1' ) - cp maas/juniper/pod1/deployment.yaml ./deployment.yaml - ;; - 'cengnpod1' ) - cp ../labconfig/cengn/pod1/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - 'cengnpod2' ) - cp ../labconfig/cengn/pod2/labconfig.yaml ./ - #to be removed later once converted for all labs. - python genmaasconfig.py - ;; - * ) + if [ ! -e ./labconfig.yaml ]; then virtinstall=1 - labname="default" - ./cleanvm.sh - cp ../labconfig/default/deployment.yaml ./ - cp ../labconfig/default/deployconfig.yaml ./ - ;; - esac + else + python genDeploymentConfig.py > deployment.yaml + python genMAASConfig.py > deployconfig.yaml + labname=`grep "maas_name" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //'` + fi + ;; + * ) + virtinstall=1 + ;; +esac + +# In the case of a virtual deployment get deployment.yaml and deployconfig.yaml +if [ "$virtinstall" -eq 1 ]; then + labname="default" + ./cleanvm.sh + cp ../labconfig/default/deployment.yaml ./ + cp ../labconfig/default/labconfig.yaml ./ + cp ../labconfig/default/deployconfig.yaml ./ fi -#make sure no password asked during the deployment. +# +# Prepare local environment to avoid password asking +# +# make sure no password asked during the deployment. echo "$USER ALL=(ALL) NOPASSWD:ALL" > 90-joid-init if [ -e /etc/sudoers.d/90-joid-init ]; then @@ -112,32 +94,25 @@ else sudo mv 90-joid-init /etc/sudoers.d/ fi -echo "... Deployment of maas Started ...." - if [ ! -e $HOME/.ssh/id_rsa ]; then ssh-keygen -N '' -f $HOME/.ssh/id_rsa fi -#define the pool and try to start even though its already exist. -# For fresh install this may or may not there. +echo "... Deployment of maas Started ...." +# +# Virsh preparation +# + +# define the pool and try to start even though its already exist. +# For fresh install this may or may not there. sudo apt-get install libvirt-bin -y sudo adduser $USER libvirtd sudo virsh pool-define-as default --type dir --target /var/lib/libvirt/images/ || true sudo virsh pool-start default || true sudo virsh pool-autostart default || true -# To avoid problem between apiclient/maas_client and apiclient from google -# we remove the package google-api-python-client from yardstick installer -if [ $(pip list |grep google-api-python-client |wc -l) == 1 ]; then - sudo pip uninstall google-api-python-client -fi - -sudo pip install shyaml -juju init -f - -cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys - +# In case of virtual install set network if [ "$virtinstall" -eq 1 ]; then sudo virsh net-dumpxml default > default-net-org.xml sudo sed -i '/dhcp/d' default-net-org.xml @@ -147,65 +122,44 @@ if [ "$virtinstall" -eq 1 ]; then sudo virsh net-start default fi -#Below function will mark the interfaces in Auto mode to enbled by MAAS -enableautomode() { - listofnodes=`maas maas nodes list | grep system_id | cut -d '"' -f 4` - for nodes in $listofnodes - do - maas maas interface link-subnet $nodes $1 mode=$2 subnet=$3 - done -} +# Ensure virsh can connect without ssh auth +cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys -#Below function will mark the interfaces in Auto mode to enbled by MAAS -# using hostname of the node added into MAAS -enableautomodebyname() { - if [ ! -z "$4" ]; then - for i in `seq 1 7`; - do - nodes=`maas maas nodes list hostname=node$i-$4 | grep system_id | cut -d '"' -f 4` - if [ ! -z "$nodes" ]; then - maas maas interface link-subnet $nodes $1 mode=$2 subnet=$3 - fi - done - fi -} +# +# Cleanup, juju init and config backup +# -#Below function will create vlan and update interface with the new vlan -# will return the vlan id created -crvlanupdsubnet() { - newvlanid=`maas maas vlans create $2 name=$3 vid=$4 | grep resource | cut -d '/' -f 6 ` - maas maas subnet update $5 vlan=$newvlanid - eval "$1"="'$newvlanid'" -} - -#Below function will create interface with new vlan and bind to physical interface -crnodevlanint() { - listofnodes=`maas maas nodes list | grep system_id | cut -d '"' -f 4` - - for nodes in $listofnodes - do - parentid=`maas maas interface read $nodes $2 | grep interfaces | cut -d '/' -f 8` - maas maas interfaces create-vlan $nodes vlan=$1 parent=$parentid - done - } +# To avoid problem between apiclient/maas_client and apiclient from google +# we remove the package google-api-python-client from yardstick installer +if [ $(pip list |grep google-api-python-client |wc -l) == 1 ]; then + sudo pip uninstall google-api-python-client +fi -#just make sure the ssh keys added into maas for the current user -sed --i "s@/home/ubuntu@$HOME@g" ./deployment.yaml -sed --i "s@qemu+ssh://ubuntu@qemu+ssh://$USER@g" ./deployment.yaml +# Init Juju +juju init -f +# Backup deployment.yaml and deployconfig.yaml in .juju folder cp ./deployment.yaml ~/.juju/ if [ -e ./deployconfig.yaml ]; then cp ./deployconfig.yaml ~/.juju/ fi +# +# MAAS deploy +# + sudo maas-deployer -c deployment.yaml -d --force sudo chown $USER:$USER environments.yaml echo "... Deployment of maas finish ...." +# +# MAAS Customization +# + maas_ip=`grep " ip_address" deployment.yaml | cut -d ':' -f 2 | sed -e 's/ //'` apikey=`grep maas-oauth: environments.yaml | cut -d "'" -f 2` maas login maas http://${maas_ip}/MAAS/api/1.0 ${apikey} @@ -215,7 +169,7 @@ maas maas sshkeys new key="`cat $HOME/.ssh/id_rsa.pub`" maas maas sshkeys new key="`cat ./maas/sshkeys/QtipKey.pub`" maas maas sshkeys new key="`cat ./maas/sshkeys/DominoKey.pub`" -#adding compute and control nodes VM to MAAS for deployment purpose. +#adding compute and control nodes VM to MAAS for virtual deployment purpose. if [ "$virtinstall" -eq 1 ]; then # create two more VMs to do the deployment. sudo virt-install --connect qemu:///system --name node1-control --ram 8192 --vcpus 4 --disk size=120,format=qcow2,bus=virtio,io=native,pool=default --network bridge=virbr0,model=virtio --network bridge=virbr0,model=virtio --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee node1-control @@ -248,49 +202,56 @@ if [ "$virtinstall" -eq 1 ]; then maas maas tag update-nodes compute add=$computenodeid fi -#read interface needed in Auto mode and enable it. Will be rmeoved once auto enablement will be implemented in the maas-deployer. -enable_if(){ - if [ -e ~/.juju/deployconfig.yaml ]; then - cp ~/.juju/deployconfig.yaml ./deployconfig.yaml - - enableiflist=`grep "interface-enable" deployconfig.yaml | cut -d ' ' -f 4 ` - datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` - stornet=`grep "storageNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` - pubnet=`grep "publicNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` - - # split EXTERNAL_NETWORK=first ip;last ip; gateway;network - - if [ "$datanet" != "''" ]; then - EXTNET=(${enableiflist//,/ }) - i="0" - while [ ! -z "${EXTNET[i]}" ]; - do - enableautomode ${EXTNET[i]} AUTO $datanet || true - i=$[$i+1] - done - fi - if [ "$stornet" != "''" ]; then - EXTNET=(${enableiflist//,/ }) - i="0" - while [ ! -z "${EXTNET[i]}" ]; - do - enableautomode ${EXTNET[i]} AUTO $stornet || true - i=$[$i+1] - done - fi - if [ "$pubnet" != "''" ]; then - EXTNET=(${enableiflist//,/ }) - i="0" - while [ ! -z "${EXTNET[i]}" ]; - do - enableautomode ${EXTNET[i]} AUTO $pubnet || true - i=$[$i+1] - done - fi - fi +# +# Functions for MAAS network customization +# + +#Below function will mark the interfaces in Auto mode to enbled by MAAS +enableautomode() { + listofnodes=`maas maas nodes list | grep system_id | cut -d '"' -f 4` + for nodes in $listofnodes + do + maas maas interface link-subnet $nodes $1 mode=$2 subnet=$3 + done } -# Enable vlan interfaces with maas +#Below function will mark the interfaces in Auto mode to enbled by MAAS +# using hostname of the node added into MAAS +enableautomodebyname() { + if [ ! -z "$4" ]; then + for i in `seq 1 7`; + do + nodes=`maas maas nodes list hostname=node$i-$4 | grep system_id | cut -d '"' -f 4` + if [ ! -z "$nodes" ]; then + maas maas interface link-subnet $nodes $1 mode=$2 subnet=$3 + fi + done + fi +} + +#Below function will create vlan and update interface with the new vlan +# will return the vlan id created +crvlanupdsubnet() { + newvlanid=`maas maas vlans create $2 name=$3 vid=$4 | grep resource | cut -d '/' -f 6 ` + maas maas subnet update $5 vlan=$newvlanid + eval "$1"="'$newvlanid'" +} + +#Below function will create interface with new vlan and bind to physical interface +crnodevlanint() { + listofnodes=`maas maas nodes list | grep system_id | cut -d '"' -f 4` + + for nodes in $listofnodes + do + parentid=`maas maas interface read $nodes $2 | grep interfaces | cut -d '/' -f 8` + maas maas interfaces create-vlan $nodes vlan=$1 parent=$parentid + done + } + +# +# VLAN customization +# + case "$labname" in 'intelpod9' ) maas refresh @@ -305,6 +266,51 @@ case "$labname" in ;; esac -enable_if +# +# Enable MAAS nodes interfaces +# + +#read interface needed in Auto mode and enable it. Will be rmeoved once auto enablement will be implemented in the maas-deployer. +if [ -e ~/.juju/deployconfig.yaml ]; then + cp ~/.juju/deployconfig.yaml ./deployconfig.yaml + + enableiflist=`grep "interface-enable" deployconfig.yaml | cut -d ' ' -f 4 ` + datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` + stornet=`grep "storageNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` + pubnet=`grep "publicNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'` + + # split EXTERNAL_NETWORK=first ip;last ip; gateway;network + + if [ "$datanet" != "''" ]; then + EXTNET=(${enableiflist//,/ }) + i="0" + while [ ! -z "${EXTNET[i]}" ]; + do + enableautomode ${EXTNET[i]} AUTO $datanet || true + i=$[$i+1] + done + fi + if [ "$stornet" != "''" ]; then + EXTNET=(${enableiflist//,/ }) + i="0" + while [ ! -z "${EXTNET[i]}" ]; + do + enableautomode ${EXTNET[i]} AUTO $stornet || true + i=$[$i+1] + done + fi + if [ "$pubnet" != "''" ]; then + EXTNET=(${enableiflist//,/ }) + i="0" + while [ ! -z "${EXTNET[i]}" ]; + do + enableautomode ${EXTNET[i]} AUTO $pubnet || true + i=$[$i+1] + done + fi +fi +# +# End of scripts +# echo " .... MAAS deployment finished successfully ...." diff --git a/ci/bundle_tpl/aodh.yaml b/ci/bundle_tpl/aodh.yaml deleted file mode 100644 index 271d3819..00000000 --- a/ci/bundle_tpl/aodh.yaml +++ /dev/null @@ -1,5 +0,0 @@ - aodh: - charm: "local:{{ ubuntu.release }}/aodh" - to: - - "lxc:nodes=0" -{# Empty block to avoid bad block trim #} diff --git a/ci/bundle_tpl/bundle.yaml b/ci/bundle_tpl/bundle.yaml deleted file mode 100644 index 8c08c1a2..00000000 --- a/ci/bundle_tpl/bundle.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# vim: set ts=2 et: -{{ ubuntu.release }}-{{ os.release }}-nodes: - inherits: openstack-phase1 - overrides: -{% include 'phase2-overrides.yaml' %} - -{{ ubuntu.release }}-{{ os.release }}: - inherits: openstack-phase2 - -openstack-phase1: - services: - nodes: - charm: "cs:{{ ubuntu.release }}/ubuntu" - num_units: {{ opnfv.units }} - ntp: - charm: "local:{{ ubuntu.release }}/ntp" -{% if os.network.controller == 'ocl' %} - options: - source: "0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org" - auto_peers: false -{% endif %} -{% include 'mysql.yaml' %} -{% include 'ceilometer.yaml' %} -{% include 'ceph.yaml' %} -{% include 'cinder.yaml' %} -{% include 'glance.yaml' %} -{% include 'opnfv-promise.yaml' %} -{% include 'congress.yaml' %} -{% include 'keystone.yaml' %} -{% include 'nova-cloud-controller.yaml' %} -{% include 'nova-compute.yaml' %} -{% include 'openstack-dashboard.yaml' %} -{% include 'rabbitmq.yaml' %} -{% include 'heat.yaml' %} -{% include 'neutron-api.yaml' %} -{% include 'neutron-gateway.yaml' %} -{% include 'aodh.yaml' %} -{% if os.network.controller == 'odl' %} -{% include 'odl.yaml' %} -{% elif os.network.controller == 'onos' %} -{% include 'onos.yaml' %} -{% elif os.network.controller == 'ocl' %} -{% include 'oclphase1.yaml' %} -{% endif %} -{% if os.ha.mode == 'ha' %} -{% include 'haclusters.yaml' %} -{% endif %} - - relations: - - [ 'ntp:juju-info', 'nodes:juju-info' ] -{% if os.ha.mode == 'ha' %} -{% include 'harelations.yaml' %} -{% endif %} - -openstack-phase2: - inherits: openstack-phase1 - relations: -{% include 'relations.yaml' %} - services: -{% include 'subordinate.yaml' %} diff --git a/ci/bundle_tpl/ceilometer.yaml b/ci/bundle_tpl/ceilometer.yaml deleted file mode 100644 index 031551a5..00000000 --- a/ci/bundle_tpl/ceilometer.yaml +++ /dev/null @@ -1,18 +0,0 @@ - mongodb: - charm: local:{{ ubuntu.release }}/mongodb - to: - - "lxc:nodes=0" - ceilometer: - charm: "local:{{ ubuntu.release }}/ceilometer" - num_units: {{ unit_qty() }} - options: -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.ceilometer }} -{% endif %} -{% if os.beta.public_api %} - os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/ceph.yaml b/ci/bundle_tpl/ceph.yaml deleted file mode 100644 index 82cfd283..00000000 --- a/ci/bundle_tpl/ceph.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{% if opnfv.storage_dict.ceph is defined %} - ceph: - charm: "local:{{ ubuntu.release }}/ceph" - num_units: {{ unit_ceph_qty() }} - options: - monitor-count: {{ unit_ceph_qty() }} - fsid: 5a791d94-980b-11e4-b6f6-3c970e8b1cf7 - monitor-secret: AQAi5a9UeJXUExAA+By9u+GPhl8/XiUQ4nwI3A== -{% if opnfv.spaces_dict.storage is defined %} - #ceph-cluster-network: {{ opnfv.spaces_dict.storage.cidr }} -{% endif %} - to: -{% for unit_id in to_select(unit_ceph_qty()) %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - ceph-osd: - charm: "local:{{ ubuntu.release }}/ceph-osd" - num_units: {{ opnfv.units }} - options: - osd-devices: {{ opnfv.storage_dict.ceph.disk }} - osd-reformat: 'yes' - to: -{% for unit_id in range(0, opnfv.units) %} - - "nodes={{ unit_id }}" -{% endfor %} - ceph-radosgw: - charm: "local:{{ ubuntu.release }}/ceph-radosgw" - num_units: {{ unit_qty() if os.beta.hacluster_ceph_radosgw else 1 }} - options: - use-embedded-webserver: true - operator-roles: "Member,admin" - to: -{% for unit_id in to_select(unit_qty() if os.beta.hacluster_ceph_radosgw else 1) %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} -{% endif %} diff --git a/ci/bundle_tpl/cinder.yaml b/ci/bundle_tpl/cinder.yaml deleted file mode 100644 index 4c1b8623..00000000 --- a/ci/bundle_tpl/cinder.yaml +++ /dev/null @@ -1,16 +0,0 @@ - cinder: - charm: "local:{{ ubuntu.release }}/cinder" - num_units: {{ unit_qty() }} - options: -{% if os.beta.public_api %} - os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - block-device: None - glance-api-version: 2 -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.cinder }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/congress.yaml b/ci/bundle_tpl/congress.yaml deleted file mode 100644 index 3d05295e..00000000 --- a/ci/bundle_tpl/congress.yaml +++ /dev/null @@ -1,9 +0,0 @@ - congress: - charm: "local:{{ ubuntu.release }}/congress" -{% if ubuntu.release == 'trusty' %} - options: - source-branch: "stable/{{ os.release }}" -{% endif %} - to: - - "lxc:nodes=0" -{# Empty block to avoid bad block trim #} diff --git a/ci/bundle_tpl/glance.yaml b/ci/bundle_tpl/glance.yaml deleted file mode 100644 index 84999326..00000000 --- a/ci/bundle_tpl/glance.yaml +++ /dev/null @@ -1,14 +0,0 @@ - glance: - charm: "local:{{ ubuntu.release }}/glance" - num_units: {{ unit_qty() }} - options: -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.glance }} -{% endif %} -{% if os.beta.public_api %} - os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/haclusters.yaml b/ci/bundle_tpl/haclusters.yaml deleted file mode 100644 index fc42d38e..00000000 --- a/ci/bundle_tpl/haclusters.yaml +++ /dev/null @@ -1,53 +0,0 @@ - - hacluster-keystone: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 - hacluster-cinder: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 -# hacluster-heat: -# charm: "local:{{ ubuntu.release }}/hacluster" -# options: -# corosync_transport: unicast -# cluster_count: 3 - hacluster-horizon: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 - hacluster-nova: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 - hacluster-neutron: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 - hacluster-glance: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 - hacluster-ceilometer: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 - hacluster-mysql: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 -{% if os.beta.hacluster_ceph_radosgw %} - hacluster-ceph-radosgw: - charm: "local:{{ ubuntu.release }}/hacluster" - options: - corosync_transport: unicast - cluster_count: 3 -{% endif %} diff --git a/ci/bundle_tpl/harelations.yaml b/ci/bundle_tpl/harelations.yaml deleted file mode 100644 index d4c4c064..00000000 --- a/ci/bundle_tpl/harelations.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{% if os.ha.mode == 'ha' %} - - [ 'mysql:ha', 'hacluster-mysql:ha' ] - - [ 'cinder:ha', 'hacluster-cinder:ha' ] -# - [ 'heat:ha', 'hacluster-heat:ha' ] - - [ 'glance:ha', 'hacluster-glance:ha' ] - - [ 'keystone:ha', 'hacluster-keystone:ha' ] - - [ 'neutron-api:ha', 'hacluster-neutron:ha' ] - - [ 'nova-cloud-controller:ha', 'hacluster-nova:ha' ] - - [ 'openstack-dashboard:ha', 'hacluster-horizon:ha' ] - - [ 'ceilometer:ha', 'hacluster-ceilometer:ha' ] -{% if os.beta.hacluster_ceph_radosgw %} - - [ 'ceph-radosgw:ha', 'hacluster-ceph-radosgw:ha' ] -{% endif %} -{% endif %} diff --git a/ci/bundle_tpl/heat.yaml b/ci/bundle_tpl/heat.yaml deleted file mode 100644 index 4fe9deb7..00000000 --- a/ci/bundle_tpl/heat.yaml +++ /dev/null @@ -1,13 +0,0 @@ - heat: - charm: "local:{{ ubuntu.release }}/heat" -# num_units: {{ unit_qty() }} - options: -{% if os.ha.mode == 'ha' %} -# vip: {{ opnfv.vip.heat }} -{% endif %} -{% if os.beta.public_api %} -# os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - to: - - "lxc:nodes=0" -{# Empty block to avoid bad block trim #} diff --git a/ci/bundle_tpl/keystone.yaml b/ci/bundle_tpl/keystone.yaml deleted file mode 100644 index 24f5b102..00000000 --- a/ci/bundle_tpl/keystone.yaml +++ /dev/null @@ -1,16 +0,0 @@ - keystone: - charm: "local:{{ ubuntu.release }}/keystone" - num_units: {{ unit_qty() }} - options: - admin-password: {{ opnfv.admin_password | default(os.admin.password) }} - admin-token: {{ os.admin.name }} -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.keystone }} -{% endif %} -{% if os.beta.public_api %} - os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/mysql.yaml b/ci/bundle_tpl/mysql.yaml deleted file mode 100644 index 110140e9..00000000 --- a/ci/bundle_tpl/mysql.yaml +++ /dev/null @@ -1,17 +0,0 @@ - mysql: - charm: "local:{{ ubuntu.release }}/percona-cluster" - num_units: {{ unit_qty() }} - options: - innodb-buffer-pool-size: 100M - #lp1366997-workaround: true - max-connections: 20000 - root-password: {{ get_password('mysql_root') }} - sst-password: {{ get_password('mysql_sst') }} -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.mysql }} -{% endif %} - min-cluster-size: {{ unit_qty() }} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/neutron-api.yaml b/ci/bundle_tpl/neutron-api.yaml deleted file mode 100644 index 9ee914ae..00000000 --- a/ci/bundle_tpl/neutron-api.yaml +++ /dev/null @@ -1,26 +0,0 @@ - neutron-api: - charm: "local:{{ ubuntu.release }}/neutron-api" - num_units: {{ unit_qty() }} - options: - neutron-security-groups: true -{% if os.network.controller == 'nosdn' %} - flat-network-providers: "*" -{% if os.network.dvr %} - overlay-network-type: vxlan -{% endif %} -{% elif os.network.controller == 'odl' %} - manage-neutron-plugin-legacy-mode: False -{% elif os.network.controller == 'onos' %} - flat-network-providers: "*" - manage-neutron-plugin-legacy-mode: False -{% endif %} -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.neutron }} -{% endif %} -{% if os.beta.public_api %} - os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/neutron-gateway.yaml b/ci/bundle_tpl/neutron-gateway.yaml deleted file mode 100644 index 74743ef7..00000000 --- a/ci/bundle_tpl/neutron-gateway.yaml +++ /dev/null @@ -1,46 +0,0 @@ - neutron-gateway: - charm: "local:{{ ubuntu.release }}/neutron-gateway" - options: -{% if opnfv.spaces_dict.data is defined %} - os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% else %} - #os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% endif %} -{% if os.network.controller == 'nosdn' %} -{% if opnfv.ext_port is defined %} -{% if opnfv.data_port is defined %} - bridge-mappings: physnet1:br-data external:br-ex - data-port: br-data:{{ opnfv.data_port }} br-ex:{{ opnfv.ext_port }} -{% else %} - bridge-mappings: external:br-ex - data-port: br-ex:{{ opnfv.ext_port }} -{% endif %} -{% endif %} -{% elif os.network.controller == 'onos' %} - plugin: onos -{% if opnfv.ext_port is defined %} -{% if opnfv.data_port is defined %} - bridge-mappings: physnet1:br-data external:br-ex - data-port: br-data:{{ opnfv.data_port }} br-ex:{{ opnfv.ext_port }} -{% else %} - bridge-mappings: external:br-ex - data-port: br-ex:{{ opnfv.ext_port }} -{% endif %} -{% endif %} -{% if os.network.sfc %} - profile: onos-sfc -{% endif %} -{% elif os.network.controller == 'odl' %} - plugin: ovs-odl -{% if opnfv.ext_port is defined %} - ext-port: {{ opnfv.ext_port }} -{% endif %} -{% else %} -{% if opnfv.ext_port is defined %} - ext-port: {{ opnfv.ext_port }} -{% endif %} -{% endif %} - instance-mtu: 1400 - to: - - "nodes=0" -{# Empty block to avoid bad block trim #} diff --git a/ci/bundle_tpl/neutron-ovs.yaml b/ci/bundle_tpl/neutron-ovs.yaml deleted file mode 100644 index 087783d8..00000000 --- a/ci/bundle_tpl/neutron-ovs.yaml +++ /dev/null @@ -1,31 +0,0 @@ - neutron-openvswitch: - charm: local:{{ ubuntu.release }}/neutron-openvswitch - options: -{% if opnfv.spaces_dict.data is defined %} - os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% else %} - #os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% endif %} -{% if os.network.dpdk %} - enable-dpdk: true - #dpdk-driver: uio_pci_generic - #data-port: "" - #default-socket-memory: 1024 - #default-socket-cores: 1 -{% endif %} -{% if opnfv.ext_port is defined %} -{% if os.network.dvr %} -{% if os.network.controller == 'nosdn' %} -{% if opnfv.data_port is defined %} - bridge-mappings: physnet1:br-data external:br-ex - data-port: br-data:{{ opnfv.data_port }} br-ex:{{ opnfv.ext_port }} -{% else %} - bridge-mappings: external:br-ex - data-port: br-ex:{{ opnfv.ext_port }} -{% endif %} -{% else %} - ext-port: {{ opnfv.ext_port }} -{% endif %} -{% endif %} -{% endif %} -{# Empty block to avoid bad block trim #} diff --git a/ci/bundle_tpl/nova-cloud-controller.yaml b/ci/bundle_tpl/nova-cloud-controller.yaml deleted file mode 100644 index bdf1090a..00000000 --- a/ci/bundle_tpl/nova-cloud-controller.yaml +++ /dev/null @@ -1,21 +0,0 @@ - nova-cloud-controller: - charm: "local:{{ ubuntu.release }}/nova-cloud-controller" - num_units: {{ unit_qty() }} - options: - #console-access-protocol: novnc - neutron-external-network: ext-net - service-guard: true -{% if opnfv.domain is defined %} - console-proxy-ip: {{ opnfv.domain }} -{% endif %} - network-manager: Neutron -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.nova }} -{% endif %} -{% if os.beta.public_api %} - os-public-hostname: api.{{ opnfv.domain }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/nova-compute.yaml b/ci/bundle_tpl/nova-compute.yaml deleted file mode 100644 index 81803807..00000000 --- a/ci/bundle_tpl/nova-compute.yaml +++ /dev/null @@ -1,18 +0,0 @@ - nova-compute: - charm: "local:{{ ubuntu.release }}/nova-compute" - num_units: {{ opnfv.units - 1 }} - options: - enable-live-migration: true - enable-resize: true - manage-neutron-plugin-legacy-mode: false - migration-auth-type: ssh -{% if os.beta.huge_pages %} - hugepages: "50%" -{% endif %} -{% if os.lxd %} - virt-type: lxd -{% endif %} - to: -{% for unit_id in range(1, opnfv.units) %} - - "nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/oclphase1.yaml b/ci/bundle_tpl/oclphase1.yaml deleted file mode 100644 index afef96c0..00000000 --- a/ci/bundle_tpl/oclphase1.yaml +++ /dev/null @@ -1,58 +0,0 @@ - zookeeper: - charm: local:precise/zookeeper - num_units: {{ unit_qty() }} - series: precise - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - cassandra: - charm: local:{{ ubuntu.release }}/cassandra - num_units: {{ unit_qty() }} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - options: - authenticator: AllowAllAuthenticator - contrail-configuration: - charm: local:{{ ubuntu.release }}/contrail-configuration - num_units: {{ unit_qty() }} - options: -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.contrailconfig }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - contrail-control: - charm: local:{{ ubuntu.release }}/contrail-control - num_units: {{ unit_qty() }} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - contrail-analytics: - charm: local:{{ ubuntu.release }}/contrail-analytics - num_units: {{ unit_qty() }} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - contrail-webui: - charm: local:{{ ubuntu.release }}/contrail-webui - num_units: {{ unit_qty() }} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} - haproxy: - charm: local:{{ ubuntu.release }}/haproxy - num_units: {{ unit_qty() }} - options: - peering_mode: active-active - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/odl.yaml b/ci/bundle_tpl/odl.yaml deleted file mode 100644 index 30f555c9..00000000 --- a/ci/bundle_tpl/odl.yaml +++ /dev/null @@ -1,17 +0,0 @@ - odl-controller: - charm: local:{{ ubuntu.release }}/odl-controller - options: - install-url: "https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.2-Beryllium-SR2/distribution-karaf-0.4.2-Beryllium-SR2.tar.gz" -{% if os.network.sfc %} - profile: "openvswitch-odl-beryllium-sfc" -{% elif os.network.bgpvpn %} - profile: "openvswitch-odl-beryllium-vpn" -{% elif os.network.odll3 %} - profile: "openvswitch-odl-beryllium-l3" -{% else %} - profile: "openvswitch-odl-beryllium" -{% endif %} - http-proxy: "http://squid.internal:3128" - https-proxy: "http://squid.internal:3128" - to: - - "lxc:nodes=0" diff --git a/ci/bundle_tpl/onos.yaml b/ci/bundle_tpl/onos.yaml deleted file mode 100644 index fd08c717..00000000 --- a/ci/bundle_tpl/onos.yaml +++ /dev/null @@ -1,9 +0,0 @@ - onos-controller: - charm: local:{{ ubuntu.release }}/onos-controller - options: -{% if opnfv.ext_port is defined %} - ext-port: {{ opnfv.ext_port }} -{% endif %} - #gateway-mac: "default" - to: - - "lxc:nodes=0" diff --git a/ci/bundle_tpl/openstack-dashboard.yaml b/ci/bundle_tpl/openstack-dashboard.yaml deleted file mode 100644 index 83408dcd..00000000 --- a/ci/bundle_tpl/openstack-dashboard.yaml +++ /dev/null @@ -1,16 +0,0 @@ - openstack-dashboard: - charm: "local:{{ ubuntu.release }}/openstack-dashboard" - num_units: {{ unit_qty() }} - options: - secret: admin - webroot: / -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.dashboard }} -{% endif %} -{% if os.beta.public_api %} - endpoint-type: internalURL -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/opnfv-promise.yaml b/ci/bundle_tpl/opnfv-promise.yaml deleted file mode 100644 index 4e96cf73..00000000 --- a/ci/bundle_tpl/opnfv-promise.yaml +++ /dev/null @@ -1,5 +0,0 @@ - opnfv-promise: - charm: local:{{ ubuntu.release }}/promise - to: - - "lxc:nodes=0" -{# Empty block to avoid bad block trim #} diff --git a/ci/bundle_tpl/phase2-overrides.yaml b/ci/bundle_tpl/phase2-overrides.yaml deleted file mode 100644 index 33350300..00000000 --- a/ci/bundle_tpl/phase2-overrides.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{% if opnfv.spaces_dict.storage is defined %} - #ceph-cluster-network: {{ opnfv.spaces_dict.storage.cidr }} -{% endif %} -{% if os.network.ipv6 %} - prefer-ipv6: {{ os.network.ipv6 }} -{% endif %} -{% if os.network.dvr %} - enable-dvr: true -{% endif %} -{% if os.network.l2_population %} - l2-population: true -{% endif %} - region: {{ os.region }} -{% if ubuntu.release == 'trusty' %} - source: "cloud:{{ ubuntu.release }}-{{ os.release }}" -{% endif %} - openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}" -{% if os.ha.mode == 'nonha' %} - ceph-osd-replication-count: {{ unit_ceph_qty() }} -{% endif %} - admin-role: {{ os.admin.role }} - keystone-admin-role: {{ os.admin.role }} -{% if os.beta.public_api %} - use-internal-endpoints: true -{% endif %} diff --git a/ci/bundle_tpl/rabbitmq.yaml b/ci/bundle_tpl/rabbitmq.yaml deleted file mode 100644 index 1020340f..00000000 --- a/ci/bundle_tpl/rabbitmq.yaml +++ /dev/null @@ -1,12 +0,0 @@ - rabbitmq-server: - charm: "local:{{ ubuntu.release }}/rabbitmq-server" - num_units: {{ unit_qty() }} - options: -{% if os.ha.mode == 'ha' %} - vip: {{ opnfv.vip.rabbitmq }} - min-cluster-size: {{ unit_qty() }} -{% endif %} - to: -{% for unit_id in to_select() %} - - "lxc:nodes={{ unit_id }}" -{% endfor %} diff --git a/ci/bundle_tpl/relations.yaml b/ci/bundle_tpl/relations.yaml deleted file mode 100644 index 4cf24385..00000000 --- a/ci/bundle_tpl/relations.yaml +++ /dev/null @@ -1,95 +0,0 @@ - - [ 'nova-compute:amqp', 'rabbitmq-server:amqp' ] - - [ 'neutron-gateway:amqp', 'rabbitmq-server:amqp' ] - - [ 'keystone:shared-db', 'mysql:shared-db' ] - - [ 'nova-cloud-controller:identity-service', 'keystone:identity-service' ] - - [ 'glance:identity-service', 'keystone:identity-service' ] - - [ 'neutron-api:identity-service', 'keystone:identity-service' ] - - [ 'neutron-api:shared-db', 'mysql:shared-db' ] - - [ 'neutron-api:amqp', 'rabbitmq-server:amqp' ] - - [ 'neutron-gateway:neutron-plugin-api', 'neutron-api:neutron-plugin-api' ] - - [ 'glance:shared-db', 'mysql:shared-db' ] - - [ 'glance:amqp', 'rabbitmq-server:amqp' ] - - [ 'nova-cloud-controller:image-service', 'glance:image-service' ] - - [ 'nova-compute:image-service', 'glance:image-service' ] - - [ 'nova-cloud-controller:cloud-compute', 'nova-compute:cloud-compute' ] - - [ 'nova-cloud-controller:amqp', 'rabbitmq-server:amqp' ] - - [ 'nova-cloud-controller:quantum-network-service', 'neutron-gateway:quantum-network-service' ] - - [ 'openstack-dashboard:identity-service', 'keystone:identity-service' ] - - [ 'nova-cloud-controller:shared-db', 'mysql:shared-db' ] - - [ 'nova-cloud-controller:neutron-api', 'neutron-api:neutron-api' ] - - [ 'cinder:image-service', 'glance:image-service' ] - - [ 'cinder:amqp', 'rabbitmq-server:amqp' ] - - [ 'cinder:identity-service', 'keystone:identity-service' ] - - [ 'cinder:cinder-volume-service', 'nova-cloud-controller:cinder-volume-service' ] - - [ 'cinder-ceph:storage-backend', 'cinder:storage-backend' ] - - [ 'ceph:client', 'nova-compute:ceph' ] - - [ 'cinder:shared-db', 'mysql:shared-db' ] - - [ 'ceph:client', 'cinder-ceph:ceph' ] - - [ 'ceph:client', 'glance:ceph' ] - - [ 'ceph-osd:mon', 'ceph:osd' ] - - [ 'ceph-radosgw:mon', 'ceph:radosgw' ] - - [ 'ceph-radosgw:identity-service', 'keystone:identity-service' ] - - [ 'ceilometer:amqp', 'rabbitmq-server:amqp' ] - - [ 'ceilometer-agent:ceilometer-service', 'ceilometer:ceilometer-service' ] - - [ 'ceilometer:identity-service', 'keystone:identity-service' ] - - [ 'ceilometer:identity-notifications', 'keystone:identity-notifications' ] - - [ 'ceilometer-agent:nova-ceilometer', 'nova-compute:nova-ceilometer' ] - - [ 'ceilometer:shared-db', 'mongodb:database' ] - - [ 'heat:shared-db', 'mysql:shared-db' ] - - [ 'heat:identity-service', 'keystone:identity-service' ] - - [ 'heat:amqp', 'rabbitmq-server:amqp' ] - - [ 'congress:shared-db', 'mysql:shared-db' ] - - [ 'congress:identity-service', 'keystone:identity-service' ] - - [ 'congress:amqp', 'rabbitmq-server:amqp' ] - - [ 'aodh:amqp', 'rabbitmq-server:amqp' ] - - [ 'aodh:shared-db', 'mysql:shared-db' ] - - [ 'aodh:identity-service', 'keystone:identity-service' ] -{% if os.lxd %} - - [ 'nova-compute:lxd', 'lxd:lxd' ] -{% endif %} -{% if os.network.controller == 'nosdn' %} - - [ 'neutron-openvswitch:amqp', 'rabbitmq-server:amqp' ] - - [ 'nova-compute:neutron-plugin', 'neutron-openvswitch:neutron-plugin' ] - - [ 'neutron-openvswitch:neutron-plugin-api', 'neutron-api:neutron-plugin-api' ] -{% elif os.network.controller == 'odl' %} - - [ 'neutron-api:neutron-plugin-api-subordinate', 'neutron-api-odl:neutron-plugin-api-subordinate' ] - - [ 'nova-compute:neutron-plugin', 'openvswitch-odl:neutron-plugin' ] - - [ 'neutron-gateway', 'openvswitch-odl' ] - - [ 'openvswitch-odl:ovsdb-manager', 'odl-controller:ovsdb-manager' ] - - [ 'neutron-api-odl:odl-controller', 'odl-controller:controller-api' ] -{% elif os.network.controller == 'onos' %} - - [ 'neutron-api:neutron-plugin-api-subordinate', 'neutron-api-onos:neutron-plugin-api-subordinate' ] - - [ 'nova-compute:neutron-plugin', 'openvswitch-onos:neutron-plugin' ] - - [ 'neutron-gateway', 'openvswitch-onos' ] - - [ 'openvswitch-onos:ovsdb-manager', 'onos-controller:ovsdb-manager' ] - - [ 'neutron-api-onos:onos-controller', 'onos-controller:controller-api' ] -{% elif os.network.controller == 'ocl' %} - - [ 'contrail-configuration:cassandra', 'cassandra:database' ] - - [ 'contrail-configuration', 'zookeeper' ] - - [ 'contrail-configuration', 'rabbitmq-server' ] - - [ 'contrail-configuration', 'keystone' ] - - [ 'neutron-api-contrail', 'contrail-configuration' ] - - [ 'neutron-api-contrail', 'keystone' ] - - [ 'contrail-control:contrail-api', 'contrail-configuration:contrail-api' ] - - [ 'contrail-control:contrail-discovery', 'contrail-configuration:contrail-discovery' ] - - [ 'contrail-control:contrail-ifmap', 'contrail-configuration:contrail-ifmap' ] - - [ 'contrail-control', 'keystone' ] - - [ 'contrail-analytics:cassandra', 'cassandra:database' ] - - [ 'contrail-analytics:contrail-analytics-api', 'contrail-configuration:contrail-analytics-api' ] - - [ 'contrail-configuration:contrail-discovery', 'contrail-analytics:contrail-discovery' ] - - [ 'contrail-webui', 'keystone' ] - - [ 'contrail-webui:contrail_api', 'contrail-configuration:contrail-api' ] - - [ 'contrail-webui:contrail_discovery', 'contrail-configuration:contrail-discovery' ] - - [ 'contrail-webui:cassandra', 'cassandra:database' ] - - [ 'nova-compute', 'neutron-contrail' ] - - [ 'neutron-contrail:contrail-discovery', 'contrail-configuration:contrail-discovery' ] - - [ 'neutron-contrail:contrail-api', 'contrail-configuration:contrail-api' ] - - [ 'neutron-contrail', 'keystone' ] - - [ 'contrail-configuration', 'ntp' ] - - [ 'contrail-control', 'ntp' ] - - [ 'contrail-analytics', 'ntp' ] - - [ 'contrail-configuration', 'haproxy' ] - - [ 'contrail-analytics', 'haproxy' ] - - [ 'contrail-webui', 'haproxy' ] - - [ 'haproxy', 'keepalived' ] -{% endif %} diff --git a/ci/bundle_tpl/subordinate.yaml b/ci/bundle_tpl/subordinate.yaml deleted file mode 100644 index aea5232c..00000000 --- a/ci/bundle_tpl/subordinate.yaml +++ /dev/null @@ -1,55 +0,0 @@ - ceilometer-agent: - charm: local:{{ ubuntu.release }}/ceilometer-agent -{% if opnfv.storage_dict.ceph is defined %} - cinder-ceph: - charm: local:{{ ubuntu.release }}/cinder-ceph -{% endif %} -{% if os.network.controller == 'nosdn' %} -{% include 'neutron-ovs.yaml' %} -{% elif os.network.controller == 'odl' %} - neutron-api-odl: - charm: local:{{ ubuntu.release }}/neutron-api-odl - options: - overlay-network-type: 'vxlan' - security-groups: True - openvswitch-odl: - charm: local:{{ ubuntu.release }}/openvswitch-odl - options: -{% if opnfv.spaces_dict.data is defined %} - os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% else %} - #os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% endif %} -{% elif os.network.controller == 'onos' %} - neutron-api-onos: - charm: local:{{ ubuntu.release }}/neutron-api-onos - options: - overlay-network-type: 'vxlan' - security-groups: True - openvswitch-onos: - charm: local:{{ ubuntu.release }}/openvswitch-onos - options: -{% if opnfv.spaces_dict.data is defined %} - os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% else %} - #os-data-network: {{ opnfv.spaces_dict.data.cidr }} -{% endif %} -{% if os.network.sfc %} - profile: onos-sfc -{% endif %} -{% elif os.network.controller == 'ocl' %} - neutron-api-contrail: - charm: local:{{ ubuntu.release }}/neutron-api-contrail - neutron-contrail: - charm: local:{{ ubuntu.release }}/neutron-contrail - keepalived: - charm: local:{{ ubuntu.release }}/keepalived - options: -{% if os.ha.mode == 'ha' %} - virtual-ip: {{ opnfv.vip.keepalived }} -{% endif %} -{% endif %} -{% if os.lxd %} - lxd: - charm: local:{{ ubuntu.release }}/lxd -{% endif %} diff --git a/ci/config_tpl/bundle_tpl/aodh.yaml b/ci/config_tpl/bundle_tpl/aodh.yaml new file mode 100644 index 00000000..271d3819 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/aodh.yaml @@ -0,0 +1,5 @@ + aodh: + charm: "local:{{ ubuntu.release }}/aodh" + to: + - "lxc:nodes=0" +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/bundle_tpl/bundle.yaml b/ci/config_tpl/bundle_tpl/bundle.yaml new file mode 100644 index 00000000..8c08c1a2 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/bundle.yaml @@ -0,0 +1,60 @@ +# vim: set ts=2 et: +{{ ubuntu.release }}-{{ os.release }}-nodes: + inherits: openstack-phase1 + overrides: +{% include 'phase2-overrides.yaml' %} + +{{ ubuntu.release }}-{{ os.release }}: + inherits: openstack-phase2 + +openstack-phase1: + services: + nodes: + charm: "cs:{{ ubuntu.release }}/ubuntu" + num_units: {{ opnfv.units }} + ntp: + charm: "local:{{ ubuntu.release }}/ntp" +{% if os.network.controller == 'ocl' %} + options: + source: "0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org 3.ubuntu.pool.ntp.org" + auto_peers: false +{% endif %} +{% include 'mysql.yaml' %} +{% include 'ceilometer.yaml' %} +{% include 'ceph.yaml' %} +{% include 'cinder.yaml' %} +{% include 'glance.yaml' %} +{% include 'opnfv-promise.yaml' %} +{% include 'congress.yaml' %} +{% include 'keystone.yaml' %} +{% include 'nova-cloud-controller.yaml' %} +{% include 'nova-compute.yaml' %} +{% include 'openstack-dashboard.yaml' %} +{% include 'rabbitmq.yaml' %} +{% include 'heat.yaml' %} +{% include 'neutron-api.yaml' %} +{% include 'neutron-gateway.yaml' %} +{% include 'aodh.yaml' %} +{% if os.network.controller == 'odl' %} +{% include 'odl.yaml' %} +{% elif os.network.controller == 'onos' %} +{% include 'onos.yaml' %} +{% elif os.network.controller == 'ocl' %} +{% include 'oclphase1.yaml' %} +{% endif %} +{% if os.ha.mode == 'ha' %} +{% include 'haclusters.yaml' %} +{% endif %} + + relations: + - [ 'ntp:juju-info', 'nodes:juju-info' ] +{% if os.ha.mode == 'ha' %} +{% include 'harelations.yaml' %} +{% endif %} + +openstack-phase2: + inherits: openstack-phase1 + relations: +{% include 'relations.yaml' %} + services: +{% include 'subordinate.yaml' %} diff --git a/ci/config_tpl/bundle_tpl/ceilometer.yaml b/ci/config_tpl/bundle_tpl/ceilometer.yaml new file mode 100644 index 00000000..031551a5 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/ceilometer.yaml @@ -0,0 +1,18 @@ + mongodb: + charm: local:{{ ubuntu.release }}/mongodb + to: + - "lxc:nodes=0" + ceilometer: + charm: "local:{{ ubuntu.release }}/ceilometer" + num_units: {{ unit_qty() }} + options: +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.ceilometer }} +{% endif %} +{% if os.beta.public_api %} + os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/ceph.yaml b/ci/config_tpl/bundle_tpl/ceph.yaml new file mode 100644 index 00000000..82cfd283 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/ceph.yaml @@ -0,0 +1,36 @@ +{% if opnfv.storage_dict.ceph is defined %} + ceph: + charm: "local:{{ ubuntu.release }}/ceph" + num_units: {{ unit_ceph_qty() }} + options: + monitor-count: {{ unit_ceph_qty() }} + fsid: 5a791d94-980b-11e4-b6f6-3c970e8b1cf7 + monitor-secret: AQAi5a9UeJXUExAA+By9u+GPhl8/XiUQ4nwI3A== +{% if opnfv.spaces_dict.storage is defined %} + #ceph-cluster-network: {{ opnfv.spaces_dict.storage.cidr }} +{% endif %} + to: +{% for unit_id in to_select(unit_ceph_qty()) %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + ceph-osd: + charm: "local:{{ ubuntu.release }}/ceph-osd" + num_units: {{ opnfv.units }} + options: + osd-devices: {{ opnfv.storage_dict.ceph.disk }} + osd-reformat: 'yes' + to: +{% for unit_id in range(0, opnfv.units) %} + - "nodes={{ unit_id }}" +{% endfor %} + ceph-radosgw: + charm: "local:{{ ubuntu.release }}/ceph-radosgw" + num_units: {{ unit_qty() if os.beta.hacluster_ceph_radosgw else 1 }} + options: + use-embedded-webserver: true + operator-roles: "Member,admin" + to: +{% for unit_id in to_select(unit_qty() if os.beta.hacluster_ceph_radosgw else 1) %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} +{% endif %} diff --git a/ci/config_tpl/bundle_tpl/cinder.yaml b/ci/config_tpl/bundle_tpl/cinder.yaml new file mode 100644 index 00000000..4c1b8623 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/cinder.yaml @@ -0,0 +1,16 @@ + cinder: + charm: "local:{{ ubuntu.release }}/cinder" + num_units: {{ unit_qty() }} + options: +{% if os.beta.public_api %} + os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + block-device: None + glance-api-version: 2 +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.cinder }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/congress.yaml b/ci/config_tpl/bundle_tpl/congress.yaml new file mode 100644 index 00000000..3d05295e --- /dev/null +++ b/ci/config_tpl/bundle_tpl/congress.yaml @@ -0,0 +1,9 @@ + congress: + charm: "local:{{ ubuntu.release }}/congress" +{% if ubuntu.release == 'trusty' %} + options: + source-branch: "stable/{{ os.release }}" +{% endif %} + to: + - "lxc:nodes=0" +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/bundle_tpl/glance.yaml b/ci/config_tpl/bundle_tpl/glance.yaml new file mode 100644 index 00000000..84999326 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/glance.yaml @@ -0,0 +1,14 @@ + glance: + charm: "local:{{ ubuntu.release }}/glance" + num_units: {{ unit_qty() }} + options: +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.glance }} +{% endif %} +{% if os.beta.public_api %} + os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/haclusters.yaml b/ci/config_tpl/bundle_tpl/haclusters.yaml new file mode 100644 index 00000000..fc42d38e --- /dev/null +++ b/ci/config_tpl/bundle_tpl/haclusters.yaml @@ -0,0 +1,53 @@ + + hacluster-keystone: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 + hacluster-cinder: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 +# hacluster-heat: +# charm: "local:{{ ubuntu.release }}/hacluster" +# options: +# corosync_transport: unicast +# cluster_count: 3 + hacluster-horizon: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 + hacluster-nova: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 + hacluster-neutron: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 + hacluster-glance: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 + hacluster-ceilometer: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 + hacluster-mysql: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 +{% if os.beta.hacluster_ceph_radosgw %} + hacluster-ceph-radosgw: + charm: "local:{{ ubuntu.release }}/hacluster" + options: + corosync_transport: unicast + cluster_count: 3 +{% endif %} diff --git a/ci/config_tpl/bundle_tpl/harelations.yaml b/ci/config_tpl/bundle_tpl/harelations.yaml new file mode 100644 index 00000000..d4c4c064 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/harelations.yaml @@ -0,0 +1,14 @@ +{% if os.ha.mode == 'ha' %} + - [ 'mysql:ha', 'hacluster-mysql:ha' ] + - [ 'cinder:ha', 'hacluster-cinder:ha' ] +# - [ 'heat:ha', 'hacluster-heat:ha' ] + - [ 'glance:ha', 'hacluster-glance:ha' ] + - [ 'keystone:ha', 'hacluster-keystone:ha' ] + - [ 'neutron-api:ha', 'hacluster-neutron:ha' ] + - [ 'nova-cloud-controller:ha', 'hacluster-nova:ha' ] + - [ 'openstack-dashboard:ha', 'hacluster-horizon:ha' ] + - [ 'ceilometer:ha', 'hacluster-ceilometer:ha' ] +{% if os.beta.hacluster_ceph_radosgw %} + - [ 'ceph-radosgw:ha', 'hacluster-ceph-radosgw:ha' ] +{% endif %} +{% endif %} diff --git a/ci/config_tpl/bundle_tpl/heat.yaml b/ci/config_tpl/bundle_tpl/heat.yaml new file mode 100644 index 00000000..4fe9deb7 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/heat.yaml @@ -0,0 +1,13 @@ + heat: + charm: "local:{{ ubuntu.release }}/heat" +# num_units: {{ unit_qty() }} + options: +{% if os.ha.mode == 'ha' %} +# vip: {{ opnfv.vip.heat }} +{% endif %} +{% if os.beta.public_api %} +# os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + to: + - "lxc:nodes=0" +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/bundle_tpl/keystone.yaml b/ci/config_tpl/bundle_tpl/keystone.yaml new file mode 100644 index 00000000..24f5b102 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/keystone.yaml @@ -0,0 +1,16 @@ + keystone: + charm: "local:{{ ubuntu.release }}/keystone" + num_units: {{ unit_qty() }} + options: + admin-password: {{ opnfv.admin_password | default(os.admin.password) }} + admin-token: {{ os.admin.name }} +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.keystone }} +{% endif %} +{% if os.beta.public_api %} + os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/mysql.yaml b/ci/config_tpl/bundle_tpl/mysql.yaml new file mode 100644 index 00000000..110140e9 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/mysql.yaml @@ -0,0 +1,17 @@ + mysql: + charm: "local:{{ ubuntu.release }}/percona-cluster" + num_units: {{ unit_qty() }} + options: + innodb-buffer-pool-size: 100M + #lp1366997-workaround: true + max-connections: 20000 + root-password: {{ get_password('mysql_root') }} + sst-password: {{ get_password('mysql_sst') }} +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.mysql }} +{% endif %} + min-cluster-size: {{ unit_qty() }} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/neutron-api.yaml b/ci/config_tpl/bundle_tpl/neutron-api.yaml new file mode 100644 index 00000000..9ee914ae --- /dev/null +++ b/ci/config_tpl/bundle_tpl/neutron-api.yaml @@ -0,0 +1,26 @@ + neutron-api: + charm: "local:{{ ubuntu.release }}/neutron-api" + num_units: {{ unit_qty() }} + options: + neutron-security-groups: true +{% if os.network.controller == 'nosdn' %} + flat-network-providers: "*" +{% if os.network.dvr %} + overlay-network-type: vxlan +{% endif %} +{% elif os.network.controller == 'odl' %} + manage-neutron-plugin-legacy-mode: False +{% elif os.network.controller == 'onos' %} + flat-network-providers: "*" + manage-neutron-plugin-legacy-mode: False +{% endif %} +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.neutron }} +{% endif %} +{% if os.beta.public_api %} + os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/neutron-gateway.yaml b/ci/config_tpl/bundle_tpl/neutron-gateway.yaml new file mode 100644 index 00000000..74743ef7 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/neutron-gateway.yaml @@ -0,0 +1,46 @@ + neutron-gateway: + charm: "local:{{ ubuntu.release }}/neutron-gateway" + options: +{% if opnfv.spaces_dict.data is defined %} + os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% else %} + #os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% endif %} +{% if os.network.controller == 'nosdn' %} +{% if opnfv.ext_port is defined %} +{% if opnfv.data_port is defined %} + bridge-mappings: physnet1:br-data external:br-ex + data-port: br-data:{{ opnfv.data_port }} br-ex:{{ opnfv.ext_port }} +{% else %} + bridge-mappings: external:br-ex + data-port: br-ex:{{ opnfv.ext_port }} +{% endif %} +{% endif %} +{% elif os.network.controller == 'onos' %} + plugin: onos +{% if opnfv.ext_port is defined %} +{% if opnfv.data_port is defined %} + bridge-mappings: physnet1:br-data external:br-ex + data-port: br-data:{{ opnfv.data_port }} br-ex:{{ opnfv.ext_port }} +{% else %} + bridge-mappings: external:br-ex + data-port: br-ex:{{ opnfv.ext_port }} +{% endif %} +{% endif %} +{% if os.network.sfc %} + profile: onos-sfc +{% endif %} +{% elif os.network.controller == 'odl' %} + plugin: ovs-odl +{% if opnfv.ext_port is defined %} + ext-port: {{ opnfv.ext_port }} +{% endif %} +{% else %} +{% if opnfv.ext_port is defined %} + ext-port: {{ opnfv.ext_port }} +{% endif %} +{% endif %} + instance-mtu: 1400 + to: + - "nodes=0" +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/bundle_tpl/neutron-ovs.yaml b/ci/config_tpl/bundle_tpl/neutron-ovs.yaml new file mode 100644 index 00000000..087783d8 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/neutron-ovs.yaml @@ -0,0 +1,31 @@ + neutron-openvswitch: + charm: local:{{ ubuntu.release }}/neutron-openvswitch + options: +{% if opnfv.spaces_dict.data is defined %} + os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% else %} + #os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% endif %} +{% if os.network.dpdk %} + enable-dpdk: true + #dpdk-driver: uio_pci_generic + #data-port: "" + #default-socket-memory: 1024 + #default-socket-cores: 1 +{% endif %} +{% if opnfv.ext_port is defined %} +{% if os.network.dvr %} +{% if os.network.controller == 'nosdn' %} +{% if opnfv.data_port is defined %} + bridge-mappings: physnet1:br-data external:br-ex + data-port: br-data:{{ opnfv.data_port }} br-ex:{{ opnfv.ext_port }} +{% else %} + bridge-mappings: external:br-ex + data-port: br-ex:{{ opnfv.ext_port }} +{% endif %} +{% else %} + ext-port: {{ opnfv.ext_port }} +{% endif %} +{% endif %} +{% endif %} +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/bundle_tpl/nova-cloud-controller.yaml b/ci/config_tpl/bundle_tpl/nova-cloud-controller.yaml new file mode 100644 index 00000000..bdf1090a --- /dev/null +++ b/ci/config_tpl/bundle_tpl/nova-cloud-controller.yaml @@ -0,0 +1,21 @@ + nova-cloud-controller: + charm: "local:{{ ubuntu.release }}/nova-cloud-controller" + num_units: {{ unit_qty() }} + options: + #console-access-protocol: novnc + neutron-external-network: ext-net + service-guard: true +{% if opnfv.domain is defined %} + console-proxy-ip: {{ opnfv.domain }} +{% endif %} + network-manager: Neutron +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.nova }} +{% endif %} +{% if os.beta.public_api %} + os-public-hostname: api.{{ opnfv.domain }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/nova-compute.yaml b/ci/config_tpl/bundle_tpl/nova-compute.yaml new file mode 100644 index 00000000..81803807 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/nova-compute.yaml @@ -0,0 +1,18 @@ + nova-compute: + charm: "local:{{ ubuntu.release }}/nova-compute" + num_units: {{ opnfv.units - 1 }} + options: + enable-live-migration: true + enable-resize: true + manage-neutron-plugin-legacy-mode: false + migration-auth-type: ssh +{% if os.beta.huge_pages %} + hugepages: "50%" +{% endif %} +{% if os.lxd %} + virt-type: lxd +{% endif %} + to: +{% for unit_id in range(1, opnfv.units) %} + - "nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/oclphase1.yaml b/ci/config_tpl/bundle_tpl/oclphase1.yaml new file mode 100644 index 00000000..afef96c0 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/oclphase1.yaml @@ -0,0 +1,58 @@ + zookeeper: + charm: local:precise/zookeeper + num_units: {{ unit_qty() }} + series: precise + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + cassandra: + charm: local:{{ ubuntu.release }}/cassandra + num_units: {{ unit_qty() }} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + options: + authenticator: AllowAllAuthenticator + contrail-configuration: + charm: local:{{ ubuntu.release }}/contrail-configuration + num_units: {{ unit_qty() }} + options: +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.contrailconfig }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + contrail-control: + charm: local:{{ ubuntu.release }}/contrail-control + num_units: {{ unit_qty() }} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + contrail-analytics: + charm: local:{{ ubuntu.release }}/contrail-analytics + num_units: {{ unit_qty() }} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + contrail-webui: + charm: local:{{ ubuntu.release }}/contrail-webui + num_units: {{ unit_qty() }} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} + haproxy: + charm: local:{{ ubuntu.release }}/haproxy + num_units: {{ unit_qty() }} + options: + peering_mode: active-active + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/odl.yaml b/ci/config_tpl/bundle_tpl/odl.yaml new file mode 100644 index 00000000..30f555c9 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/odl.yaml @@ -0,0 +1,17 @@ + odl-controller: + charm: local:{{ ubuntu.release }}/odl-controller + options: + install-url: "https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.4.2-Beryllium-SR2/distribution-karaf-0.4.2-Beryllium-SR2.tar.gz" +{% if os.network.sfc %} + profile: "openvswitch-odl-beryllium-sfc" +{% elif os.network.bgpvpn %} + profile: "openvswitch-odl-beryllium-vpn" +{% elif os.network.odll3 %} + profile: "openvswitch-odl-beryllium-l3" +{% else %} + profile: "openvswitch-odl-beryllium" +{% endif %} + http-proxy: "http://squid.internal:3128" + https-proxy: "http://squid.internal:3128" + to: + - "lxc:nodes=0" diff --git a/ci/config_tpl/bundle_tpl/onos.yaml b/ci/config_tpl/bundle_tpl/onos.yaml new file mode 100644 index 00000000..fd08c717 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/onos.yaml @@ -0,0 +1,9 @@ + onos-controller: + charm: local:{{ ubuntu.release }}/onos-controller + options: +{% if opnfv.ext_port is defined %} + ext-port: {{ opnfv.ext_port }} +{% endif %} + #gateway-mac: "default" + to: + - "lxc:nodes=0" diff --git a/ci/config_tpl/bundle_tpl/openstack-dashboard.yaml b/ci/config_tpl/bundle_tpl/openstack-dashboard.yaml new file mode 100644 index 00000000..83408dcd --- /dev/null +++ b/ci/config_tpl/bundle_tpl/openstack-dashboard.yaml @@ -0,0 +1,16 @@ + openstack-dashboard: + charm: "local:{{ ubuntu.release }}/openstack-dashboard" + num_units: {{ unit_qty() }} + options: + secret: admin + webroot: / +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.dashboard }} +{% endif %} +{% if os.beta.public_api %} + endpoint-type: internalURL +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/opnfv-promise.yaml b/ci/config_tpl/bundle_tpl/opnfv-promise.yaml new file mode 100644 index 00000000..4e96cf73 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/opnfv-promise.yaml @@ -0,0 +1,5 @@ + opnfv-promise: + charm: local:{{ ubuntu.release }}/promise + to: + - "lxc:nodes=0" +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/bundle_tpl/phase2-overrides.yaml b/ci/config_tpl/bundle_tpl/phase2-overrides.yaml new file mode 100644 index 00000000..33350300 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/phase2-overrides.yaml @@ -0,0 +1,25 @@ +{% if opnfv.spaces_dict.storage is defined %} + #ceph-cluster-network: {{ opnfv.spaces_dict.storage.cidr }} +{% endif %} +{% if os.network.ipv6 %} + prefer-ipv6: {{ os.network.ipv6 }} +{% endif %} +{% if os.network.dvr %} + enable-dvr: true +{% endif %} +{% if os.network.l2_population %} + l2-population: true +{% endif %} + region: {{ os.region }} +{% if ubuntu.release == 'trusty' %} + source: "cloud:{{ ubuntu.release }}-{{ os.release }}" +{% endif %} + openstack-origin: "cloud:{{ ubuntu.release }}-{{ os.release }}" +{% if os.ha.mode == 'nonha' %} + ceph-osd-replication-count: {{ unit_ceph_qty() }} +{% endif %} + admin-role: {{ os.admin.role }} + keystone-admin-role: {{ os.admin.role }} +{% if os.beta.public_api %} + use-internal-endpoints: true +{% endif %} diff --git a/ci/config_tpl/bundle_tpl/rabbitmq.yaml b/ci/config_tpl/bundle_tpl/rabbitmq.yaml new file mode 100644 index 00000000..1020340f --- /dev/null +++ b/ci/config_tpl/bundle_tpl/rabbitmq.yaml @@ -0,0 +1,12 @@ + rabbitmq-server: + charm: "local:{{ ubuntu.release }}/rabbitmq-server" + num_units: {{ unit_qty() }} + options: +{% if os.ha.mode == 'ha' %} + vip: {{ opnfv.vip.rabbitmq }} + min-cluster-size: {{ unit_qty() }} +{% endif %} + to: +{% for unit_id in to_select() %} + - "lxc:nodes={{ unit_id }}" +{% endfor %} diff --git a/ci/config_tpl/bundle_tpl/relations.yaml b/ci/config_tpl/bundle_tpl/relations.yaml new file mode 100644 index 00000000..4cf24385 --- /dev/null +++ b/ci/config_tpl/bundle_tpl/relations.yaml @@ -0,0 +1,95 @@ + - [ 'nova-compute:amqp', 'rabbitmq-server:amqp' ] + - [ 'neutron-gateway:amqp', 'rabbitmq-server:amqp' ] + - [ 'keystone:shared-db', 'mysql:shared-db' ] + - [ 'nova-cloud-controller:identity-service', 'keystone:identity-service' ] + - [ 'glance:identity-service', 'keystone:identity-service' ] + - [ 'neutron-api:identity-service', 'keystone:identity-service' ] + - [ 'neutron-api:shared-db', 'mysql:shared-db' ] + - [ 'neutron-api:amqp', 'rabbitmq-server:amqp' ] + - [ 'neutron-gateway:neutron-plugin-api', 'neutron-api:neutron-plugin-api' ] + - [ 'glance:shared-db', 'mysql:shared-db' ] + - [ 'glance:amqp', 'rabbitmq-server:amqp' ] + - [ 'nova-cloud-controller:image-service', 'glance:image-service' ] + - [ 'nova-compute:image-service', 'glance:image-service' ] + - [ 'nova-cloud-controller:cloud-compute', 'nova-compute:cloud-compute' ] + - [ 'nova-cloud-controller:amqp', 'rabbitmq-server:amqp' ] + - [ 'nova-cloud-controller:quantum-network-service', 'neutron-gateway:quantum-network-service' ] + - [ 'openstack-dashboard:identity-service', 'keystone:identity-service' ] + - [ 'nova-cloud-controller:shared-db', 'mysql:shared-db' ] + - [ 'nova-cloud-controller:neutron-api', 'neutron-api:neutron-api' ] + - [ 'cinder:image-service', 'glance:image-service' ] + - [ 'cinder:amqp', 'rabbitmq-server:amqp' ] + - [ 'cinder:identity-service', 'keystone:identity-service' ] + - [ 'cinder:cinder-volume-service', 'nova-cloud-controller:cinder-volume-service' ] + - [ 'cinder-ceph:storage-backend', 'cinder:storage-backend' ] + - [ 'ceph:client', 'nova-compute:ceph' ] + - [ 'cinder:shared-db', 'mysql:shared-db' ] + - [ 'ceph:client', 'cinder-ceph:ceph' ] + - [ 'ceph:client', 'glance:ceph' ] + - [ 'ceph-osd:mon', 'ceph:osd' ] + - [ 'ceph-radosgw:mon', 'ceph:radosgw' ] + - [ 'ceph-radosgw:identity-service', 'keystone:identity-service' ] + - [ 'ceilometer:amqp', 'rabbitmq-server:amqp' ] + - [ 'ceilometer-agent:ceilometer-service', 'ceilometer:ceilometer-service' ] + - [ 'ceilometer:identity-service', 'keystone:identity-service' ] + - [ 'ceilometer:identity-notifications', 'keystone:identity-notifications' ] + - [ 'ceilometer-agent:nova-ceilometer', 'nova-compute:nova-ceilometer' ] + - [ 'ceilometer:shared-db', 'mongodb:database' ] + - [ 'heat:shared-db', 'mysql:shared-db' ] + - [ 'heat:identity-service', 'keystone:identity-service' ] + - [ 'heat:amqp', 'rabbitmq-server:amqp' ] + - [ 'congress:shared-db', 'mysql:shared-db' ] + - [ 'congress:identity-service', 'keystone:identity-service' ] + - [ 'congress:amqp', 'rabbitmq-server:amqp' ] + - [ 'aodh:amqp', 'rabbitmq-server:amqp' ] + - [ 'aodh:shared-db', 'mysql:shared-db' ] + - [ 'aodh:identity-service', 'keystone:identity-service' ] +{% if os.lxd %} + - [ 'nova-compute:lxd', 'lxd:lxd' ] +{% endif %} +{% if os.network.controller == 'nosdn' %} + - [ 'neutron-openvswitch:amqp', 'rabbitmq-server:amqp' ] + - [ 'nova-compute:neutron-plugin', 'neutron-openvswitch:neutron-plugin' ] + - [ 'neutron-openvswitch:neutron-plugin-api', 'neutron-api:neutron-plugin-api' ] +{% elif os.network.controller == 'odl' %} + - [ 'neutron-api:neutron-plugin-api-subordinate', 'neutron-api-odl:neutron-plugin-api-subordinate' ] + - [ 'nova-compute:neutron-plugin', 'openvswitch-odl:neutron-plugin' ] + - [ 'neutron-gateway', 'openvswitch-odl' ] + - [ 'openvswitch-odl:ovsdb-manager', 'odl-controller:ovsdb-manager' ] + - [ 'neutron-api-odl:odl-controller', 'odl-controller:controller-api' ] +{% elif os.network.controller == 'onos' %} + - [ 'neutron-api:neutron-plugin-api-subordinate', 'neutron-api-onos:neutron-plugin-api-subordinate' ] + - [ 'nova-compute:neutron-plugin', 'openvswitch-onos:neutron-plugin' ] + - [ 'neutron-gateway', 'openvswitch-onos' ] + - [ 'openvswitch-onos:ovsdb-manager', 'onos-controller:ovsdb-manager' ] + - [ 'neutron-api-onos:onos-controller', 'onos-controller:controller-api' ] +{% elif os.network.controller == 'ocl' %} + - [ 'contrail-configuration:cassandra', 'cassandra:database' ] + - [ 'contrail-configuration', 'zookeeper' ] + - [ 'contrail-configuration', 'rabbitmq-server' ] + - [ 'contrail-configuration', 'keystone' ] + - [ 'neutron-api-contrail', 'contrail-configuration' ] + - [ 'neutron-api-contrail', 'keystone' ] + - [ 'contrail-control:contrail-api', 'contrail-configuration:contrail-api' ] + - [ 'contrail-control:contrail-discovery', 'contrail-configuration:contrail-discovery' ] + - [ 'contrail-control:contrail-ifmap', 'contrail-configuration:contrail-ifmap' ] + - [ 'contrail-control', 'keystone' ] + - [ 'contrail-analytics:cassandra', 'cassandra:database' ] + - [ 'contrail-analytics:contrail-analytics-api', 'contrail-configuration:contrail-analytics-api' ] + - [ 'contrail-configuration:contrail-discovery', 'contrail-analytics:contrail-discovery' ] + - [ 'contrail-webui', 'keystone' ] + - [ 'contrail-webui:contrail_api', 'contrail-configuration:contrail-api' ] + - [ 'contrail-webui:contrail_discovery', 'contrail-configuration:contrail-discovery' ] + - [ 'contrail-webui:cassandra', 'cassandra:database' ] + - [ 'nova-compute', 'neutron-contrail' ] + - [ 'neutron-contrail:contrail-discovery', 'contrail-configuration:contrail-discovery' ] + - [ 'neutron-contrail:contrail-api', 'contrail-configuration:contrail-api' ] + - [ 'neutron-contrail', 'keystone' ] + - [ 'contrail-configuration', 'ntp' ] + - [ 'contrail-control', 'ntp' ] + - [ 'contrail-analytics', 'ntp' ] + - [ 'contrail-configuration', 'haproxy' ] + - [ 'contrail-analytics', 'haproxy' ] + - [ 'contrail-webui', 'haproxy' ] + - [ 'haproxy', 'keepalived' ] +{% endif %} diff --git a/ci/config_tpl/bundle_tpl/subordinate.yaml b/ci/config_tpl/bundle_tpl/subordinate.yaml new file mode 100644 index 00000000..aea5232c --- /dev/null +++ b/ci/config_tpl/bundle_tpl/subordinate.yaml @@ -0,0 +1,55 @@ + ceilometer-agent: + charm: local:{{ ubuntu.release }}/ceilometer-agent +{% if opnfv.storage_dict.ceph is defined %} + cinder-ceph: + charm: local:{{ ubuntu.release }}/cinder-ceph +{% endif %} +{% if os.network.controller == 'nosdn' %} +{% include 'neutron-ovs.yaml' %} +{% elif os.network.controller == 'odl' %} + neutron-api-odl: + charm: local:{{ ubuntu.release }}/neutron-api-odl + options: + overlay-network-type: 'vxlan' + security-groups: True + openvswitch-odl: + charm: local:{{ ubuntu.release }}/openvswitch-odl + options: +{% if opnfv.spaces_dict.data is defined %} + os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% else %} + #os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% endif %} +{% elif os.network.controller == 'onos' %} + neutron-api-onos: + charm: local:{{ ubuntu.release }}/neutron-api-onos + options: + overlay-network-type: 'vxlan' + security-groups: True + openvswitch-onos: + charm: local:{{ ubuntu.release }}/openvswitch-onos + options: +{% if opnfv.spaces_dict.data is defined %} + os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% else %} + #os-data-network: {{ opnfv.spaces_dict.data.cidr }} +{% endif %} +{% if os.network.sfc %} + profile: onos-sfc +{% endif %} +{% elif os.network.controller == 'ocl' %} + neutron-api-contrail: + charm: local:{{ ubuntu.release }}/neutron-api-contrail + neutron-contrail: + charm: local:{{ ubuntu.release }}/neutron-contrail + keepalived: + charm: local:{{ ubuntu.release }}/keepalived + options: +{% if os.ha.mode == 'ha' %} + virtual-ip: {{ opnfv.vip.keepalived }} +{% endif %} +{% endif %} +{% if os.lxd %} + lxd: + charm: local:{{ ubuntu.release }}/lxd +{% endif %} diff --git a/ci/config_tpl/deployconfig.yaml b/ci/config_tpl/deployconfig.yaml new file mode 100644 index 00000000..3bc2ebc2 --- /dev/null +++ b/ci/config_tpl/deployconfig.yaml @@ -0,0 +1,40 @@ +opnfv: +{% set net_prefix = opnfv.spaces_dict.admin.cidr[:-4] %} + admNetgway: {{ opnfv.spaces_dict.admin.gateway }} + admNetwork: {{ net_prefix }}2 + admin_password: openstack + ceph-disk: {{ opnfv.storage_dict.ceph.disk }} + dataNetwork: {{ opnfv.spaces_dict.data.cidr }} + domain: {{ lab.racks[0].osdomainname }} + ext-port: {{ lab.racks[0]['ext-port'] }} + ext_port: {{ lab.racks[0]['ext-port'] }} + floating-ip-range: {{ lab.racks[0]['floating-ip-range'] }} + interface-enable: {{ lab.racks[0].ifnamelist }} + os-domain-name: {{ lab.racks[0].osdomainname }} + publicNetwork: {{ opnfv.spaces_dict.public.cidr if 'public' in opnfv.spaces_dict else '' }} + spaces: +{% for net in opnfv.spaces %} + - bridge: {{ net.bridge }} + cidr: {{ net.cidr }} + gateway: {{ net.gateway or '' }} + type: {{ net.type }} + vlan: {{ net.vlan or '' }} +{% endfor %} + storage: +{% for storage in opnfv.storage %} + - disk: {{ storage.disk }} + type: {{ storage.type }} +{% endfor %} + storageNetwork: {{ opnfv.spaces_dict.storage.cidr if 'storage' in opnfv.spaces_dict else '' }} + units: {{ lab.racks[0].nodes|count }} + vip: + ceilometer: {{ net_prefix }}24 + cinder: {{ net_prefix }}29 + dashboard: {{ net_prefix }}21 + glance: {{ net_prefix }}22 + heat: {{ net_prefix }}28 + keystone: {{ net_prefix }}23 + mysql: {{ net_prefix }}25 + neutron: {{ net_prefix }}27 + nova: {{ net_prefix }}26 + rabbitmq: {{ net_prefix }}20 diff --git a/ci/config_tpl/maas_tpl/deployment.yaml b/ci/config_tpl/maas_tpl/deployment.yaml new file mode 100644 index 00000000..b57ec01c --- /dev/null +++ b/ci/config_tpl/maas_tpl/deployment.yaml @@ -0,0 +1,45 @@ +opnfv-{{ lab.location }}{{ lab.racks[0].rack }}-maas: + juju-bootstrap: +{% include 'juju-bootstrap.yaml' %} + maas: + apt_sources: + - ppa:maas/stable + - ppa:juju/stable + arch: amd64 + boot_source: + keyring_filename: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg + selections: + '1': + arches: amd64 + labels: release + os: ubuntu + release: xenial + subarches: '*' + url: http://maas.ubuntu.com/images/ephemeral-v2/releases/ + disk_size: 160G + interfaces: +{% for net in opnfv.spaces %} + - bridge={{ net.bridge }},model=virtio +{% endfor %} + ip_address: {{ opnfv.spaces_dict.admin.cidr[:-4] }}5 + memory: 4096 + name: opnfv-{{ lab.location }}{{ lab.racks[0].rack }} + network_config: | +{% include 'maas-network_config.yaml' %} + node_group_ifaces: +{% include 'maas-node_group_ifaces.yaml' %} + nodes: +{% include 'maas-nodes.yaml' %} + password: ubuntu + pool: default + release: trusty + settings: + maas_name: {{ lab.location }}{{ lab.racks[0].rack }} + main_archive: http://archive.ubuntu.com/ubuntu + upstream_dns: {{ lab.racks[0].dns }} + user: ubuntu + vcpus: 4 + virsh: + rsa_priv_key: {{ os.home }}/.ssh/id_rsa + rsa_pub_key: {{ os.home }}/.ssh/id_rsa.pub + uri: qemu+ssh://{{ os.user }}@{{ os.brAdmIP }}/system diff --git a/ci/config_tpl/maas_tpl/juju-bootstrap.yaml b/ci/config_tpl/maas_tpl/juju-bootstrap.yaml new file mode 100644 index 00000000..533c62cc --- /dev/null +++ b/ci/config_tpl/maas_tpl/juju-bootstrap.yaml @@ -0,0 +1,13 @@ + arch: amd64 + disk_size: 60G + interfaces: +{% for net in ['admin','public','external'] %} +{% if net in opnfv.spaces_dict %} + - bridge={{ opnfv.spaces_dict[net].bridge }},model=virtio +{% endif %} +{% endfor %} + memory: 4096 + name: bootstrap + pool: default + vcpus: 4 +{# Empty block to avoid bad block trim #} diff --git a/ci/config_tpl/maas_tpl/maas-network_config.yaml b/ci/config_tpl/maas_tpl/maas-network_config.yaml new file mode 100644 index 00000000..6188a515 --- /dev/null +++ b/ci/config_tpl/maas_tpl/maas-network_config.yaml @@ -0,0 +1,20 @@ + auto lo + iface lo inet loopback +{% set ethid = 0 %} +{% for net in opnfv.spaces %} + + auto eth{{ ethid }} + iface eth{{ ethid }} inet static + netmask 255.255.255.0 +{% if net.type!='external' %} +{% set net_prefix = net.cidr[:-4] %} + address {{ net_prefix }}5 +{% else %} + address {{ net.ipaddress }} +{% endif %} +{% if net.type=='admin' %} + gateway {{ net.gateway }} + dns-nameservers {{ lab.racks[0].dns }} {{ net_prefix }}5 127.0.0.1 +{% endif %} +{% set ethid = ethid+1 %} +{% endfor %} diff --git a/ci/config_tpl/maas_tpl/maas-node_group_ifaces.yaml b/ci/config_tpl/maas_tpl/maas-node_group_ifaces.yaml new file mode 100644 index 00000000..578c89fb --- /dev/null +++ b/ci/config_tpl/maas_tpl/maas-node_group_ifaces.yaml @@ -0,0 +1,23 @@ +{% set ethid = 0 %} +{% for net in opnfv.spaces %} +{% if net.type!='external' %} +{% set net_prefix = net.cidr[:-4] %} + - broadcast_ip: {{ net_prefix }}255 + device: eth{{ ethid }} + dynamic_range: + high: {{ net_prefix }}250 + low: {{ net_prefix }}81 + ip: {{ net_prefix }}5 +{% if net.gateway!= None %} + router_ip: {{ net.gateway }} +{% endif %} +{% if net.type!='admin' %} + management: 1 +{% endif %} + static_range: + high: {{ net_prefix }}80 + low: {{ net_prefix }}50 + subnet_mask: 255.255.255.0 +{% set ethid = ethid+1 %} +{% endif %} +{% endfor %} diff --git a/ci/config_tpl/maas_tpl/maas-nodes.yaml b/ci/config_tpl/maas_tpl/maas-nodes.yaml new file mode 100644 index 00000000..4b5a0ce0 --- /dev/null +++ b/ci/config_tpl/maas_tpl/maas-nodes.yaml @@ -0,0 +1,28 @@ +{% for node in lab.racks[0].nodes %} +{% if node.architecture=='x86_64' %} + - architecture: amd64/generic +{% endif %} + interfaces: +{% for nic in node.nics %} + - mac_address: {{ nic.mac[0] }} + mode: auto + name: {{ nic.ifname }} +{% endfor %} + mac_addresses: +{% for nic in node.nics %} + - {{ nic.mac[0] }} +{% endfor %} + name: {{ node.name }} + power: +{% if node.power.type=='ipmi' %} + address: {{ node.power.address }} + driver: LAN_2_0 + pass: {{ node.power.pass }} + type: ipmi + user: {{ node.power.user }} +{% elif node.power.type=='wakeonlan' %} + type: etherwake + mac_address: {{ node.power.mac_address }} +{% endif %} + tags: {{ ' '.join(node.roles) }} +{% endfor %} diff --git a/ci/genBundle.py b/ci/genBundle.py index 8648ac3a..9c6781b5 100644 --- a/ci/genBundle.py +++ b/ci/genBundle.py @@ -34,7 +34,7 @@ labconfig_file = options.lab scenarioconfig_file = 'default_deployment_config.yaml' # Capture our current directory -TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/bundle_tpl' +TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/bundle_tpl' # # Prepare variables @@ -186,8 +186,6 @@ if 'trusty' in extra: if 'liberty' in extra: config['os']['release'] = 'liberty' -# pp(config) - # # Transform template to bundle.yaml according to config # @@ -204,4 +202,13 @@ env.globals.update(unit_ceph_qty=unit_ceph_qty) env.globals.update(to_select=to_select) # Render the template -print(template.render(**config)) +output = template.render(**config) + +# Check output syntax +try: + yaml.load(output) +except yaml.YAMLError as exc: + print(exc) + +# print output +print(output) diff --git a/ci/genDeploymentConfig.py b/ci/genDeploymentConfig.py new file mode 100644 index 00000000..d78c93fa --- /dev/null +++ b/ci/genDeploymentConfig.py @@ -0,0 +1,103 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +""" +This script generates a deployment config based on lab config file. + +Parameters: + -l, --lab : lab config file +""" + +from optparse import OptionParser +from jinja2 import Environment, FileSystemLoader +import os +import yaml + +# +# Parse parameters +# + +parser = OptionParser() +parser.add_option("-l", "--lab", dest="lab", help="lab config file") +(options, args) = parser.parse_args() +labconfig_file = options.lab + +# +# Set Path and configs path +# + +# Capture our current directory +TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl' +HOME = os.environ['HOME'] +USER = os.environ['USER'] + +# +# Prepare variables +# + +# Prepare a storage for passwords +passwords_store = dict() + +# +# Local Functions +# + + +def load_yaml(filepath): + """Load YAML file""" + with open(filepath, 'r') as stream: + try: + return yaml.load(stream) + except yaml.YAMLError as exc: + print(exc) + +# +# Config import +# + +# Load scenario Config +config = load_yaml(labconfig_file) + +# Set a dict copy of opnfv/spaces +config['opnfv']['spaces_dict'] = dict() +for space in config['opnfv']['spaces']: + config['opnfv']['spaces_dict'][space['type']] = space + +# Set a dict copy of opnfv/storage +config['opnfv']['storage_dict'] = dict() +for storage in config['opnfv']['storage']: + config['opnfv']['storage_dict'][storage['type']] = storage + +# Add some OS environment variables +config['os'] = {'home': HOME, + 'user': USER, + } + +# Prepare interface-enable, more easy to do it here +ifnamelist = set() +for node in config['lab']['racks'][0]['nodes']: + for nic in node['nics']: + if 'admin' not in nic['spaces']: + ifnamelist.add(nic['ifname']) +config['lab']['racks'][0]['ifnamelist'] = ', '.join(ifnamelist) + +# +# Transform template to deployconfig.yaml according to config +# + +# Create the jinja2 environment. +env = Environment(loader=FileSystemLoader(TPL_DIR), + trim_blocks=True) +template = env.get_template('deployconfig.yaml') + +# Render the template +output = template.render(**config) + +# Check output syntax +try: + yaml.load(output) +except yaml.YAMLError as exc: + print(exc) + +# print output +print(output) diff --git a/ci/genMAASConfig.py b/ci/genMAASConfig.py new file mode 100644 index 00000000..2b4948dc --- /dev/null +++ b/ci/genMAASConfig.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +""" +This script generates a maas deployer config based on lab config file. + +Parameters: + -l, --lab : lab config file +""" + +from optparse import OptionParser +from jinja2 import Environment, FileSystemLoader +import os +import yaml +from pprint import pprint as pp +import socket +import fcntl +import struct + +# +# Parse parameters +# + +parser = OptionParser() +parser.add_option("-l", "--lab", dest="lab", help="lab config file") +(options, args) = parser.parse_args() +labconfig_file = options.lab + +# +# Set Path and configs path +# + +# Capture our current directory +TPL_DIR = os.path.dirname(os.path.abspath(__file__))+'/config_tpl/maas_tpl' +HOME = os.environ['HOME'] +USER = os.environ['USER'] + +# +# Prepare variables +# + +# Prepare a storage for passwords +passwords_store = dict() + +# +# Local Functions +# + + +def load_yaml(filepath): + """Load YAML file""" + with open(filepath, 'r') as stream: + try: + return yaml.load(stream) + except yaml.YAMLError as exc: + print(exc) + + +def get_ip_address(ifname): + """Get local IP""" + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + return socket.inet_ntoa(fcntl.ioctl( + s.fileno(), + 0x8915, # SIOCGIFADDR + struct.pack('256s', bytes(ifname.encode('utf-8')[:15])) + )[20:24]) + + +# +# Config import +# + +# Load scenario Config +config = load_yaml(labconfig_file) +config['opnfv']['spaces_dict'] = dict() +for space in config['opnfv']['spaces']: + config['opnfv']['spaces_dict'][space['type']] = space +config['os'] = {'home': HOME, + 'user': USER, + 'brAdmIP': get_ip_address(config['opnfv']['spaces_dict'] + ['admin']['bridge'])} + +# pp(config) + +# +# Transform template to bundle.yaml according to config +# + +# Create the jinja2 environment. +env = Environment(loader=FileSystemLoader(TPL_DIR), + trim_blocks=True) +template = env.get_template('deployment.yaml') + +# Render the template +output = template.render(**config) + +# Check output syntax +try: + yaml.load(output) +except yaml.YAMLError as exc: + print(exc) + +# print output +print(output) -- cgit 1.2.3-korg