From af2db33a0ebab98700c3c03ea84a6ba9b987c5b5 Mon Sep 17 00:00:00 2001 From: Jonas Bjurel Date: Fri, 30 Sep 2016 20:28:22 +0200 Subject: Preparing the experimental branch for improved Danube CI/CD experiments Fast forwarded to commit:cf93e6ee11c96de090b04196cc96b4a6b0948928 Change-Id: I13d10d870e8ffc7317ab03f8810592d5b2205875 Signed-off-by: Jonas Bjurel --- deploy/README | 171 +++++ deploy/README.templater | 371 ++++++++++ deploy/__init__.py | 8 + deploy/cloud/configure_environment.py | 73 ++ deploy/cloud/configure_network.py | 69 ++ deploy/cloud/configure_nodes.py | 202 ++++++ deploy/cloud/configure_settings.py | 75 ++ deploy/cloud/deploy.py | 112 +++ deploy/cloud/deployment.py | 232 ++++++ deploy/common.py | 202 ++++++ deploy/config/dea_base.yaml | 801 +++++++++++++++++++++ .../default/fuel/config/dea-pod-override.yaml | 255 +++++++ .../devel-pipeline/default/fuel/config/dha.yaml | 109 +++ .../elx/fuel/config/dea-pod-override.yaml | 252 +++++++ .../labs/devel-pipeline/elx/fuel/config/dha.yaml | 110 +++ .../huawei-ch/fuel/config/dea-pod-override.yaml | 253 +++++++ .../devel-pipeline/huawei-ch/fuel/config/dha.yaml | 47 ++ .../intel-sc/fuel/config/dea-pod-override.yaml | 251 +++++++ .../devel-pipeline/intel-sc/fuel/config/dha.yaml | 110 +++ deploy/config/plugins/fuel-bgpvpn_0.0.1.yaml | 22 + deploy/config/plugins/fuel-bgpvpn_0.0.2.yaml | 31 + deploy/config/plugins/fuel-bgpvpn_0.0.3.yaml | 30 + deploy/config/plugins/fuel-bgpvpn_0.9.0.yaml | 30 + deploy/config/plugins/fuel-nfvkvm_0.0.1.yaml | 27 + deploy/config/plugins/fuel-nfvkvm_0.0.2.yaml | 34 + deploy/config/plugins/fuel-nfvkvm_0.9.0.yaml | 34 + deploy/config/plugins/fuel-nfvovs_0.0.1.yaml | 28 + deploy/config/plugins/fuel-nfvovs_0.0.2.yaml | 35 + deploy/config/plugins/fuel-nshovs_0.0.1.yaml | 44 ++ deploy/config/plugins/fuel-nshovs_0.9.0.yaml | 37 + deploy/config/plugins/fuel-odl_0.0.1.yaml | 91 +++ deploy/config/plugins/fuel-odl_0.0.2.yaml | 91 +++ deploy/config/plugins/fuel-odl_0.0.3.yaml | 117 +++ deploy/config/plugins/fuel-odl_0.9.0.yaml | 143 ++++ deploy/config/plugins/fuel-onos_0.0.1.yaml | 33 + deploy/config/plugins/fuel-onos_0.0.2.yaml | 33 + deploy/config/plugins/fuel-onos_0.0.3.yaml | 38 + deploy/dea.py | 105 +++ deploy/deploy-config.py | 467 ++++++++++++ deploy/deploy.py | 423 +++++++++++ deploy/deploy_env.py | 285 ++++++++ deploy/dha.py | 38 + deploy/dha_adapters/__init__.py | 8 + deploy/dha_adapters/amt_adapter.py | 100 +++ deploy/dha_adapters/hardware_adapter.py | 65 ++ deploy/dha_adapters/hp_adapter.py | 37 + deploy/dha_adapters/ipmi_adapter.py | 114 +++ deploy/dha_adapters/libvirt_adapter.py | 173 +++++ deploy/dha_adapters/zte_adapter.py | 32 + deploy/environments/__init__.py | 8 + deploy/environments/execution_environment.py | 100 +++ deploy/environments/libvirt_environment.py | 107 +++ deploy/environments/virtual_fuel.py | 143 ++++ deploy/execution_environment.py | 37 + deploy/fuel_patch/ks.cfg.patch | 19 + deploy/install_fuel_master.py | 222 ++++++ deploy/reap.py | 413 +++++++++++ deploy/scenario/README | 159 ++++ deploy/scenario/ha_heat_ceilometer_scenario.yaml | 86 +++ .../ha_nfv-kvm_heat_ceilometer_scenario.yaml | 173 +++++ .../ha_nfv-ovs_heat_ceilometer_scenario.yaml | 134 ++++ deploy/scenario/ha_odl-bgpvpn_scenario.yaml | 104 +++ .../ha_odl-l2_heat_ceilometer_scenario.yaml | 104 +++ .../ha_odl-l2_sfc_heat_ceilometer_scenario.yaml | 119 +++ .../ha_odl-l3_heat_ceilometer_scenario.yaml | 120 +++ ...ha_onos_nofeature_heat_ceilometer_scenario.yaml | 115 +++ .../ha_onos_sfc_heat_ceilometer_scenario.yaml | 95 +++ .../scenario/ha_vlan_heat_ceilometer_scenario.yaml | 129 ++++ .../scenario/no-ha_heat_ceilometer_scenario.yaml | 62 ++ .../no-ha_nfv-kvm_heat_ceilometer_scenario.yaml | 151 ++++ ...a_nfv-kvm_nfv-ovs_heat_ceilometer_scenario.yaml | 114 +++ .../no-ha_nfv-ovs_heat_ceilometer_scenario.yaml | 112 +++ deploy/scenario/no-ha_odl-bgpvpn_scenario.yaml | 81 +++ .../no-ha_odl-l2_heat_ceilometer_scenario.yaml | 82 +++ .../no-ha_odl-l2_sfc_heat_ceilometer_scenario.yaml | 98 +++ .../no-ha_odl-l3_heat_ceilometer_scenario.yaml | 97 +++ ...ha_onos_nofeature_heat_ceilometer_scenario.yaml | 93 +++ .../no-ha_onos_sfc_heat_ceilometer_scenario.yaml | 73 ++ .../no-ha_vlan_heat_ceilometer_scenario.yaml | 103 +++ deploy/scenario/scenario.yaml | 83 +++ deploy/ssh_client.py | 103 +++ deploy/templater.py | 204 ++++++ .../virtual_environment/noha/networks/fuel1.xml | 12 + .../virtual_environment/noha/networks/fuel2.xml | 5 + .../virtual_environment/noha/networks/fuel3.xml | 5 + .../virtual_environment/noha/networks/fuel4.xml | 12 + .../virtual_environment/noha/vms/compute.xml | 91 +++ .../virtual_environment/noha/vms/controller.xml | 91 +++ .../ericsson/virtual_environment/noha/vms/fuel.xml | 93 +++ .../vms/ericsson_montreal_lab/fuel.xml | 91 +++ deploy/templates/hardware_environment/vms/fuel.xml | 91 +++ .../virtual_environment/noha/networks/fuel1.xml | 12 + .../virtual_environment/noha/networks/fuel2.xml | 5 + .../virtual_environment/noha/networks/fuel3.xml | 5 + .../virtual_environment/noha/networks/fuel4.xml | 12 + .../intel/virtual_environment/noha/vms/compute.xml | 91 +++ .../virtual_environment/noha/vms/controller.xml | 91 +++ .../intel/virtual_environment/noha/vms/fuel.xml | 93 +++ deploy/templates/plugins/.gitkeep | 0 deploy/templates/templater/base_dea_template.yaml | 24 + .../virtual_environment/networks/fuel1.xml | 12 + .../virtual_environment/networks/fuel2.xml | 6 + .../virtual_environment/networks/fuel3.xml | 5 + .../virtual_environment/networks/fuel4.xml | 12 + .../templates/virtual_environment/vms/compute.xml | 67 ++ .../virtual_environment/vms/controller.xml | 64 ++ deploy/templates/virtual_environment/vms/fuel.xml | 64 ++ .../virtual_environment_noha/networks/fuel1.xml | 12 + .../virtual_environment_noha/networks/fuel2.xml | 5 + .../virtual_environment_noha/networks/fuel3.xml | 5 + .../virtual_environment_noha/networks/fuel4.xml | 12 + .../virtual_environment_noha/vms/compute.xml | 64 ++ .../virtual_environment_noha/vms/controller.xml | 64 ++ .../virtual_environment_noha/vms/fuel.xml | 65 ++ deploy/transplant_fuel_settings.py | 116 +++ 115 files changed, 11688 insertions(+) create mode 100644 deploy/README create mode 100644 deploy/README.templater create mode 100644 deploy/__init__.py create mode 100644 deploy/cloud/configure_environment.py create mode 100644 deploy/cloud/configure_network.py create mode 100644 deploy/cloud/configure_nodes.py create mode 100644 deploy/cloud/configure_settings.py create mode 100644 deploy/cloud/deploy.py create mode 100644 deploy/cloud/deployment.py create mode 100644 deploy/common.py create mode 100644 deploy/config/dea_base.yaml create mode 100644 deploy/config/labs/devel-pipeline/default/fuel/config/dea-pod-override.yaml create mode 100644 deploy/config/labs/devel-pipeline/default/fuel/config/dha.yaml create mode 100644 deploy/config/labs/devel-pipeline/elx/fuel/config/dea-pod-override.yaml create mode 100644 deploy/config/labs/devel-pipeline/elx/fuel/config/dha.yaml create mode 100644 deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dea-pod-override.yaml create mode 100644 deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dha.yaml create mode 100644 deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dea-pod-override.yaml create mode 100644 deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dha.yaml create mode 100644 deploy/config/plugins/fuel-bgpvpn_0.0.1.yaml create mode 100644 deploy/config/plugins/fuel-bgpvpn_0.0.2.yaml create mode 100644 deploy/config/plugins/fuel-bgpvpn_0.0.3.yaml create mode 100644 deploy/config/plugins/fuel-bgpvpn_0.9.0.yaml create mode 100644 deploy/config/plugins/fuel-nfvkvm_0.0.1.yaml create mode 100644 deploy/config/plugins/fuel-nfvkvm_0.0.2.yaml create mode 100644 deploy/config/plugins/fuel-nfvkvm_0.9.0.yaml create mode 100644 deploy/config/plugins/fuel-nfvovs_0.0.1.yaml create mode 100644 deploy/config/plugins/fuel-nfvovs_0.0.2.yaml create mode 100644 deploy/config/plugins/fuel-nshovs_0.0.1.yaml create mode 100644 deploy/config/plugins/fuel-nshovs_0.9.0.yaml create mode 100644 deploy/config/plugins/fuel-odl_0.0.1.yaml create mode 100644 deploy/config/plugins/fuel-odl_0.0.2.yaml create mode 100644 deploy/config/plugins/fuel-odl_0.0.3.yaml create mode 100644 deploy/config/plugins/fuel-odl_0.9.0.yaml create mode 100644 deploy/config/plugins/fuel-onos_0.0.1.yaml create mode 100644 deploy/config/plugins/fuel-onos_0.0.2.yaml create mode 100644 deploy/config/plugins/fuel-onos_0.0.3.yaml create mode 100644 deploy/dea.py create mode 100644 deploy/deploy-config.py create mode 100755 deploy/deploy.py create mode 100644 deploy/deploy_env.py create mode 100644 deploy/dha.py create mode 100644 deploy/dha_adapters/__init__.py create mode 100644 deploy/dha_adapters/amt_adapter.py create mode 100644 deploy/dha_adapters/hardware_adapter.py create mode 100644 deploy/dha_adapters/hp_adapter.py create mode 100644 deploy/dha_adapters/ipmi_adapter.py create mode 100644 deploy/dha_adapters/libvirt_adapter.py create mode 100644 deploy/dha_adapters/zte_adapter.py create mode 100644 deploy/environments/__init__.py create mode 100644 deploy/environments/execution_environment.py create mode 100644 deploy/environments/libvirt_environment.py create mode 100644 deploy/environments/virtual_fuel.py create mode 100644 deploy/execution_environment.py create mode 100644 deploy/fuel_patch/ks.cfg.patch create mode 100644 deploy/install_fuel_master.py create mode 100644 deploy/reap.py create mode 100644 deploy/scenario/README create mode 100644 deploy/scenario/ha_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_nfv-kvm_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_nfv-ovs_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_odl-bgpvpn_scenario.yaml create mode 100644 deploy/scenario/ha_odl-l2_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_odl-l2_sfc_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_odl-l3_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_onos_nofeature_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_onos_sfc_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/ha_vlan_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_nfv-kvm_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_nfv-kvm_nfv-ovs_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_nfv-ovs_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_odl-bgpvpn_scenario.yaml create mode 100644 deploy/scenario/no-ha_odl-l2_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_odl-l2_sfc_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_odl-l3_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_onos_nofeature_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_onos_sfc_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/no-ha_vlan_heat_ceilometer_scenario.yaml create mode 100644 deploy/scenario/scenario.yaml create mode 100644 deploy/ssh_client.py create mode 100755 deploy/templater.py create mode 100644 deploy/templates/ericsson/virtual_environment/noha/networks/fuel1.xml create mode 100644 deploy/templates/ericsson/virtual_environment/noha/networks/fuel2.xml create mode 100644 deploy/templates/ericsson/virtual_environment/noha/networks/fuel3.xml create mode 100644 deploy/templates/ericsson/virtual_environment/noha/networks/fuel4.xml create mode 100644 deploy/templates/ericsson/virtual_environment/noha/vms/compute.xml create mode 100644 deploy/templates/ericsson/virtual_environment/noha/vms/controller.xml create mode 100644 deploy/templates/ericsson/virtual_environment/noha/vms/fuel.xml create mode 100644 deploy/templates/hardware_environment/vms/ericsson_montreal_lab/fuel.xml create mode 100644 deploy/templates/hardware_environment/vms/fuel.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/networks/fuel1.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/networks/fuel2.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/networks/fuel3.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/networks/fuel4.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/vms/compute.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/vms/controller.xml create mode 100644 deploy/templates/intel/virtual_environment/noha/vms/fuel.xml create mode 100644 deploy/templates/plugins/.gitkeep create mode 100644 deploy/templates/templater/base_dea_template.yaml create mode 100644 deploy/templates/virtual_environment/networks/fuel1.xml create mode 100644 deploy/templates/virtual_environment/networks/fuel2.xml create mode 100644 deploy/templates/virtual_environment/networks/fuel3.xml create mode 100644 deploy/templates/virtual_environment/networks/fuel4.xml create mode 100644 deploy/templates/virtual_environment/vms/compute.xml create mode 100644 deploy/templates/virtual_environment/vms/controller.xml create mode 100644 deploy/templates/virtual_environment/vms/fuel.xml create mode 100644 deploy/templates/virtual_environment_noha/networks/fuel1.xml create mode 100644 deploy/templates/virtual_environment_noha/networks/fuel2.xml create mode 100644 deploy/templates/virtual_environment_noha/networks/fuel3.xml create mode 100644 deploy/templates/virtual_environment_noha/networks/fuel4.xml create mode 100644 deploy/templates/virtual_environment_noha/vms/compute.xml create mode 100644 deploy/templates/virtual_environment_noha/vms/controller.xml create mode 100644 deploy/templates/virtual_environment_noha/vms/fuel.xml create mode 100644 deploy/transplant_fuel_settings.py (limited to 'deploy') diff --git a/deploy/README b/deploy/README new file mode 100644 index 000000000..ee6bc3156 --- /dev/null +++ b/deploy/README @@ -0,0 +1,171 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# peter.barabas@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +======== PREREQUISITES ======== + +the following dependencies and python modules are required to be installed: + +- for Ubuntu: + +sudo apt-get update +sudo apt-get install -y libvirt-bin qemu-kvm python-pip fuseiso mkisofs \ +genisoimage ipmitool +sudo apt-get install -y python-dev libz-dev libxml2-dev libxslt-dev libyaml-dev +sudo pip install pyyaml netaddr paramiko lxml scp pycrypto ecdsa amt + +During libvirt install the user is added to the libvirtd group, so you have to +logout then login back again + + +======== PREPARE and RUN the OPNFV Autodeployment ======== + + +--- Step.1 Prepare the DEA and DHA configuration files and the OPNFV ISO file + +Make sure that you are using the right DEA - Deployment Environment Adapter and +DHA - Deployment Hardware Adapter configuration files, the ones provided are only templates +you will have to modify them according to your needs + +- If wou wish to deploy OPNFV cloud environment on top of KVM/Libvirt + virtualization use as example the following configuration files: + + => templates/virtual_environment/conf/ha + dea.yaml + dha.yaml + + +- If you wish to deploy OPNFV cloud environment on hardware + use as example the following configuration files: + + => templates/hardware_environment/conf/ericsson_montreal_lab/pod1/ha + dea.yaml + dha.yaml + + => templates/hardware_environment/conf/linux_foundation_lab/pod1/ha + dea.yaml + dha.yaml + + => templates/hardware_environment/conf/linux_foundation_lab/pod2/ha + dea.yaml + dha.yaml + + +--- Step.2 Run Autodeployment --- + +usage: python ./deploy.py [-h] [-nf] [-nh] [-fo] [-co] [-c] [-iso [ISO_FILE]] + [-dea [DEA_FILE]] [-dha [DHA_FILE]] [-s STORAGE_DIR] + [-b PXE_BRIDGE] [-p FUEL_PLUGINS_DIR] + [-pc FUEL_PLUGINS_CONF_DIR] [-np] + [-dt DEPLOY_TIMEOUT] [-nde] + +optional arguments: + -h, --help show this help message and exit + -nf Do not install Fuel Master (and Node VMs when using + libvirt) + -nh Don't run health check after deployment + -fo Install Fuel Master only (and Node VMs when using + libvirt) + -co Cleanup VMs and Virtual Networks according to what is + defined in DHA + -c Cleanup after deploy + -iso [ISO_FILE] ISO File [default: OPNFV.iso] + -dea [DEA_FILE] Deployment Environment Adapter: dea.yaml + -dha [DHA_FILE] Deployment Hardware Adapter: dha.yaml + -s STORAGE_DIR Storage Directory [default: images] + -b PXE_BRIDGE Linux Bridge for booting up the Fuel Master VM + [default: pxebr] + -p FUEL_PLUGINS_DIR Fuel Plugins directory + -pc FUEL_PLUGINS_CONF_DIR + Fuel Plugins Configuration directory + -np Do not install Fuel Plugins + -dt DEPLOY_TIMEOUT Deployment timeout (in minutes) [default: 240] + -nde Do not launch environment deployment + -log [LOG_FILE] Deployment log path and file name + +* EXAMPLES: + +- Install Fuel Master and deploy OPNFV Cloud from scratch on Hardware Environment: + + sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/hardware/dea.yaml -dha ~/CONF/hardware/dha.yaml -s /mnt/images -b pxebr -log ~/Deployment-888.log.tar.gz + + +- Install Fuel Master and deploy OPNFV Cloud from scratch on Virtual Environment: + + sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -s /mnt/images -log ~/Deployment-888.log.tar.gz + + +- Deploy OPNFV Cloud on an already active Environment where Fuel Master VM is running so no need to install Fuel again: + + sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -log ~/Deployment-888.log.tar.gz + + => with plugin installation + sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -log ~/Deployment-888.log.tar.gz + + => with cleanup after deployment is finished + sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -c -log ~/Deployment-888.log.tar.gz + + => no healthcheck after deployment is completed + sudo python deploy.py -nf -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -nh -log ~/Deployment-888.log.tar.gz + + +- Install Fuel Master only (and Node VMs when using virtual environment): + + => for virtual environment: + sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/virtual/dea.yaml -dha ~/CONF/virtual/dha.yaml -s /mnt/images -log ~/Deployment-888.log.tar.gz + + => for hardware environment: + sudo python deploy.py -iso ~/ISO/opnfv.iso -dea ~/CONF/hardware/dea.yaml -dha ~/CONF/hardware/dha.yaml -s /mnt/images -b pxebr -log ~/Deployment-888.log.tar.gz + + +- Cleanup a running OPNFV environment: + + sudo python deploy.py -co -dha ~/CONF/virtual/dha.yaml + + +* WARNINGS: + +=> If optional argument -s is not specified, Autodeployment will use +"/images" as default, and it will create it, if it hasn't been created before + +=> If optional argument -b is not specified, Autodeployment will use "pxebr" as default, +if the bridge does not exist, the application will terminate with an error message + +=> If argument -iso [ISO_FILE] is not specified, Autodeployment will use "/OPNFV.iso" +as default, if the iso file does not exist, the application will terminate with an error message + +=> If argument -dea [DEA_FILE] is not specified, Autodeployment will use "/dea.yaml" +as default, if DEA file does not exist, the application will terminate with an error message + +=> If argument -dha [DHA_FILE] is not specified, Autodeployment will use "/dha.yaml" +as default, if DHA file does not exist, the application will terminate with an error message + +=> Optional argument -b PXE_BRIDGE is not required for Autodeployment in virtual environment, + even if it is specified it will not be used at all because virtual environment is using a different virtual network setup + +=> If optional argument -p FUEL_PLUGINS_DIR is not specified, no external plugins will be installed in Fuel + + +--- Networking considerations --- + +For Virtual Environment: + +There are some NAT, IPTABLE conflicts on the edge of libvirt bridging and Fuel Master +according to http://wiki.libvirt.org/page/Networking +netfilter on the bridges should be disabled + +Add these lines to /etc/sysctl.conf + +cat >> /etc/sysctl.conf < start + abort_after: + timeout = True + break + if not deploy_id: + deploy_id = self._start_deploy_task() + sts, prg, msg = self._deployment_status(deploy_id) + if sts == 'error': + log('Error during deployment: {}'.format(msg)) + break + if sts == 'running': + log('Environmnent deploymnet progress: {}%'.format(prg)) + elif sts == 'ready': + ready = True + break + time.sleep(SLEEP_TIME) + except (DeployNotStart, NodesGoOffline) as e: + log(e) + attempts += 1 + deploy_id = None + time.sleep(SLEEP_TIME * attempts) + + if timeout: + err('Deployment timed out, environment %s is not operational, ' + 'snapshot will not be performed' + % self.env_id) + if ready: + log('Environment %s successfully deployed' + % self.env_id) + else: + self.collect_error_logs() + err('Deployment failed, environment %s is not operational' + % self.env_id, self.collect_logs) + + def _start_deploy_task(self): + out, _ = exec_cmd('fuel2 env deploy {}'.format(self.env_id), False) + id = self._deployment_task_id(out) + return id + + def _deployment_task_id(self, response): + response = str(response) + if response.startswith('Deployment task with id'): + for s in response.split(): + if s.isdigit(): + return int(s) + raise DeployNotStart('Unable to start deployment: {}'.format(response)) + + def _deployment_status(self, id): + task = self._task_fields(id) + if task['status'] == 'error': + if task['message'].endswith( + 'offline. Remove them from environment and try again.'): + raise NodesGoOffline(task['message']) + return task['status'], task['progress'], task['message'] + + def _task_fields(self, id): + try: + out, _ = exec_cmd('fuel2 task show {} -f json'.format(id), False) + task_info = json.loads(out) + properties = {} + # for 9.0 this can be list of dicts or dict + # see https://bugs.launchpad.net/fuel/+bug/1625518 + if isinstance(task_info, list): + for d in task_info: + properties.update({d['Field']: d['Value']}) + else: + return task_info + return properties + except ValueError as e: + err('Unable to fetch task info: {}'.format(e)) + + def collect_logs(self): + log('Cleaning out any previous deployment logs') + exec_cmd('rm -f /var/log/remote/fuel-snapshot-*', False) + exec_cmd('rm -f /root/deploy-*', False) + log('Generating Fuel deploy snap-shot') + if exec_cmd('fuel snapshot < /dev/null &> snapshot.log', False)[1] <> 0: + log('Could not create a Fuel snapshot') + else: + exec_cmd('mv /root/fuel-snapshot* /var/log/remote/', False) + + log('Collecting all Fuel Snapshot & deploy log files') + r, _ = exec_cmd('tar -czhf /root/deploy-%s.log.tar.gz /var/log/remote' % time.strftime("%Y%m%d-%H%M%S"), False) + log(r) + + def verify_node_status(self): + node_list = parse(exec_cmd('fuel --env %s node' % self.env_id)) + failed_nodes = [] + for node in node_list: + if node[N['status']] != 'ready': + failed_nodes.append((node[N['id']], node[N['status']])) + + if failed_nodes: + summary = '' + for node, status in failed_nodes: + summary += '[node %s, status %s]\n' % (node, status) + err('Deployment failed: %s' % summary, self.collect_logs) + + def health_check(self): + log('Now running sanity and smoke health checks') + r = exec_cmd('fuel health --env %s --check sanity,smoke --force' % self.env_id) + log(r) + if 'failure' in r: + err('Healthcheck failed!', self.collect_logs) + + def deploy(self): + self.run_deploy() + self.verify_node_status() + if not self.no_health_check: + self.health_check() + self.collect_logs() diff --git a/deploy/common.py b/deploy/common.py new file mode 100644 index 000000000..51b70fe46 --- /dev/null +++ b/deploy/common.py @@ -0,0 +1,202 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# peter.barabas@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import subprocess +import sys +import os +import logging +import argparse +import shutil +import stat +import errno +import time +import shlex + +N = {'id': 0, 'status': 1, 'name': 2, 'cluster': 3, 'ip': 4, 'mac': 5, + 'roles': 6, 'pending_roles': 7, 'online': 8, 'group_id': 9} +E = {'id': 0, 'status': 1, 'name': 2, 'release_id': 3, 'pending_release_id': 4} +R = {'id': 0, 'name': 1, 'state': 2, 'operating_system': 3, 'version': 4} +RO = {'name': 0, 'conflicts': 1} +CWD = os.getcwd() +LOG = logging.getLogger(__name__) +LOG.setLevel(logging.DEBUG) +formatter = logging.Formatter('%(message)s') +out_handler = logging.StreamHandler(sys.stdout) +out_handler.setFormatter(formatter) +LOG.addHandler(out_handler) +LOGFILE = 'autodeploy.log' +if os.path.isfile(LOGFILE): + os.remove(LOGFILE) +out_handler = logging.FileHandler(LOGFILE, mode='w') +out_handler.setFormatter(formatter) +LOG.addHandler(out_handler) +os.chmod(LOGFILE, 0664) + + +def mask_arguments(cmd, mask_args, mask_str): + cmd_line = shlex.split(cmd) + for pos in mask_args: + # Don't mask the actual command; also check if we don't reference + # beyond bounds + if pos == 0 or pos >= len(cmd_line): + continue + cmd_line[pos] = mask_str + return ' '.join(cmd_line) + + +def exec_cmd(cmd, check=True, attempts=1, delay=5, verbose=False, mask_args=[], mask_str='*****'): + masked_cmd = mask_arguments(cmd, mask_args, mask_str) + + # a negative value means forever + while attempts != 0: + attempts = attempts - 1 + process = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=True) + (response, stderr) = process.communicate() + return_code = process.returncode + if return_code == 0 or attempts == 0: + break + time.sleep(delay) + if verbose: + log('%d attempts left: %s' % (attempts, masked_cmd)) + + response = response.strip() + if check: + if return_code > 0: + stderr = stderr.strip() + print("Failed command: " + str(masked_cmd)) + print("Command returned response: " + str(stderr)) + print("Command return code: " + str(return_code)) + raise Exception(stderr) + else: + print("Command: " + str(masked_cmd)) + print(str(response)) + return response + return response, return_code + + +def run_proc(cmd): + process = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + shell=True) + return process + + +def run_proc_wait_terminated(process): + response = process.communicate()[0].strip() + return_code = process.returncode + return response, return_code + + +def run_proc_kill(process): + response = process.kill() + return response + + +def parse(printout): + parsed_list = [] + lines = printout.splitlines() + for l in lines[2:]: + parsed = [e.strip() for e in l.split('|')] + parsed_list.append(parsed) + return parsed_list + + +def clean(lines): + parsed_list = [] + parsed = [] + for l in lines.strip().splitlines(): + parsed = [] + cluttered = [e.strip() for e in l.split(' ')] + for p in cluttered: + if p: + parsed.append(p) + parsed_list.append(parsed) + return parsed if len(parsed_list) == 1 else parsed_list + + +def err(message, fun = None, *args): + LOG.error('%s\n' % message) + if fun: + fun(*args) + sys.exit(1) + + +def warn(message): + LOG.warning('%s\n' % message) + + +def check_file_exists(file_path): + if not os.path.dirname(file_path): + file_path = '%s/%s' % (CWD, file_path) + if not os.access(file_path, os.R_OK): + err('ERROR: File %s not found\n' % file_path) + + +def check_dir_exists(dir_path): + if not os.path.dirname(dir_path): + dir_path = '%s/%s' % (CWD, dir_path) + if not os.path.isdir(dir_path): + err('ERROR: Directory %s not found\n' % dir_path) + + +def create_dir_if_not_exists(dir_path): + if not os.path.isdir(dir_path): + log('Creating directory %s' % dir_path) + os.makedirs(dir_path) + + +def delete(f): + if os.path.isfile(f): + log('Deleting file %s' % f) + os.remove(f) + elif os.path.isdir(f): + log('Deleting directory %s' % f) + shutil.rmtree(f) + + +def commafy(comma_separated_list): + l = [c.strip() for c in comma_separated_list.split(',')] + return ','.join(l) + + +def check_if_root(): + uid = os.getuid() + if uid != 0: + err('You need be root to run this application') + + +def log(message): + LOG.debug('%s\n' % message) + + +class ArgParser(argparse.ArgumentParser): + + def error(self, message): + sys.stderr.write('ERROR: %s\n' % message) + self.print_help() + sys.exit(2) + + +def backup(path): + src = path + dst = path + '_orig' + delete(dst) + try: + shutil.copytree(src, dst) + except OSError as e: + if e.errno == errno.ENOTDIR: + shutil.copy(src, dst) + else: + raise diff --git a/deploy/config/dea_base.yaml b/deploy/config/dea_base.yaml new file mode 100644 index 000000000..c1a0606bc --- /dev/null +++ b/deploy/config/dea_base.yaml @@ -0,0 +1,801 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +dea-base-config-metadata: + title: 'Deployment Environment Adapter Base configuration' + # DEA API version supported + version: '0.4' + created: 'Fri Jun 10 2016' + comment: 'Rebased for Fuel 9' +environment: + net_segment_type: tun +fuel: + FUEL_ACCESS: + password: admin + user: admin +wanted_release: Mitaka on Ubuntu 14.04 +settings: + editable: + access: + email: + description: Email address for Administrator + label: Email + regex: + error: Invalid email + source: ^\S+@\S+$ + type: text + value: admin@localhost + weight: 40 + metadata: + group: general + label: OpenStack Access + weight: 10 + password: + description: Password for Administrator + label: Password + regex: + error: Empty password + source: \S + type: password + value: admin + weight: 20 + tenant: + description: Tenant (project) name for Administrator + label: Tenant + regex: + error: Invalid tenant name + source: ^(?!services$)(?!nova$)(?!glance$)(?!keystone$)(?!neutron$)(?!cinder$)(?!swift$)(?!ceph$)(?!ironic$)(?![Gg]uest$)(?!.* + +.*$).+ + type: text + value: admin + weight: 30 + user: + description: Username for Administrator + label: Username + regex: + error: Invalid username + source: ^(?!services$)(?!nova$)(?!glance$)(?!keystone$)(?!neutron$)(?!cinder$)(?!swift$)(?!ceph$)(?!ironic$)(?![Gg]uest$)(?!.* + +.*$).+ + type: text + value: admin + weight: 10 + additional_components: + ceilometer: + description: If selected, Ceilometer and Aodh components will be installed + label: Install Ceilometer and Aodh + type: checkbox + value: true + weight: 60 + heat: + description: '' + label: '' + type: hidden + value: true + weight: 50 + ironic: + description: If selected, Ironic component will be installed + label: Install Ironic + restrictions: + - cluster:net_provider != 'neutron' or networking_parameters:segmentation_type != 'vlan': Ironic + requires Neutron with VLAN segmentation. + - settings:storage.images_ceph.value == true and settings:storage.objects_ceph.value == false: Ironic + requires Swift or RadosGW for Glance images. + type: checkbox + value: false + weight: 80 + metadata: + group: openstack_services + label: Additional Components + weight: 10 + mongo: + description: If selected, You can use external Mongo DB as ceilometer backend + label: Use external Mongo DB + restrictions: + - settings:additional_components.ceilometer.value == false: External Mongo + aims to be an external backend for Ceilometer. Without Ceilometer enabled, + External Mongo is useless and should not be installed. + type: checkbox + value: false + weight: 70 + murano: + description: If selected, Murano component will be installed + label: Install Murano + type: checkbox + value: false + weight: 20 + murano-cfapi: + description: If selected, Murano service broker will be installed + label: Install Murano service broker for Cloud Foundry + restrictions: + - condition: settings:additional_components.murano.value == false + message: Murano should be enabled + - action: hide + condition: not ('experimental' in version:feature_groups) + type: checkbox + value: false + weight: 30 + sahara: + description: If selected, Sahara component will be installed + label: Install Sahara + type: checkbox + value: false + weight: 10 + cgroups: + metadata: + always_editable: true + group: general + label: Cgroups conguration for services + restrictions: + - action: hide + condition: 'true' + weight: 90 + common: + auth_key: + group: security + type: hidden + value: '' + weight: 70 + auto_assign_floating_ip: + description: If selected, OpenStack will automatically assign a floating IP + to a new instance + group: network + label: Auto assign floating IP + restrictions: + - action: hide + condition: cluster:net_provider == 'neutron' + type: checkbox + value: false + weight: 40 + debug: + description: Debug logging mode provides more information, but requires more + disk space. + group: logging + label: OpenStack debug logging + type: checkbox + value: false + weight: 20 + libvirt_type: + group: compute + label: Hypervisor type + type: radio + value: kvm + values: + - data: kvm + description: Choose this type of hypervisor if you run OpenStack on hardware + label: KVM + - data: qemu + description: Choose this type of hypervisor if you run OpenStack on virtual + hosts. + label: QEMU + weight: 30 + metadata: + label: Common + weight: 10 + nova_quota: + description: Quotas are used to limit CPU and memory usage for tenants. Enabling + quotas will increase load on the Nova database. + group: compute + label: Nova quotas + type: checkbox + value: false + weight: 30 + propagate_task_deploy: + type: hidden + value: false + weight: 12 + puppet_debug: + description: Debug puppet logging mode provides more information, but requires + more disk space. + group: logging + label: Puppet debug logging + type: checkbox + value: true + weight: 20 + resume_guests_state_on_host_boot: + description: Whether to resume previous guests state when the host reboots. + If enabled, this option causes guests assigned to the host to resume their + previous state. If the guest was running a restart will be attempted when + nova-compute starts. If the guest was not running previously, a restart + will not be attempted. + group: compute + label: Resume guests state on host boot + type: checkbox + value: true + weight: 50 + task_deploy: + type: hidden + value: true + weight: 11 + use_cow_images: + description: For most cases you will want qcow format. If it's disabled, raw + image format will be used to run VMs. OpenStack with raw format currently + does not support snapshotting. + group: storage + label: Use qcow format for images + type: checkbox + value: true + weight: 60 + use_vcenter: + type: hidden + value: false + weight: 30 + corosync: + group: + description: '' + label: Group + type: text + value: 226.94.1.1 + weight: 10 + metadata: + group: general + label: Corosync + restrictions: + - action: hide + condition: 'true' + weight: 50 + port: + description: '' + label: Port + type: text + value: '12000' + weight: 20 + verified: + description: Set True only if multicast is configured correctly on router. + label: Need to pass network verification. + type: checkbox + value: false + weight: 10 + external_mongo: + hosts_ip: + description: IP Addresses of MongoDB. Use comma to split IPs + label: MongoDB hosts IP + regex: + error: Invalid hosts ip sequence + source: ^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?),)*((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ + type: text + value: '' + weight: 30 + metadata: + group: openstack_services + label: External MongoDB + restrictions: + - action: hide + condition: settings:additional_components.mongo.value == false + message: Ceilometer and MongoDB are not enabled on the Additional Components + section + weight: 30 + mongo_db_name: + description: Mongo database name + label: Database name + regex: + error: Invalid database name + source: ^\w+$ + type: text + value: ceilometer + weight: 30 + mongo_password: + description: Mongo database password + label: Password + regex: + error: Password contains spaces + source: ^\S*$ + type: password + value: ceilometer + weight: 30 + mongo_replset: + description: Name for Mongo replication set + label: Replset + type: text + value: '' + weight: 30 + mongo_user: + description: Mongo database username + label: Username + regex: + error: Empty username + source: ^\w+$ + type: text + value: ceilometer + weight: 30 + kernel_params: + kernel: + description: Default kernel parameters + label: Initial parameters + type: text + value: console=tty0 net.ifnames=0 biosdevname=0 rootdelay=90 nomodeset + metadata: + group: general + label: Kernel parameters + weight: 60 + murano_settings: + metadata: + group: openstack_services + label: Murano Settings + restrictions: + - action: hide + condition: settings:additional_components.murano.value == false + message: Murano is not enabled on the Additional Components section + weight: 20 + murano_glance_artifacts_plugin: + description: If selected glance artifact repository will be enabled + label: Enable glance artifact repository + type: checkbox + value: true + weight: 40 + murano_repo_url: + description: '' + label: Murano Repository URL + type: text + value: http://storage.apps.openstack.org/ + weight: 10 + neutron_advanced_configuration: + metadata: + group: network + label: Neutron Advanced Configuration + restrictions: + - action: hide + condition: cluster:net_provider != 'neutron' + weight: 20 + neutron_dvr: + description: Enable Distributed Virtual Routers in Neutron + label: Neutron DVR + restrictions: + - ? networking_parameters:segmentation_type != 'vlan' and settings:neutron_advanced_configuration.neutron_l2_pop.value + == false + : DVR requires L2 population to be enabled. + type: checkbox + value: false + weight: 20 + neutron_l2_pop: + description: Enable L2 population mechanism in Neutron + label: Neutron L2 population + restrictions: + - action: hide + condition: networking_parameters:segmentation_type == 'vlan' + type: checkbox + value: false + weight: 10 + neutron_l3_ha: + description: 'Enable High Availability features for Virtual Routers in Neutron + + Requires at least 2 Controller nodes to function properly + + ' + label: Neutron L3 HA + restrictions: + - condition: settings:neutron_advanced_configuration.neutron_dvr.value == + true + message: Neutron DVR must be disabled in order to use Neutron L3 HA + type: checkbox + value: false + weight: 30 + neutron_qos: + description: Enable Neutron QoS advanced service plug-in + label: Neutron QoS + type: checkbox + value: false + weight: 40 + operator_user: + authkeys: + description: Public SSH keys to include to operator user's authorized keys, + one per line. + label: Authorized SSH keys + type: textarea + value: '' + weight: 80 + homedir: + description: Home directory for operator user + label: Home directory + regex: + error: Invalid path + source: ^/\S + type: text + value: /home/fueladmin + weight: 70 + metadata: + group: general + label: Operating System Access + weight: 15 + name: + description: Username for operator user + label: Username + regex: + error: Empty username + source: \S + type: text + value: fueladmin + weight: 50 + password: + description: Password for operator user + label: Password + regex: + error: Empty password + source: \S + type: password + value: mCKyMCwhzrt7d6E8WQzxg5WS + weight: 60 + sudo: + description: Sudoers configuration directives for operator user, one per line. + label: Sudoers configuration + type: textarea + value: 'ALL=(ALL) NOPASSWD: ALL' + weight: 90 + provision: + metadata: + group: general + label: Provision + restrictions: + - action: hide + condition: 'false' + weight: 80 + method: + type: hidden + value: image + packages: + label: Initial packages + type: textarea + value: 'acl + + anacron + + bash-completion + + bridge-utils + + bsdmainutils + + build-essential + + cloud-init + + curl + + daemonize + + debconf-utils + + gdisk + + grub-pc + + hpsa-dkms + + hwloc + + i40e-dkms + + linux-firmware + + linux-firmware-nonfree + + linux-headers-generic-lts-trusty + + linux-image-generic-lts-trusty + + lvm2 + + mcollective + + mdadm + + multipath-tools + + multipath-tools-boot + + nailgun-agent + + nailgun-mcagents + + network-checker + + ntp + + openssh-client + + openssh-server + + puppet + + python-amqp + + ruby-augeas + + ruby-ipaddress + + ruby-json + + ruby-netaddr + + ruby-openstack + + ruby-shadow + + ruby-stomp + + telnet + + ubuntu-minimal + + ubuntu-standard + + uuid-runtime + + vim + + virt-what + + vlan + + ' + weight: 10 + public_network_assignment: + assign_to_all_nodes: + description: When disabled, public network will be assigned to controllers + only + label: Assign public network to all nodes + type: checkbox + value: true + weight: 10 + metadata: + group: network + label: Public network assignment + restrictions: + - action: hide + condition: cluster:net_provider != 'neutron' + weight: 10 + public_ssl: + cert_data: + description: Certificate and private key data, concatenated into a single + file + label: Certificate + restrictions: + - action: hide + condition: (settings:public_ssl.cert_source.value != 'user_uploaded') or + (settings:public_ssl.horizon.value == false and settings:public_ssl.services.value + == false) + type: file + value: '' + weight: 40 + cert_source: + description: From where we'll get certificate and private key + label: Select source for certificate + restrictions: + - action: hide + condition: settings:public_ssl.horizon.value == false and settings:public_ssl.services.value + == false + type: radio + value: self_signed + values: + - data: self_signed + description: Generate private key and certificate that will be signed by + this key + label: Self-signed + - data: user_uploaded + description: Use pre-generated key and certificate + label: I have my own keypair with certificate + weight: 30 + horizon: + description: Secure access to Horizon enabling HTTPS instead of HTTP + label: HTTPS for Horizon + restrictions: + - settings:public_ssl.services.value == false: TLS for OpenStack public endpoints + should be enabled + type: checkbox + value: false + weight: 20 + hostname: + description: Your DNS entries should point to this name. Self-signed certificates + also will use this hostname + label: DNS hostname for public TLS endpoints + restrictions: + - action: hide + condition: settings:public_ssl.horizon.value == false and settings:public_ssl.services.value + == false + type: text + value: public.fuel.local + weight: 50 + metadata: + group: security + label: Public TLS + weight: 110 + services: + description: Enable TLS termination on HAProxy for OpenStack services + label: TLS for OpenStack public endpoints + type: checkbox + value: false + weight: 10 + repo_setup: + metadata: + always_editable: true + group: general + label: Repositories + weight: 50 + repos: + description: 'Please note: the first repository will be considered the operating + system mirror that will be used during node provisioning. + + To create a local repository mirror on the Fuel master node, please follow + the instructions provided by running "fuel-createmirror --help" on the Fuel + master node. + + Please make sure your Fuel master node has Internet access to the repository + before attempting to create a mirror. + + ' + extra_priority: null + type: custom_repo_configuration + value: + - name: ubuntu + priority: null + section: main universe multiverse + suite: trusty + type: deb + uri: http://10.20.0.2:8080/mirrors/ubuntu/ + - name: ubuntu-updates + priority: null + section: main universe multiverse + suite: trusty-updates + type: deb + uri: http://10.20.0.2:8080/mirrors/ubuntu/ + - name: ubuntu-security + priority: null + section: main universe multiverse + suite: trusty-security + type: deb + uri: http://10.20.0.2:8080/mirrors/ubuntu/ + - name: mos + priority: 1050 + section: main restricted + suite: mos9.0 + type: deb + uri: http://10.20.0.2:8080/mitaka-9.0/ubuntu/x86_64 + - name: Auxiliary + priority: 1150 + section: main restricted + suite: auxiliary + type: deb + uri: http://10.20.0.2:8080/mitaka-9.0/ubuntu/auxiliary + service_user: + homedir: + type: hidden + value: /var/lib/fuel + metadata: + group: general + label: Service user account + restrictions: + - action: hide + condition: 'true' + weight: 10 + name: + type: hidden + value: fuel + password: + type: hidden + value: sCTOC4CkNSTLuNKUQDNUV1Bp + root_password: + type: hidden + value: r00tme + sudo: + type: hidden + value: 'ALL=(ALL) NOPASSWD: ALL' + storage: + admin_key: + type: hidden + value: AQDir1pXAAAAABAAm8r2rR0FuVsV8LRo6u9GgQ== + bootstrap_osd_key: + type: hidden + value: AQDir1pXAAAAABAAK5E2MNhWdIpOBzjXJTVqcg== + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works + best if Ceph is enabled for volumes and images, too. Enables live migration + of all types of Ceph backed VMs (without this option, live migration will + only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: false + weight: 75 + fsid: + type: hidden + value: 7a5db523-ae79-489d-b5d1-7a31fdaba6ef + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. + If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could + be selected. + type: checkbox + value: false + weight: 30 + images_vcenter: + description: Configures Glance to use the vCenter/ESXi backend to store images. + If enabled, this option will prevent Swift from installing. + label: VMware vCenter/ESXi datastore for images (Glance) + restrictions: + - action: hide + condition: settings:common.use_vcenter.value != true + - condition: settings:storage.images_ceph.value == true + message: Only one Glance backend could be selected. + type: checkbox + value: false + weight: 35 + metadata: + group: storage + label: Storage Backends + weight: 60 + mon_key: + type: hidden + value: AQDir1pXAAAAABAAp92Dw8/kmDdhMvpgaPMKiQ== + objects_ceph: + description: Configures RadosGW front end for Ceph RBD. This exposes S3 and + Swift API Interfaces. If enabled, this option will prevent Swift from installing. + label: Ceph RadosGW for objects (Swift API) + type: checkbox + value: false + weight: 80 + osd_pool_size: + description: Configures the default number of object replicas in Ceph. This + number must be equal to or lower than the number of deployed 'Ceph OSD' + nodes. + label: Ceph object replication factor + regex: + error: Invalid number + source: ^[1-9]\d*$ + type: text + value: '3' + weight: 85 + radosgw_key: + type: hidden + value: AQDir1pXAAAAABAAUH+qP9FohG5wGr/+oQ2rFw== + volumes_block_device: + description: High performance block device storage. It is recommended to have + at least one Cinder Block Device + label: Cinder Block device driver + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 15 + volumes_ceph: + description: Configures Cinder to store volumes in Ceph RBD images. + label: Ceph RBD for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value == true or settings:storage.volumes_block_device.value + == true + type: checkbox + value: true + weight: 20 + volumes_lvm: + description: It is recommended to have at least one Cinder node. + label: Cinder LVM over iSCSI for volumes + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 10 +workloads_collector: + enabled: + type: hidden + value: true + metadata: + group: general + label: Workloads Collector User + restrictions: + - action: hide + condition: 'true' + weight: 10 + password: + type: password + value: JWMZX9JjUK1g4AsC7tHvpXvm + tenant: + type: text + value: services + user: + type: text + value: fuel_stats_user diff --git a/deploy/config/labs/devel-pipeline/default/fuel/config/dea-pod-override.yaml b/deploy/config/labs/devel-pipeline/default/fuel/config/dea-pod-override.yaml new file mode 100644 index 000000000..32b2cfb22 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/default/fuel/config/dea-pod-override.yaml @@ -0,0 +1,255 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +dea-pod-override-config-metadata: + title: 'Deployment Environment Adapter POD override for Development Pipeline - Ericsson ELX version' + version: '0.3' + created: 'Fri Jun 10 2016' + comment: 'Rebased for Fuel 9' +environment: + name: opnfv_virt +interfaces_1: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +interfaces_dpdk: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + - interface_properties: + dpdk: + enabled: true + ens6: + - public +interfaces_vlan: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +fuel: + ADMIN_NETWORK: + dhcp_pool_end: 10.20.0.254 + dhcp_pool_start: 10.20.0.3 + ipaddress: 10.20.0.2 + netmask: 255.255.255.0 + ssh_network: 10.20.0.0/24 + DNS_DOMAIN: domain.tld + DNS_SEARCH: domain.tld + DNS_UPSTREAM: 8.8.8.8, 8.8.4.4 + HOSTNAME: fuel + NTP1: 0.ubuntu.pool.ntp.org + NTP2: 1.ubuntu.pool.ntp.org + NTP3: 2.ubuntu.pool.ntp.org +network: + networking_parameters: + base_mac: fa:16:3e:00:00:00 + configuration_template: null + dns_nameservers: + - 8.8.8.8 + - 8.8.4.4 + floating_name: admin_floating_net + floating_ranges: + - - 172.16.0.130 + - 172.16.0.254 + gre_id_range: + - 2 + - 65535 + internal_cidr: 192.168.111.0/24 + internal_gateway: 192.168.111.1 + internal_name: admin_internal_net + net_l23_provider: ovs + segmentation_type: tun + vlan_range: + - 1000 + - 1030 + networks: + - cidr: 192.168.1.0/24 + gateway: null + ip_ranges: + - - 192.168.1.1 + - 192.168.1.254 + meta: + cidr: 192.168.1.0/24 + configurable: true + map_priority: 2 + name: storage + notation: cidr + render_addr_mask: storage + render_type: cidr + use_gateway: false + vlan_start: 102 + name: storage + vlan_start: 102 + - cidr: 192.168.0.0/24 + gateway: null + ip_ranges: + - - 192.168.0.1 + - 192.168.0.253 + meta: + cidr: 192.168.0.0/24 + configurable: true + map_priority: 2 + name: management + notation: ip_ranges + render_addr_mask: internal + render_type: cidr + use_gateway: false + vips: + - haproxy + - vrouter + vlan_start: null + name: management + vlan_start: null + - cidr: 192.168.2.0/24 + gateway: null + ip_ranges: + - - 192.168.2.1 + - 192.168.2.254 + meta: + cidr: 192.168.2.0/24 + configurable: true + map_priority: 2 + name: private + notation: cidr + render_addr_mask: null + render_type: cidr + seg_type: tun + use_gateway: false + vlan_start: 103 + name: private + vlan_start: 103 + - cidr: 172.16.0.0/24 + gateway: 172.16.0.1 + ip_ranges: + - - 172.16.0.2 + - 172.16.0.126 + meta: + cidr: 172.16.0.0/24 + configurable: true + floating_range_var: floating_ranges + ip_range: + - 172.16.0.2 + - 172.16.0.126 + map_priority: 1 + name: public + notation: ip_ranges + render_addr_mask: public + render_type: null + use_gateway: true + vips: + - haproxy + - vrouter + vlan_start: null + name: public + vlan_start: null + - cidr: 10.20.0.0/24 + gateway: 10.20.0.2 + ip_ranges: + - - 10.20.0.3 + - 10.20.0.254 + meta: + configurable: false + map_priority: 0 + notation: ip_ranges + render_addr_mask: null + render_type: null + unmovable: true + use_gateway: true + name: fuelweb_admin + vlan_start: null +settings: + editable: + external_dns: + dns_list: + description: List of upstream DNS servers + label: DNS list + max: 3 + regex: + error: Invalid IP address + source: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: text_list + value: + - 8.8.8.8 + - 8.8.4.4 + weight: 10 + metadata: + group: network + label: Host OS DNS Servers + weight: 30 + external_ntp: + metadata: + group: network + label: Host OS NTP Servers + weight: 40 + ntp_list: + description: List of upstream NTP servers + label: NTP server list + regex: + error: Invalid NTP server + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text_list + value: + - 0.ubuntu.pool.ntp.org + - 1.ubuntu.pool.ntp.org + - 2.ubuntu.pool.ntp.org + weight: 10 + syslog: + metadata: + enabled: false + group: logging + label: Syslog + toggleable: true + weight: 50 + syslog_port: + description: Remote syslog port + label: Port + regex: + error: Invalid syslog port + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '514' + weight: 20 + syslog_server: + description: Remote syslog hostname + label: Hostname + regex: + error: Invalid hostname + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text + value: '' + weight: 10 + syslog_transport: + label: Syslog transport protocol + type: radio + value: tcp + values: + - data: udp + description: '' + label: UDP + - data: tcp + description: '' + label: TCP + weight: 30 + diff --git a/deploy/config/labs/devel-pipeline/default/fuel/config/dha.yaml b/deploy/config/labs/devel-pipeline/default/fuel/config/dha.yaml new file mode 100644 index 000000000..0374c5d29 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/default/fuel/config/dha.yaml @@ -0,0 +1,109 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +dha-pod-config-metadata: + title: Deployment Hardware Adapter (DHA) for fuel development pipeline - default version + version: 0.0.3 + created: Feb 1 2016 + comment: Default Fuel8 version + +# Adapter to use for this definition +adapter: libvirt + +# Node list. +# Mandatory property is id, all other properties are adapter specific. + +nodes: +- id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml +- id: 2 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 3 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 4 + libvirtName: compute3 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 5 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +virtNetConfDir: templates/virtual_environment/networks + +disks: + fuel: 100G + controller: 100G + compute: 100G + +# Here the infrastructure VMs can be defined. +# The entries are not mandatory! If it is left empty +# the default defined in deploy/templates will +# be used. +define_vms: + fuel: + vcpu: + value: 2 + memory: + attribute_equlas: + unit: KiB + value: 8388608 + currentMemory: + attribute_equlas: + unit: KiB + value: 8388608 + devices: + interface: + # With attribute_equlas someone can define which + # interface type is meant + attribute_equlas: + type: network + # This will overwrite the type of the model of + # the interface + model: + attribute: + type: virtio + controller: + vcpu: + value: 4 + memory: + attribute_equlas: + unit: KiB + value: 10485760 + currentMemory: + attribute_equlas: + unit: KiB + value: 10485760 + devices: + interface: + attribute_equlas: + type: network + model: + attribute: + type: e1000 + compute: + memory: + attribute_equlas: + unit: KiB + value: 6291456 + currentMemory: + attribute_equlas: + unit: KiB + value: 6291456 + devices: + interface: + attribute_equlas: + type: network + model: + attribute: + type: e1000 diff --git a/deploy/config/labs/devel-pipeline/elx/fuel/config/dea-pod-override.yaml b/deploy/config/labs/devel-pipeline/elx/fuel/config/dea-pod-override.yaml new file mode 100644 index 000000000..cb80e3855 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/elx/fuel/config/dea-pod-override.yaml @@ -0,0 +1,252 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +dea-pod-override-config-metadata: + title: 'Deployment Environment Adapter POD override for Development Pipeline - Ericsson ELX version' + version: '0.3' + created: 'Fri Jun 10 2016' + comment: 'Rebased for Fuel 9' +environment: + name: opnfv_virt +interfaces_1: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +interfaces_dpdk: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + - interface_properties: + dpdk: + enabled: true + ens6: + - public +interfaces_vlan: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +fuel: + ADMIN_NETWORK: + dhcp_pool_end: 10.20.0.254 + dhcp_pool_start: 10.20.0.3 + ipaddress: 10.20.0.2 + netmask: 255.255.255.0 + ssh_network: 10.20.0.0/24 + DNS_DOMAIN: domain.tld + DNS_SEARCH: domain.tld + DNS_UPSTREAM: 147.214.6.234 + HOSTNAME: fuel + NTP1: time1.ericsson.se + NTP2: time2.ericsson.se + NTP3: time2.ericsson.se +network: + networking_parameters: + base_mac: fa:16:3e:00:00:00 + configuration_template: null + dns_nameservers: + - 147.214.6.234 + floating_name: admin_floating_net + floating_ranges: + - - 172.16.0.130 + - 172.16.0.254 + gre_id_range: + - 2 + - 65535 + internal_cidr: 192.168.111.0/24 + internal_gateway: 192.168.111.1 + internal_name: admin_internal_net + net_l23_provider: ovs + segmentation_type: tun + vlan_range: + - 1000 + - 1030 + networks: + - cidr: 192.168.1.0/24 + gateway: null + ip_ranges: + - - 192.168.1.1 + - 192.168.1.254 + meta: + cidr: 192.168.1.0/24 + configurable: true + map_priority: 2 + name: storage + notation: cidr + render_addr_mask: storage + render_type: cidr + use_gateway: false + vlan_start: 102 + name: storage + vlan_start: 102 + - cidr: 192.168.0.0/24 + gateway: null + ip_ranges: + - - 192.168.0.1 + - 192.168.0.253 + meta: + cidr: 192.168.0.0/24 + configurable: true + map_priority: 2 + name: management + notation: ip_ranges + render_addr_mask: internal + render_type: cidr + use_gateway: false + vips: + - haproxy + - vrouter + vlan_start: null + name: management + vlan_start: null + - cidr: 192.168.2.0/24 + gateway: null + ip_ranges: + - - 192.168.2.1 + - 192.168.2.254 + meta: + cidr: 192.168.2.0/24 + configurable: true + map_priority: 2 + name: private + notation: cidr + render_addr_mask: null + render_type: cidr + seg_type: tun + use_gateway: false + vlan_start: 103 + name: private + vlan_start: 103 + - cidr: 172.16.0.0/24 + gateway: 172.16.0.1 + ip_ranges: + - - 172.16.0.2 + - 172.16.0.126 + meta: + cidr: 172.16.0.0/24 + configurable: true + floating_range_var: floating_ranges + ip_range: + - 172.16.0.2 + - 172.16.0.126 + map_priority: 1 + name: public + notation: ip_ranges + render_addr_mask: public + render_type: null + use_gateway: true + vips: + - haproxy + - vrouter + vlan_start: null + name: public + vlan_start: null + - cidr: 10.20.0.0/24 + gateway: 10.20.0.2 + ip_ranges: + - - 10.20.0.3 + - 10.20.0.254 + meta: + configurable: false + map_priority: 0 + notation: ip_ranges + render_addr_mask: null + render_type: null + unmovable: true + use_gateway: true + name: fuelweb_admin + vlan_start: null +settings: + editable: + external_dns: + dns_list: + description: List of upstream DNS servers + label: DNS list + max: 3 + regex: + error: Invalid IP address + source: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: text_list + value: + - 147.214.6.234 + weight: 10 + metadata: + group: network + label: Host OS DNS Servers + weight: 30 + external_ntp: + metadata: + group: network + label: Host OS NTP Servers + weight: 40 + ntp_list: + description: List of upstream NTP servers + label: NTP server list + regex: + error: Invalid NTP server + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text_list + value: + - time1.ericsson.se + - time2.ericsson.se + weight: 10 + syslog: + metadata: + enabled: false + group: logging + label: Syslog + toggleable: true + weight: 50 + syslog_port: + description: Remote syslog port + label: Port + regex: + error: Invalid syslog port + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '514' + weight: 20 + syslog_server: + description: Remote syslog hostname + label: Hostname + regex: + error: Invalid hostname + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text + value: '' + weight: 10 + syslog_transport: + label: Syslog transport protocol + type: radio + value: tcp + values: + - data: udp + description: '' + label: UDP + - data: tcp + description: '' + label: TCP + weight: 30 + diff --git a/deploy/config/labs/devel-pipeline/elx/fuel/config/dha.yaml b/deploy/config/labs/devel-pipeline/elx/fuel/config/dha.yaml new file mode 100644 index 000000000..c2352f924 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/elx/fuel/config/dha.yaml @@ -0,0 +1,110 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +dha-pod-config-metadata: + title: Deployment Hardware Adapter (DHA) for fuel development pipeline - Ericsson ELX version + version: 0.0.3 + created: Feb 2 2016 + comment: ELX Fuel 9 version + +# Adapter to use for this definition +adapter: libvirt + +# Node list. +# Mandatory property is id, all other properties are adapter specific. + +nodes: +- id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml +- id: 2 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 3 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 4 + libvirtName: compute3 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 5 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +virtNetConfDir: templates/virtual_environment/networks + +disks: + fuel: 100G + controller: 100G + compute: 100G + +# Here the infrastructure VMs can be defined. +# The entries are not mandatory! If it is left empty +# the default defined in deploy/templates will +# be used. +define_vms: + fuel: + vcpu: + value: 2 + memory: + attribute_equlas: + unit: KiB + value: 8388608 + currentMemory: + attribute_equlas: + unit: KiB + value: 8388608 + devices: + interface: + # With attribute_equlas someone can define which + # interface type is meant + attribute_equlas: + type: network + # This will overwrite the type of the model of + # the interface + model: + attribute: + type: virtio + controller: + vcpu: + value: 4 + memory: + attribute_equlas: + unit: KiB + value: 10485760 + currentMemory: + attribute_equlas: + unit: KiB + value: 10485760 + devices: + interface: + attribute_equlas: + type: network + model: + attribute: + type: e1000 + compute: + memory: + attribute_equlas: + unit: KiB + value: 6291456 + currentMemory: + attribute_equlas: + unit: KiB + value: 6291456 + devices: + interface: + attribute_equlas: + type: network + model: + attribute: + type: e1000 + diff --git a/deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dea-pod-override.yaml b/deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dea-pod-override.yaml new file mode 100644 index 000000000..92cc0e616 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dea-pod-override.yaml @@ -0,0 +1,253 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +dea-pod-override-config-metadata: + title: 'Deployment Environment Adapter POD override for Development Pipeline - Huawei-China version' + version: '0.3' + created: 'Jun 14 2016' + comment: 'Rebased for Fuel 9' +environment: + name: opnfv_virt +interfaces_1: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +interfaces_dpdk: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + - interface_properties: + dpdk: + enabled: true + ens6: + - public +interfaces_vlan: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +fuel: + ADMIN_NETWORK: + dhcp_pool_end: 10.20.0.254 + dhcp_pool_start: 10.20.0.3 + ipaddress: 10.20.0.2 + netmask: 255.255.255.0 + ssh_network: 10.20.0.0/24 + DNS_DOMAIN: domain.tld + DNS_SEARCH: domain.tld + DNS_UPSTREAM: 114.114.114.114 + HOSTNAME: fuel + NTP1: 0.fuel.pool.ntp.org + NTP2: 1.fuel.pool.ntp.org + NTP3: 2.fuel.pool.ntp.org +network: + networking_parameters: + base_mac: fa:16:3e:00:00:00 + configuration_template: null + dns_nameservers: + - 114.114.114.114 + floating_name: admin_floating_net + floating_ranges: + - - 172.16.0.130 + - 172.16.0.254 + gre_id_range: + - 2 + - 65535 + internal_cidr: 192.168.111.0/24 + internal_gateway: 192.168.111.1 + internal_name: admin_internal_net + net_l23_provider: ovs + segmentation_type: tun + vlan_range: + - 1000 + - 1030 + networks: + - cidr: 192.168.1.0/24 + gateway: null + ip_ranges: + - - 192.168.1.1 + - 192.168.1.254 + meta: + cidr: 192.168.1.0/24 + configurable: true + map_priority: 2 + name: storage + notation: cidr + render_addr_mask: storage + render_type: cidr + use_gateway: false + vlan_start: 102 + name: storage + vlan_start: 102 + - cidr: 192.168.0.0/24 + gateway: null + ip_ranges: + - - 192.168.0.1 + - 192.168.0.253 + meta: + cidr: 192.168.0.0/24 + configurable: true + map_priority: 2 + name: management + notation: ip_ranges + render_addr_mask: internal + render_type: cidr + use_gateway: false + vips: + - haproxy + - vrouter + vlan_start: null + name: management + vlan_start: null + - cidr: 192.168.2.0/24 + gateway: null + ip_ranges: + - - 192.168.2.1 + - 192.168.2.254 + meta: + cidr: 192.168.2.0/24 + configurable: true + map_priority: 2 + name: private + notation: cidr + render_addr_mask: null + render_type: cidr + seg_type: tun + use_gateway: false + vlan_start: 103 + name: private + vlan_start: 103 + - cidr: 172.16.0.0/24 + gateway: 172.16.0.1 + ip_ranges: + - - 172.16.0.2 + - 172.16.0.126 + meta: + cidr: 172.16.0.0/24 + configurable: true + floating_range_var: floating_ranges + ip_range: + - 172.16.0.2 + - 172.16.0.126 + map_priority: 1 + name: public + notation: ip_ranges + render_addr_mask: public + render_type: null + use_gateway: true + vips: + - haproxy + - vrouter + vlan_start: null + name: public + vlan_start: null + - cidr: 10.20.0.0/24 + gateway: 10.20.0.2 + ip_ranges: + - - 10.20.0.3 + - 10.20.0.254 + meta: + configurable: false + map_priority: 0 + notation: ip_ranges + render_addr_mask: null + render_type: null + unmovable: true + use_gateway: true + name: fuelweb_admin + vlan_start: null +settings: + editable: + external_dns: + dns_list: + description: List of upstream DNS servers + label: DNS list + max: 3 + regex: + error: Invalid IP address + source: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: text_list + value: + - 114.114.114.114 + weight: 10 + metadata: + group: network + label: Host OS DNS Servers + weight: 30 + external_ntp: + metadata: + group: network + label: Host OS NTP Servers + weight: 40 + ntp_list: + description: List of upstream NTP servers + label: NTP server list + regex: + error: Invalid NTP server + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text_list + value: + - 0.fuel.pool.ntp.org + - 1.fuel.pool.ntp.org + - 2.fuel.pool.ntp.org + weight: 10 + syslog: + metadata: + enabled: false + group: logging + label: Syslog + toggleable: true + weight: 50 + syslog_port: + description: Remote syslog port + label: Port + regex: + error: Invalid syslog port + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '514' + weight: 20 + syslog_server: + description: Remote syslog hostname + label: Hostname + regex: + error: Invalid hostname + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text + value: '' + weight: 10 + syslog_transport: + label: Syslog transport protocol + type: radio + value: tcp + values: + - data: udp + description: '' + label: UDP + - data: tcp + description: '' + label: TCP + weight: 30 + diff --git a/deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dha.yaml b/deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dha.yaml new file mode 100644 index 000000000..d8f904362 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/huawei-ch/fuel/config/dha.yaml @@ -0,0 +1,47 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +dha-pod-config-metadata: + title: Deployment Hardware Adapter (DHA) for fuel development pipeline - default version + version: 0.0.4 + created: Jun 14 2016 + comment: Huawei-Ch Fuel9 version + +# Adapter to use for this definition +adapter: libvirt + +# Node list. +# Mandatory property is id, all other properties are adapter specific. + +nodes: +- id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml +- id: 2 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 3 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 4 + libvirtName: compute3 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 5 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +virtNetConfDir: templates/virtual_environment/networks + +disks: + fuel: 100G + controller: 100G + compute: 100G diff --git a/deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dea-pod-override.yaml b/deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dea-pod-override.yaml new file mode 100644 index 000000000..ed7c63fac --- /dev/null +++ b/deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dea-pod-override.yaml @@ -0,0 +1,251 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +dea-pod-override-config-metadata: + title: 'Deployment Environment Adapter POD override for Development Pipeline - Intel Santa Clara, CA, USA version' + version: '0.1' + created: 'Wed Sept 7 2016' + comment: 'For Fuel 9' +environment: + name: opnfv_virt +interfaces_1: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +interfaces_dpdk: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + - interface_properties: + dpdk: + enabled: true + ens6: + - public +interfaces_vlan: + ens3: + - fuelweb_admin + - storage + ens4: + - management + ens5: + - private + ens6: + - public +fuel: + ADMIN_NETWORK: + dhcp_pool_end: 10.20.0.254 + dhcp_pool_start: 10.20.0.3 + ipaddress: 10.20.0.2 + netmask: 255.255.255.0 + ssh_network: 10.20.0.0/24 + DNS_DOMAIN: domain.tld + DNS_SEARCH: domain.tld + DNS_UPSTREAM: 10.248.2.1 + HOSTNAME: fuel + NTP1: 10.20.0.1 + NTP2: null + NTP3: null +network: + networking_parameters: + base_mac: fa:16:3e:00:00:00 + configuration_template: null + dns_nameservers: + - 10.248.2.1 + floating_name: admin_floating_net + floating_ranges: + - - 172.16.0.130 + - 172.16.0.254 + gre_id_range: + - 2 + - 65535 + internal_cidr: 192.168.111.0/24 + internal_gateway: 192.168.111.1 + internal_name: admin_internal_net + net_l23_provider: ovs + segmentation_type: tun + vlan_range: + - 1000 + - 1030 + networks: + - cidr: 192.168.1.0/24 + gateway: null + ip_ranges: + - - 192.168.1.1 + - 192.168.1.254 + meta: + cidr: 192.168.1.0/24 + configurable: true + map_priority: 2 + name: storage + notation: cidr + render_addr_mask: storage + render_type: cidr + use_gateway: false + vlan_start: 102 + name: storage + vlan_start: 102 + - cidr: 192.168.0.0/24 + gateway: null + ip_ranges: + - - 192.168.0.1 + - 192.168.0.253 + meta: + cidr: 192.168.0.0/24 + configurable: true + map_priority: 2 + name: management + notation: ip_ranges + render_addr_mask: internal + render_type: cidr + use_gateway: false + vips: + - haproxy + - vrouter + vlan_start: null + name: management + vlan_start: null + - cidr: 192.168.2.0/24 + gateway: null + ip_ranges: + - - 192.168.2.1 + - 192.168.2.254 + meta: + cidr: 192.168.2.0/24 + configurable: true + map_priority: 2 + name: private + notation: cidr + render_addr_mask: null + render_type: cidr + seg_type: tun + use_gateway: false + vlan_start: 103 + name: private + vlan_start: 103 + - cidr: 172.16.0.0/24 + gateway: 172.16.0.1 + ip_ranges: + - - 172.16.0.2 + - 172.16.0.126 + meta: + cidr: 172.16.0.0/24 + configurable: true + floating_range_var: floating_ranges + ip_range: + - 172.16.0.2 + - 172.16.0.126 + map_priority: 1 + name: public + notation: ip_ranges + render_addr_mask: public + render_type: null + use_gateway: true + vips: + - haproxy + - vrouter + vlan_start: null + name: public + vlan_start: null + - cidr: 10.20.0.0/24 + gateway: 10.20.0.2 + ip_ranges: + - - 10.20.0.3 + - 10.20.0.254 + meta: + configurable: false + map_priority: 0 + notation: ip_ranges + render_addr_mask: null + render_type: null + unmovable: true + use_gateway: true + name: fuelweb_admin + vlan_start: null +settings: + editable: + external_dns: + dns_list: + description: List of upstream DNS servers + label: DNS list + max: 3 + regex: + error: Invalid IP address + source: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$ + type: text_list + value: + - 147.214.6.234 + weight: 10 + metadata: + group: network + label: Host OS DNS Servers + weight: 30 + external_ntp: + metadata: + group: network + label: Host OS NTP Servers + weight: 40 + ntp_list: + description: List of upstream NTP servers + label: NTP server list + regex: + error: Invalid NTP server + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text_list + value: + - 10.20.0.1 + weight: 10 + syslog: + metadata: + enabled: false + group: logging + label: Syslog + toggleable: true + weight: 50 + syslog_port: + description: Remote syslog port + label: Port + regex: + error: Invalid syslog port + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '514' + weight: 20 + syslog_server: + description: Remote syslog hostname + label: Hostname + regex: + error: Invalid hostname + source: ^[a-zA-Z\d]+[-\.\da-zA-Z]*$ + type: text + value: '' + weight: 10 + syslog_transport: + label: Syslog transport protocol + type: radio + value: tcp + values: + - data: udp + description: '' + label: UDP + - data: tcp + description: '' + label: TCP + weight: 30 + diff --git a/deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dha.yaml b/deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dha.yaml new file mode 100644 index 000000000..837293950 --- /dev/null +++ b/deploy/config/labs/devel-pipeline/intel-sc/fuel/config/dha.yaml @@ -0,0 +1,110 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# stefan.k.berg@ericsson.com +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +dha-pod-config-metadata: + title: Deployment Hardware Adapter (DHA) for fuel development pipeline - Intel Santa Clara, CA. USA version + version: 0.0.1 + created: Sept 7 2016 + comment: Intel Santa Clara, CA, USA Fuel 9 version + +# Adapter to use for this definition +adapter: libvirt + +# Node list. +# Mandatory property is id, all other properties are adapter specific. + +nodes: +- id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml +- id: 2 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 3 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 4 + libvirtName: compute3 + libvirtTemplate: templates/virtual_environment/vms/compute.xml +- id: 5 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +virtNetConfDir: templates/virtual_environment/networks + +disks: + fuel: 100G + controller: 100G + compute: 100G + +# Here the infrastructure VMs can be defined. +# The entries are not mandatory! If it is left empty +# the default defined in deploy/templates will +# be used. +define_vms: + fuel: + vcpu: + value: 2 + memory: + attribute_equlas: + unit: KiB + value: 8388608 + currentMemory: + attribute_equlas: + unit: KiB + value: 8388608 + devices: + interface: + # With attribute_equlas someone can define which + # interface type is meant + attribute_equlas: + type: network + # This will overwrite the type of the model of + # the interface + model: + attribute: + type: virtio + controller: + vcpu: + value: 4 + memory: + attribute_equlas: + unit: KiB + value: 10485760 + currentMemory: + attribute_equlas: + unit: KiB + value: 10485760 + devices: + interface: + attribute_equlas: + type: network + model: + attribute: + type: e1000 + compute: + memory: + attribute_equlas: + unit: KiB + value: 6291456 + currentMemory: + attribute_equlas: + unit: KiB + value: 6291456 + devices: + interface: + attribute_equlas: + type: network + model: + attribute: + type: e1000 + diff --git a/deploy/config/plugins/fuel-bgpvpn_0.0.1.yaml b/deploy/config/plugins/fuel-bgpvpn_0.0.1.yaml new file mode 100644 index 000000000..94f17c126 --- /dev/null +++ b/deploy/config/plugins/fuel-bgpvpn_0.0.1.yaml @@ -0,0 +1,22 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: BGPVPN fuel Plugin configuration template + version: 0.1 + created: Wed Jan 13 2016 + comment: None + +bgpvpn: + metadata: + enabled: true + restrictions: + - "cluster:net_provider != 'neutron'": "Only neutron is supported by BGPVPN-plugin" + label: "BGPVPN plugin" + weight: 90 diff --git a/deploy/config/plugins/fuel-bgpvpn_0.0.2.yaml b/deploy/config/plugins/fuel-bgpvpn_0.0.2.yaml new file mode 100644 index 000000000..f7ab89b37 --- /dev/null +++ b/deploy/config/plugins/fuel-bgpvpn_0.0.2.yaml @@ -0,0 +1,31 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +plugin-config-metadata: + title: BGPVPN fuel Plugin configuration template + version: 0.2 + created: Fri Feb 05 2016 + comment: None + +bgpvpn: + metadata: + class: plugin + default: false + enabled: false + label: BGPVPN plugin + toggleable: true + versions: + - metadata: + always_editable: false + enabled: true + label: BGPVPN plugin + plugin_version: 0.8.0 + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by BGPVPN-plugin + weight: 90 + weight: 70 diff --git a/deploy/config/plugins/fuel-bgpvpn_0.0.3.yaml b/deploy/config/plugins/fuel-bgpvpn_0.0.3.yaml new file mode 100644 index 000000000..aeea9e450 --- /dev/null +++ b/deploy/config/plugins/fuel-bgpvpn_0.0.3.yaml @@ -0,0 +1,30 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +plugin-config-metadata: + title: BGPVPN fuel Plugin configuration template + version: 0.3 + created: 08-Mar-16 + comment: None + +bgpvpn: + metadata: + class: plugin + default: false + enabled: true + label: BGPVPN plugin + toggleable: true + versions: + - metadata: + always_editable: false + label: BGPVPN plugin + plugin_version: 0.8.0 + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by BGPVPN-plugin + weight: 90 + weight: 70 diff --git a/deploy/config/plugins/fuel-bgpvpn_0.9.0.yaml b/deploy/config/plugins/fuel-bgpvpn_0.9.0.yaml new file mode 100644 index 000000000..1aa1259ca --- /dev/null +++ b/deploy/config/plugins/fuel-bgpvpn_0.9.0.yaml @@ -0,0 +1,30 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +plugin-config-metadata: + title: BGPVPN fuel Plugin configuration template + version: 0.9.0 + created: 29.06.2016 + comment: None + +bgpvpn: + metadata: + class: plugin + default: false + enabled: true + label: BGPVPN plugin + toggleable: true + versions: + - metadata: + always_editable: false + label: BGPVPN plugin + plugin_version: 0.9.0 + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by BGPVPN-plugin + weight: 90 + weight: 70 diff --git a/deploy/config/plugins/fuel-nfvkvm_0.0.1.yaml b/deploy/config/plugins/fuel-nfvkvm_0.0.1.yaml new file mode 100644 index 000000000..170424edb --- /dev/null +++ b/deploy/config/plugins/fuel-nfvkvm_0.0.1.yaml @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NFV QEMU-KVM fuel Plugin configuration template + version: 0.1 + created: Wed Jan 6 2016 + comment: None + +fuel-plugin-qemu: + metadata: + enabled: true + label: fuel-plugin-qemu + # plugin_id: Assigned during installation + toggleable: true + weight: 70 + use_kvm: + label: 'EXPERIMENTAL: KVM enhancements for NFV' + type: checkbox + value: true + weight: 20 diff --git a/deploy/config/plugins/fuel-nfvkvm_0.0.2.yaml b/deploy/config/plugins/fuel-nfvkvm_0.0.2.yaml new file mode 100644 index 000000000..842e1e10d --- /dev/null +++ b/deploy/config/plugins/fuel-nfvkvm_0.0.2.yaml @@ -0,0 +1,34 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NFV QEMU-KVM fuel Plugin configuration template + version: 0.2 + created: Tue Feb 9 2016 + comment: None + +fuel-plugin-qemu: + metadata: + #chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: fuel-plugin-qemu + toggleable: true + versions: + - metadata: + always_editable: false + #plugin_id: 1 Assigned during installation + plugin_version: 0.5.2 + use_kvm: + label: 'EXPERIMENTAL: KVM enhancements for NFV' + type: checkbox + value: true + weight: 20 + weight: 70 diff --git a/deploy/config/plugins/fuel-nfvkvm_0.9.0.yaml b/deploy/config/plugins/fuel-nfvkvm_0.9.0.yaml new file mode 100644 index 000000000..85f3221f7 --- /dev/null +++ b/deploy/config/plugins/fuel-nfvkvm_0.9.0.yaml @@ -0,0 +1,34 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NFV KVM fuel Plugin configuration template + version: 0.9.0 + created: 27.07.2016 + comment: None + +fuel-plugin-kvm: + metadata: + #chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: fuel-plugin-kvm + toggleable: true + versions: + - metadata: + always_editable: false + #plugin_id: 1 Assigned during installation + plugin_version: 0.9.0 + use_kvm: + label: 'EXPERIMENTAL: KVM enhancements for NFV' + type: checkbox + value: true + weight: 20 + weight: 70 diff --git a/deploy/config/plugins/fuel-nfvovs_0.0.1.yaml b/deploy/config/plugins/fuel-nfvovs_0.0.1.yaml new file mode 100644 index 000000000..fdaba2a21 --- /dev/null +++ b/deploy/config/plugins/fuel-nfvovs_0.0.1.yaml @@ -0,0 +1,28 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NFV OVS fuel Plugin configuration template + version: 0.1 + created: Wed Jan 6 2016 + comment: None + +fuel-plugin-ovsnfv: + fuel-plugin-ovsnfv_text: + description: Description for text field + label: Text field + type: text + value: Set default value + weight: 25 + metadata: + enabled: true + label: Userspace OVS support + # plugin_id: Assigned during installation + toggleable: true + weight: 70 diff --git a/deploy/config/plugins/fuel-nfvovs_0.0.2.yaml b/deploy/config/plugins/fuel-nfvovs_0.0.2.yaml new file mode 100644 index 000000000..902938211 --- /dev/null +++ b/deploy/config/plugins/fuel-nfvovs_0.0.2.yaml @@ -0,0 +1,35 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NFV OVS fuel Plugin configuration template + version: 0.2 + created: Mon Feb 15 2016 + comment: Rebased for new plugin arch + +fuel-plugin-ovsnfv: + metadata: + #chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: Userspace OVS support + toggleable: true + versions: + - fuel-plugin-ovsnfv_text: + description: Specify compute node interface to which OVS-DPDK binds + label: NIC for DPDK + type: text + value: ens1f1 + weight: 25 + metadata: + always_editable: false + #plugin_id: Assigned during installation + plugin_version: 0.0.1 + weight: 70 diff --git a/deploy/config/plugins/fuel-nshovs_0.0.1.yaml b/deploy/config/plugins/fuel-nshovs_0.0.1.yaml new file mode 100644 index 000000000..ec3ac38a9 --- /dev/null +++ b/deploy/config/plugins/fuel-nshovs_0.0.1.yaml @@ -0,0 +1,44 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NSHOVS fuel Plugin configuration template + version: 0.1 + created: Wed Feb 17 2016 + comment: None + +fuel-plugin-ovs: + metadata: + #chosen_id: Choosen at install time + class: plugin + default: false + enabled: true + label: Openvswitch with NSH support + toggleable: true + versions: + - dpdk-bind-nic: + label: Network device + type: text + value: eth2 + weight: 40 + metadata: + always_editable: false + #plugin_id: Choosen at install time + plugin_version: 0.5.2 + use_dpdk: + label: Use dpdk + type: checkbox + value: false + weight: 20 + use_dppd: + label: Use dppd + type: checkbox + value: false + weight: 20 + weight: 70 diff --git a/deploy/config/plugins/fuel-nshovs_0.9.0.yaml b/deploy/config/plugins/fuel-nshovs_0.9.0.yaml new file mode 100644 index 000000000..b5caae039 --- /dev/null +++ b/deploy/config/plugins/fuel-nshovs_0.9.0.yaml @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: NSHOVS fuel Plugin configuration template + version: 0.2 + created: Jun 30 2016 + comment: None + +fuel-plugin-ovs: + metadata: + #chosen_id: Choosen at install time + class: plugin + default: false + enabled: true + label: Openvswitch with NSH support + toggleable: true + versions: + - install_dpdk: + type: "checkbox" + weight: 20 + value: false + label: "Install DPDK" + install_nsh: + type: "checkbox" + weight: 20 + value: false + label: "Install NSH" + metadata: + plugin_version: 0.9.0 + weight: 70 diff --git a/deploy/config/plugins/fuel-odl_0.0.1.yaml b/deploy/config/plugins/fuel-odl_0.0.1.yaml new file mode 100644 index 000000000..53c510557 --- /dev/null +++ b/deploy/config/plugins/fuel-odl_0.0.1.yaml @@ -0,0 +1,91 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: OpenDaylight fuel Plugin configuration template + version: 0.1 + created: Mon Dec 28 2015 + comment: None + +opendaylight: + metadata: + # chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: OpenDaylight plugin + toggleable: true + versions: + - enable_gbp: + label: GBP features + type: checkbox + value: false + weight: 14 + enable_l3_odl: + label: Use ODL to manage L3 traffic + restrictions: + - networking_parameters:segmentation_type == 'vlan': Use tunneling segmentation + type. + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + type: checkbox + value: true + weight: 12 + enable_sfc: + label: SFC features + type: checkbox + value: false + weight: 13 + metadata: + always_editable: false + odl_features: + default: + - config + - standard + - region + - package + - kar + - ssh + - management + gbp: + - odl-groupbasedpolicy-base + - odl-groupbasedpolicy-ofoverlay + ovs: + - odl-ovsdb-openstack + - odl-restconf-all + - odl-aaa-authn + - odl-dlux-all + sfc: + - odl-sfc-core + - odl-sfc-sb-rest + - odl-sfc-ui + - odl-sfc-netconf + - odl-sfc-ovs + - odl-sfcofl2 + - odl-sfc-test-consumer + vpn: + - odl-vpnservice-api + - odl-vpnservice-impl + - odl-vpnservice-impl-rest + - odl-vpnservice-impl-ui + - odl-vpnservice-core + # plugin_id: Assigned during installation + plugin_version: 0.8.0 + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by OpenDaylight + rest_api_port: + description: Port on which ODL REST API will be available. + label: Port number + regex: + error: Invalid port number + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '8282' + weight: 40 + weight: 70 diff --git a/deploy/config/plugins/fuel-odl_0.0.2.yaml b/deploy/config/plugins/fuel-odl_0.0.2.yaml new file mode 100644 index 000000000..bd2ef5bb2 --- /dev/null +++ b/deploy/config/plugins/fuel-odl_0.0.2.yaml @@ -0,0 +1,91 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: OpenDaylight fuel Plugin configuration template + version: 0.2 + created: Tue Jan 26 2016 + comment: Rebased to Fuel8 and BE ODL plugin +opendaylight: + metadata: + # chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: OpenDaylight plugin + toggleable: true + versions: + - enable_gbp: + label: GBP features + type: checkbox + value: false + weight: 14 + enable_l3_odl: + label: Use ODL to manage L3 traffic + restrictions: + - networking_parameters:segmentation_type == 'vlan': Use tunneling segmentation + type. + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + type: checkbox + value: false + weight: 12 + enable_sfc: + label: SFC features + type: checkbox + value: false + weight: 13 + metadata: + always_editable: false + odl_features: + default: + - config + - standard + - region + - package + - kar + - ssh + - management + gbp: + - odl-groupbasedpolicy-base + - odl-groupbasedpolicy-ofoverlay + ovs: + - odl-ovsdb-openstack + - odl-restconf-all + - odl-aaa-authn + - odl-dlux-all + sfc: + - odl-sfc-core + - odl-sfc-sb-rest + - odl-sfc-ui + - odl-sfc-netconf + - odl-sfc-ovs + - odl-sfcofl2 + - odl-sfc-test-consumer + vpn: + - odl-vpnservice-api + - odl-vpnservice-impl + - odl-vpnservice-impl-rest + - odl-vpnservice-impl-ui + - odl-vpnservice-core + - odl-vpnservice-openstack + # plugin_id: Assigned during installation + plugin_version: 0.8.0 + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by OpenDaylight + rest_api_port: + description: Port on which ODL REST API will be available. + label: Port number + regex: + error: Invalid port number + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '8282' + weight: 40 + weight: 70 diff --git a/deploy/config/plugins/fuel-odl_0.0.3.yaml b/deploy/config/plugins/fuel-odl_0.0.3.yaml new file mode 100644 index 000000000..5c0078dbf --- /dev/null +++ b/deploy/config/plugins/fuel-odl_0.0.3.yaml @@ -0,0 +1,117 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: OpenDaylight fuel Plugin configuration template + version: 0.3 + created: 04.03.2016 + comment: Added bgpvpn feature +opendaylight: + metadata: + # chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: OpenDaylight plugin + toggleable: true + versions: + - enable_gbp: + label: GBP features + type: checkbox + value: false + weight: 14 + enable_l3_odl: + label: Use ODL to manage L3 traffic + restrictions: + - networking_parameters:segmentation_type == 'vlan': Use tunneling segmentation + type. + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + type: checkbox + value: false + weight: 12 + enable_sfc: + label: SFC features + type: checkbox + value: false + weight: 13 + enable_bgpvpn: + weight: 13 + type: "checkbox" + value: false + label: "BGPVPN extensions" + description: + > + This enables the bgpvpn extension of neutron togethere with the + corresponding sdnvpn features in odl. This feature will disable + the standart ovsdb feature from ODL. + restrictions: + - condition: "settings:bgpvpn == null or settings:bgpvpn.metadata.enabled == false" + strict: false + message: "BGPVPN (fuel-plugin-bgpvpn) plugin must be installed and enabled." + - networking_parameters:segmentation_type == 'vlan': This feature works only with segmentation_type != vlan + - condition: "settings:fuel-plugin-ovs == null or settings:fuel-plugin-ovs.metadata.enabled == false" + strict: false + message: "Openvswitch with NSH support (fuel-plugin-ovs) must be installed and enabled." + bgpvpn_gateway: + weight: 13 + type: "text" + value: "0.0.0.0" + description: "Define the default gateway for BGPVPN" + label: "Default Gateway" + restrictions: + - settings:opendaylight.enable_bgpvpn.value == false: Only needed if BGPVPN is enabled. + regex: + source: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ + error: 'Invalid ip number' + metadata: + always_editable: false + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by OpenDaylight + odl_features: + default: + - config + - standard + - region + - package + - kar + - ssh + - management + odl-default: + - odl-restconf-all + - odl-aaa-authn + - odl-dlux-all + gbp: + - odl-groupbasedpolicy-neutronmapper + - odl-groupbasedpolicy-ofoverlay + ovs: + - odl-ovsdb-openstack + sfc: + - odl-sfc-model + - odl-sfc-provider + - odl-sfc-provider-rest + - odl-sfc-sb-rest + - odl-sfc-ui + - odl-sfc-netconf + - odl-sfc-ovs + - odl-sfcofl2 + vpn: + - odl-vpnservice-openstack + # plugin_id: Assigned during installation + plugin_version: 0.8.1 + rest_api_port: + value: '8282' + label: 'Port number' + description: 'Port on which ODL REST API will be available.' + weight: 40 + type: "text" + regex: + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + error: 'Invalid port number' + weight: 70 diff --git a/deploy/config/plugins/fuel-odl_0.9.0.yaml b/deploy/config/plugins/fuel-odl_0.9.0.yaml new file mode 100644 index 000000000..6caf4834f --- /dev/null +++ b/deploy/config/plugins/fuel-odl_0.9.0.yaml @@ -0,0 +1,143 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: OpenDaylight fuel Plugin configuration template + version: 0.4 + created: 30.06.2016 + comment: Add new field for boron version +opendaylight: + metadata: + #chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: OpenDaylight plugin + toggleable: true + versions: + - bgpvpn_gateway: + description: Define the default gateway for BGPVPN + label: Default Gateway + regex: + error: Invalid ip number + source: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ + restrictions: + - settings:opendaylight.enable_bgpvpn.value == false: Only needed if BGPVPN + is enabled. + type: text + value: 0.0.0.0 + weight: 50 + enable_bgpvpn: + description: 'This enables the bgpvpn extension of neutron togethere with + the corresponding sdnvpn features in odl. This feature will disable the + standart ovsdb feature from ODL. + + ' + label: BGPVPN extensions + restrictions: + - condition: settings:bgpvpn == null or settings:bgpvpn.metadata.enabled + == false + message: BGPVPN (fuel-plugin-bgpvpn) plugin must be installed and enabled. + strict: false + - networking_parameters:segmentation_type == 'vlan': This feature works + only with segmentation_type != vlan + type: checkbox + value: false + weight: 40 + enable_l3_odl: + label: Use ODL to manage L3 traffic + restrictions: + - networking_parameters:segmentation_type == 'vlan': Use tunneling segmentation + type. + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + type: checkbox + value: false + weight: 10 + enable_sfc: + label: SFC features + type: checkbox + value: false + weight: 20 + sfc_class: + description: 'Classifier determines what traffic needs to be chained based + on policy based on yang model. The OpenDayLight actually supports the + OVSDB NetVirt and the GBP classifier in case of SFC. + + ' + label: Classifier used by SFC + restrictions: + - action: hide + condition: settings:opendaylight.enable_sfc.value == false + type: select + value: ncr + values: + - data: ncr + label: NetVirt + - data: gcr + label: GBP + weight: 21 + metadata: + default_credentials: + password: admin + user: admin + hot_pluggable: false + jetty_port: 8181 + odl_features: + default: + - config + - standard + - region + - package + - kar + - ssh + - management + gcr: + - odl-groupbasedpolicy-ovssfc + ncr: + - odl-ovsdb-sfc + - odl-ovsdb-sfc-rest + odl-default: + - odl-restconf-all + - odl-aaa-authn + - odl-dlux-all + ovs: + - odl-ovsdb-openstack + sfc: + - odl-sfc-model + - odl-sfc-provider + - odl-sfc-provider-rest + - odl-sfc-ovs + - odl-sfc-openflow-renderer + vpn: + - odl-vpnservice-openstack + odl_deb: opendaylight + experimental_odl_deb: opendaylight-boron + use_experimental_odl: + - enable_sfc + #plugin_id: Assigned during installation + plugin_version: 0.9.0 + restrictions: + - cluster:net_provider != 'neutron': Only neutron is supported by OpenDaylight + odl_v2: + description: V2 version is considered as experimental + label: Use V2 ML2 driver + type: checkbox + value: true + weight: 60 + rest_api_port: + description: Port on which ODL REST API will be available. + label: Port number + regex: + error: Invalid port number + source: ^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$ + type: text + value: '8282' + weight: 70 + weight: 70 diff --git a/deploy/config/plugins/fuel-onos_0.0.1.yaml b/deploy/config/plugins/fuel-onos_0.0.1.yaml new file mode 100644 index 000000000..54ecdc0dc --- /dev/null +++ b/deploy/config/plugins/fuel-onos_0.0.1.yaml @@ -0,0 +1,33 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: ONOS fuel Plugin configuration template + version: 0.1 + created: Wed Jan 7 2016 + comment: None + +onos: + metadata: + enabled: true + label: onos plugin + # plugin_id: Assigned during installation + restrictions: + - cluster:net_provider != 'neutron': Neutron only + toggleable: true + weight: 70 + public_eth: + description: Please note that onos needs an independent eth for public + network when interfaces of nodes are configured, or L3 traffic to + internet will fail! + Defualt is eth3. + label: Public Ethernet Port + type: text + value: eth3 + weight: 20 diff --git a/deploy/config/plugins/fuel-onos_0.0.2.yaml b/deploy/config/plugins/fuel-onos_0.0.2.yaml new file mode 100644 index 000000000..1d0b54d04 --- /dev/null +++ b/deploy/config/plugins/fuel-onos_0.0.2.yaml @@ -0,0 +1,33 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: ONOS fuel Plugin configuration template + version: 0.2 + created: Fre Jan 29 2016 + comment: None + +onos: + metadata: + # chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: onos plugin + toggleable: true + versions: + - metadata: + always_editable: false + # plugin_id: Assigned during installation + plugin_version: 0.8.0 + restrictions: + - cluster:net_provider != 'neutron': Neutron only + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + weight: 70 diff --git a/deploy/config/plugins/fuel-onos_0.0.3.yaml b/deploy/config/plugins/fuel-onos_0.0.3.yaml new file mode 100644 index 000000000..16f753144 --- /dev/null +++ b/deploy/config/plugins/fuel-onos_0.0.3.yaml @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +plugin-config-metadata: + title: ONOS fuel Plugin configuration template + version: 0.3 + created: Wed Jun 8 2016 + comment: add sfc feature + +onos: + metadata: + # chosen_id: Assigned during installation + class: plugin + default: false + enabled: true + label: onos plugin + toggleable: true + versions: + - enable_sfc: + label: SFC features + type: checkbox + value: true + weight: 13 + metadata: + hot_pluggable: false + # plugin_id: Assigned during installation + plugin_version: 0.9.0 + restrictions: + - cluster:net_provider != 'neutron': Neutron only + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + weight: 70 diff --git a/deploy/dea.py b/deploy/dea.py new file mode 100644 index 000000000..1ac048e06 --- /dev/null +++ b/deploy/dea.py @@ -0,0 +1,105 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import yaml +import io +import netaddr + + +class DeploymentEnvironmentAdapter(object): + + def __init__(self, yaml_path): + self.dea_struct = None + self.parse_yaml(yaml_path) + self.network_names = [] + self.collect_network_names() + + def modify_ip(self, ip_addr, index, val): + ip_str = str(netaddr.IPAddress(ip_addr)) + decimal_list = map(int, ip_str.split('.')) + decimal_list[index] = val + return '.'.join(map(str, decimal_list)) + + def parse_yaml(self, yaml_path): + with io.open(yaml_path) as yaml_file: + self.dea_struct = yaml.load(yaml_file) + + def get_env_name(self): + return self.get_property('environment')['name'] + + def get_env_net_segment_type(self): + return self.get_property('environment')['net_segment_type'] + + def get_fuel_config(self): + return self.dea_struct['fuel'] + + def get_fuel_ip(self): + fuel_conf = self.get_fuel_config() + return fuel_conf['ADMIN_NETWORK']['ipaddress'] + + def get_fuel_netmask(self): + fuel_conf = self.get_fuel_config() + return fuel_conf['ADMIN_NETWORK']['netmask'] + + def get_fuel_gateway(self): + ip = self.get_fuel_ip() + return self.modify_ip(ip, 3, 1) + + def get_fuel_hostname(self): + fuel_conf = self.get_fuel_config() + return fuel_conf['HOSTNAME'] + + def get_fuel_dns(self): + fuel_conf = self.get_fuel_config() + return fuel_conf['DNS_UPSTREAM'] + + def get_node_property(self, node_id, property_name): + for node in self.dea_struct['nodes']: + if node['id'] == node_id and property_name in node: + return node[property_name] + + def get_node_roles(self, node_id): + return self.get_node_property(node_id, 'role') + + def get_node_main_role(self, node_id, fuel_node_id): + if node_id == fuel_node_id: + return 'fuel' + roles = self.get_node_roles(node_id) + return 'controller' if 'controller' in roles else 'compute' + + def get_node_ids(self): + node_ids = [] + for node in self.dea_struct['nodes']: + node_ids.append(node['id']) + return node_ids + + def get_property(self, property_name): + return self.dea_struct[property_name] + + def collect_network_names(self): + self.network_names = [] + for network in self.dea_struct['network']['networks']: + self.network_names.append(network['name']) + + def get_network_names(self): + return self.network_names + + def get_dns_list(self): + settings = self.get_property('settings') + dns_list = settings['editable']['external_dns']['dns_list']['value'] + return [d.strip() for d in dns_list.split(',')] + + def get_ntp_list(self): + settings = self.get_property('settings') + ntp_list = settings['editable']['external_ntp']['ntp_list']['value'] + return [n.strip() for n in ntp_list.split(',')] + + def get_blade_node_map(self): + return self.dea_struct['blade_node_map'] diff --git a/deploy/deploy-config.py b/deploy/deploy-config.py new file mode 100644 index 000000000..2a09aa351 --- /dev/null +++ b/deploy/deploy-config.py @@ -0,0 +1,467 @@ +#!/usr/bin/python +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + +############################################################################### +# Description +# This script constructs the final deployment dea.yaml and dha.yaml files +# The dea.yaml get's constructed from (in reverse priority): +# 1) dea-base +# 2) dea-pod-override +# 3) deployment-scenario dea-override-config section +# +# The dha.yaml get's constructed from (in reverse priority): +# 1) pod dha +# 2) deployment-scenario dha-override-config section +############################################################################### + + +import os +import yaml +import sys +import urllib2 +import calendar +import time +import collections +import hashlib + +from functools import reduce +from operator import or_ +from common import ( + log, + exec_cmd, + err, + warn, + check_file_exists, + create_dir_if_not_exists, + delete, + check_if_root, + ArgParser, +) + + +def parse_arguments(): + parser = ArgParser(prog='python %s' % __file__) + parser.add_argument('-dha', dest='dha_uri', action='store', + default=False, + help='dha configuration file FQDN URI', + required=True) + parser.add_argument('-deab', dest='dea_base_uri', action='store', + default=False, + help='dea base configuration FQDN URI', + required=True) + parser.add_argument('-deao', dest='dea_pod_override_uri', + action='store', + default=False, + help='dea POD override configuration FQDN URI', + required=True) + parser.add_argument('-scenario-base-uri', + dest='scenario_base_uri', + action='store', + default=False, + help='Deployment scenario base directory URI', + required=True) + parser.add_argument('-scenario', dest='scenario', action='store', + default=False, + help=('Deployment scenario short-name (priority), ' + 'or base file name (in the absense of a ' + 'shortname defenition)'), + required=True) + + parser.add_argument('-plugins', dest='plugins_uri', action='store', + default=False, + help='Plugin configurations directory URI', + required=True) + parser.add_argument('-output', dest='output_path', action='store', + default=False, + help='Local path for resulting output configuration files', + required=True) + args = parser.parse_args() + kwargs = {'dha_uri': args.dha_uri, + 'dea_base_uri': args.dea_base_uri, + 'dea_pod_override_uri': args.dea_pod_override_uri, + 'scenario_base_uri': args.scenario_base_uri, + 'scenario': args.scenario, + 'plugins_uri': args.plugins_uri, + 'output_path': args.output_path} + return kwargs + + +def warning(msg): + red = '\033[0;31m' + NC = '\033[0m' + print('%(red)s WARNING: %(msg)s %(NC)s' % {'red': red, + 'msg': msg, + 'NC': NC}) + + +def setup_yaml(): + represent_dict_order = lambda self, data: self.represent_mapping('tag:yaml.org,2002:map', data.items()) + yaml.add_representer(collections.OrderedDict, represent_dict_order) + + +def sha_uri(uri): + response = urllib2.urlopen(uri) + data = response.read() + sha1 = hashlib.sha1() + sha1.update(data) + return sha1.hexdigest() + + +def merge_fuel_plugin_version_list(list1, list2): + final_list = [] + # When the plugin version in not there in list1 it will + # not be copied + for e_l1 in list1: + plugin_version = e_l1.get('metadata', {}).get('plugin_version') + plugin_version_found = False + for e_l2 in list2: + if plugin_version == e_l2.get('metadata', {}).get('plugin_version'): + final_list.append(dict(merge_dicts(e_l1, e_l2))) + plugin_version_found = True + if not plugin_version_found: + final_list.append(e_l1) + return final_list + + +def merge_networks(list_1, list_2): + new_nets = {x.get('name'): x for x in list_2} + + return [new_nets.get(net.get('name'), net) for net in list_1] + + +def merge_dicts(dict1, dict2): + for k in set(dict1).union(dict2): + if k in dict1 and k in dict2: + if isinstance(dict1[k], dict) and isinstance(dict2[k], dict): + yield (k, dict(merge_dicts(dict1[k], dict2[k]))) + continue + if isinstance(dict1[k], list) and isinstance(dict2[k], list): + if k == 'versions': + yield (k, + merge_fuel_plugin_version_list(dict1[k], dict2[k])) + continue + if k == 'networks': + yield (k, + merge_networks(dict1[k], dict2[k])) + continue + + # If one of the values is not a dict nor a list, + # you can't continue merging it. + # Value from second dict overrides one in first if exists. + if k in dict2: + yield (k, dict2[k]) + else: + yield (k, dict1[k]) + + +def get_node_ifaces_and_trans(nodes, nid): + for node in nodes: + if node['id'] == nid: + if 'transformations' in node and 'interfaces' in node: + return (node['interfaces'], node['transformations']) + else: + return None + + return None + + +class DeployConfig(object): + def __init__(self): + self.kwargs = parse_arguments() + self.dea_conf = dict() + self.dea_metadata = dict() + self.dea_pod_ovr_metadata = dict() + self.dea_pod_ovr_nodes = None + self.scenario_metadata = dict() + self.modules = [] + self.module_uris = [] + self.module_titles = [] + self.module_versions = [] + self.module_createds = [] + self.module_shas = [] + self.module_comments = [] + self.dha_pod_conf = dict() + self.dha_metadata = dict() + + def process_dea_base(self): + # Generate final dea.yaml by merging following config files/fragments in reverse priority order: + # "dea-base", "dea-pod-override", "deplyment-scenario/module-config-override" + # and "deployment-scenario/dea-override" + print('Generating final dea.yaml configuration....') + + # Fetch dea-base, extract and purge meta-data + print('Parsing dea-base from: ' + self.kwargs["dea_base_uri"] + "....") + response = urllib2.urlopen(self.kwargs["dea_base_uri"]) + dea_conf = yaml.load(response.read()) + + dea_metadata = dict() + dea_metadata['title'] = dea_conf['dea-base-config-metadata']['title'] + dea_metadata['version'] = dea_conf['dea-base-config-metadata']['version'] + dea_metadata['created'] = dea_conf['dea-base-config-metadata']['created'] + dea_metadata['sha'] = sha_uri(self.kwargs["dea_base_uri"]) + dea_metadata['comment'] = dea_conf['dea-base-config-metadata']['comment'] + self.dea_metadata = dea_metadata + dea_conf.pop('dea-base-config-metadata') + self.dea_conf = dea_conf + + def process_dea_pod_override(self): + # Fetch dea-pod-override, extract and purge meta-data, merge with previous dea data structure + print('Parsing the dea-pod-override from: ' + self.kwargs["dea_pod_override_uri"] + "....") + response = urllib2.urlopen(self.kwargs["dea_pod_override_uri"]) + dea_pod_override_conf = yaml.load(response.read()) + + if dea_pod_override_conf: + metadata = dict() + metadata['title'] = dea_pod_override_conf['dea-pod-override-config-metadata']['title'] + metadata['version'] = dea_pod_override_conf['dea-pod-override-config-metadata']['version'] + metadata['created'] = dea_pod_override_conf['dea-pod-override-config-metadata']['created'] + metadata['sha'] = sha_uri(self.kwargs["dea_pod_override_uri"]) + metadata['comment'] = dea_pod_override_conf['dea-pod-override-config-metadata']['comment'] + self.dea_pod_ovr_metadata = metadata + + print('Merging dea-base and dea-pod-override configuration ....') + dea_pod_override_conf.pop('dea-pod-override-config-metadata') + + # Copy the list of original nodes, which holds info on their transformations + if 'nodes' in dea_pod_override_conf: + self.dea_pod_ovr_nodes = list(dea_pod_override_conf['nodes']) + if dea_pod_override_conf: + self.dea_conf = dict(merge_dicts(self.dea_conf, dea_pod_override_conf)) + + def get_scenario_uri(self): + response = urllib2.urlopen(self.kwargs["scenario_base_uri"] + "/scenario.yaml") + scenario_short_translation_conf = yaml.load(response.read()) + if self.kwargs["scenario"] in scenario_short_translation_conf: + scenario_uri = (self.kwargs["scenario_base_uri"] + + "/" + + scenario_short_translation_conf[self.kwargs["scenario"]]['configfile']) + else: + scenario_uri = self.kwargs["scenario_base_uri"] + "/" + self.kwargs["scenario"] + + return scenario_uri + + def get_scenario_config(self): + self.scenario_metadata['uri'] = self.get_scenario_uri() + response = urllib2.urlopen(self.scenario_metadata['uri']) + return yaml.load(response.read()) + + def process_modules(self): + scenario_conf = self.get_scenario_config() + if scenario_conf["stack-extensions"]: + for module in scenario_conf["stack-extensions"]: + print('Loading configuration for module: ' + + module["module"] + + ' and merging it to final dea.yaml configuration....') + response = urllib2.urlopen(self.kwargs["plugins_uri"] + + '/' + + module["module-config-name"] + + '_' + + module["module-config-version"] + + '.yaml') + module_conf = yaml.load(response.read()) + self.modules.append(module["module"]) + self.module_uris.append(self.kwargs["plugins_uri"] + + '/' + + module["module-config-name"] + + '_' + + module["module-config-version"] + + '.yaml') + self.module_titles.append(str(module_conf['plugin-config-metadata']['title'])) + self.module_versions.append(str(module_conf['plugin-config-metadata']['version'])) + self.module_createds.append(str(module_conf['plugin-config-metadata']['created'])) + self.module_shas.append(sha_uri(self.kwargs["plugins_uri"] + + '/' + + module["module-config-name"] + + '_' + + module["module-config-version"] + + '.yaml')) + self.module_comments.append(str(module_conf['plugin-config-metadata']['comment'])) + module_conf.pop('plugin-config-metadata') + self.dea_conf['settings']['editable'].update(module_conf) + + scenario_module_override_conf = module.get('module-config-override') + if scenario_module_override_conf: + dea_scenario_module_override_conf = {} + dea_scenario_module_override_conf['settings'] = {} + dea_scenario_module_override_conf['settings']['editable'] = {} + dea_scenario_module_override_conf['settings']['editable'][module["module"]] = scenario_module_override_conf + self.dea_conf = dict(merge_dicts(self.dea_conf, dea_scenario_module_override_conf)) + + def process_scenario_config(self): + # Fetch deployment-scenario, extract and purge meta-data, merge deployment-scenario/ + # dea-override-configith previous dea data structure + print('Parsing deployment-scenario from: ' + self.kwargs["scenario"] + "....") + + scenario_conf = self.get_scenario_config() + + metadata = dict() + if scenario_conf: + metadata['title'] = scenario_conf['deployment-scenario-metadata']['title'] + metadata['version'] = scenario_conf['deployment-scenario-metadata']['version'] + metadata['created'] = scenario_conf['deployment-scenario-metadata']['created'] + metadata['sha'] = sha_uri(self.scenario_metadata['uri']) + metadata['comment'] = scenario_conf['deployment-scenario-metadata']['comment'] + self.scenario_metadata = metadata + scenario_conf.pop('deployment-scenario-metadata') + else: + print("Deployment scenario file not found or is empty") + print("Cannot continue, exiting ....") + sys.exit(1) + + dea_scenario_override_conf = scenario_conf["dea-override-config"] + if dea_scenario_override_conf: + print('Merging dea-base-, dea-pod-override- and deployment-scenario ' + 'configuration into final dea.yaml configuration....') + self.dea_conf = dict(merge_dicts(self.dea_conf, dea_scenario_override_conf)) + + self.process_modules() + + # Fetch plugin-configuration configuration files, extract and purge meta-data, + # merge/append with previous dea data structure, override plugin-configuration with + # deploy-scenario/module-config-override + + if self.dea_pod_ovr_nodes: + for node in self.dea_conf['nodes']: + data = get_node_ifaces_and_trans(self.dea_pod_ovr_nodes, node['id']) + if data: + print("Honoring original interfaces and transformations for " + "node %d to %s, %s" % (node['id'], data[0], data[1])) + node['interfaces'] = data[0] + node['transformations'] = data[1] + + def dump_dea_config(self): + # Dump final dea.yaml including configuration management meta-data to argument provided + # directory + path = self.kwargs["output_path"] + if not os.path.exists(path): + os.makedirs(path) + print('Dumping final dea.yaml to ' + path + '/dea.yaml....') + with open(path + '/dea.yaml', "w") as f: + f.write("\n".join([("title: DEA.yaml file automatically generated from the " + 'configuration files stated in the "configuration-files" ' + "fragment below"), + "version: " + str(calendar.timegm(time.gmtime())), + "created: " + time.strftime("%d/%m/%Y %H:%M:%S"), + "comment: none\n"])) + + f.write("\n".join(["configuration-files:", + " dea-base:", + " uri: " + self.kwargs["dea_base_uri"], + " title: " + self.dea_metadata['title'], + " version: " + self.dea_metadata['version'], + " created: " + self.dea_metadata['created'], + " sha1: " + sha_uri(self.kwargs["dea_base_uri"]), + " comment: " + self.dea_metadata['comment'] + "\n"])) + + f.write("\n".join([" pod-override:", + " uri: " + self.kwargs["dea_pod_override_uri"], + " title: " + self.dea_pod_ovr_metadata['title'], + " version: " + self.dea_pod_ovr_metadata['version'], + " created: " + self.dea_pod_ovr_metadata['created'], + " sha1: " + self.dea_pod_ovr_metadata['sha'], + " comment: " + self.dea_pod_ovr_metadata['comment'] + "\n"])) + + f.write("\n".join([" deployment-scenario:", + " uri: " + self.scenario_metadata['uri'], + " title: " + self.scenario_metadata['title'], + " version: " + self.scenario_metadata['version'], + " created: " + self.scenario_metadata['created'], + " sha1: " + self.scenario_metadata['sha'], + " comment: " + self.scenario_metadata['comment'] + "\n"])) + + f.write(" plugin-modules:\n") + for k, _ in enumerate(self.modules): + f.write("\n".join([" - module: " + self.modules[k], + " uri: " + self.module_uris[k], + " title: " + self.module_titles[k], + " version: " + self.module_versions[k], + " created: " + self.module_createds[k], + " sha-1: " + self.module_shas[k], + " comment: " + self.module_comments[k] + "\n"])) + + yaml.dump(self.dea_conf, f, default_flow_style=False) + + def process_dha_pod_config(self): + # Load POD dha and override it with "deployment-scenario/dha-override-config" section + print('Generating final dha.yaml configuration....') + print('Parsing dha-pod yaml configuration....') + response = urllib2.urlopen(self.kwargs["dha_uri"]) + dha_pod_conf = yaml.load(response.read()) + + dha_metadata = dict() + dha_metadata['title'] = dha_pod_conf['dha-pod-config-metadata']['title'] + dha_metadata['version'] = dha_pod_conf['dha-pod-config-metadata']['version'] + dha_metadata['created'] = dha_pod_conf['dha-pod-config-metadata']['created'] + dha_metadata['sha'] = sha_uri(self.kwargs["dha_uri"]) + dha_metadata['comment'] = dha_pod_conf['dha-pod-config-metadata']['comment'] + self.dha_metadata = dha_metadata + dha_pod_conf.pop('dha-pod-config-metadata') + self.dha_pod_conf = dha_pod_conf + + scenario_conf = self.get_scenario_config() + dha_scenario_override_conf = scenario_conf["dha-override-config"] + # Only virtual deploy scenarios can override dha.yaml since there + # is no way to programatically override a physical environment: + # wireing, IPMI set-up, etc. + # For Physical environments, dha.yaml overrides will be silently ignored + if dha_scenario_override_conf and (dha_pod_conf['adapter'] == 'libvirt' + or dha_pod_conf['adapter'] == 'esxi' + or dha_pod_conf['adapter'] == 'vbox'): + print('Merging dha-pod and deployment-scenario override information to final dha.yaml configuration....') + self.dha_pod_conf = dict(merge_dicts(self.dha_pod_conf, dha_scenario_override_conf)) + + def dump_dha_config(self): + # Dump final dha.yaml to argument provided directory + path = self.kwargs["output_path"] + print('Dumping final dha.yaml to ' + path + '/dha.yaml....') + with open(path + '/dha.yaml', "w") as f: + f.write("\n".join([("title: DHA.yaml file automatically generated from " + "the configuration files stated in the " + '"configuration-files" fragment below'), + "version: " + str(calendar.timegm(time.gmtime())), + "created: " + time.strftime("%d/%m/%Y %H:%M:%S"), + "comment: none\n"])) + + f.write("configuration-files:\n") + + f.write("\n".join([" dha-pod-configuration:", + " uri: " + self.kwargs["dha_uri"], + " title: " + self.dha_metadata['title'], + " version: " + self.dha_metadata['version'], + " created: " + self.dha_metadata['created'], + " sha-1: " + self.dha_metadata['sha'], + " comment: " + self.dha_metadata['comment'] + "\n"])) + + f.write("\n".join([" deployment-scenario:", + " uri: " + self.scenario_metadata['uri'], + " title: " + self.scenario_metadata['title'], + " version: " + self.scenario_metadata['version'], + " created: " + self.scenario_metadata['created'], + " sha-1: " + self.scenario_metadata['sha'], + " comment: " + self.scenario_metadata['comment'] + "\n"])) + + yaml.dump(self.dha_pod_conf, f, default_flow_style=False) + + +def main(): + setup_yaml() + + deploy_config = DeployConfig() + deploy_config.process_dea_base() + deploy_config.process_dea_pod_override() + deploy_config.process_scenario_config() + deploy_config.dump_dea_config() + + deploy_config.process_dha_pod_config() + deploy_config.dump_dha_config() + + +if __name__ == '__main__': + main() diff --git a/deploy/deploy.py b/deploy/deploy.py new file mode 100755 index 000000000..f491929e0 --- /dev/null +++ b/deploy/deploy.py @@ -0,0 +1,423 @@ +#!/usr/bin/python +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import os +import io +import re +import sys +import yaml +import errno +import signal +import netaddr + +from dea import DeploymentEnvironmentAdapter +from dha import DeploymentHardwareAdapter +from install_fuel_master import InstallFuelMaster +from deploy_env import CloudDeploy +from execution_environment import ExecutionEnvironment + +from common import ( + log, + exec_cmd, + err, + warn, + check_file_exists, + check_dir_exists, + create_dir_if_not_exists, + delete, + check_if_root, + ArgParser, +) + +FUEL_VM = 'fuel' +PATCH_DIR = 'fuel_patch' +WORK_DIR = '~/deploy' +CWD = os.getcwd() +MOUNT_STATE_VAR = 'AUTODEPLOY_ISO_MOUNTED' + + +class cd: + + def __init__(self, new_path): + self.new_path = os.path.expanduser(new_path) + + def __enter__(self): + self.saved_path = CWD + os.chdir(self.new_path) + + def __exit__(self, etype, value, traceback): + os.chdir(self.saved_path) + + +class AutoDeploy(object): + + def __init__(self, no_fuel, fuel_only, no_health_check, cleanup_only, + cleanup, storage_dir, pxe_bridge, iso_file, dea_file, + dha_file, fuel_plugins_dir, fuel_plugins_conf_dir, + no_plugins, deploy_timeout, no_deploy_environment, deploy_log): + self.no_fuel = no_fuel + self.fuel_only = fuel_only + self.no_health_check = no_health_check + self.cleanup_only = cleanup_only + self.cleanup = cleanup + self.storage_dir = storage_dir + self.pxe_bridge = pxe_bridge + self.iso_file = iso_file + self.dea_file = dea_file + self.dha_file = dha_file + self.fuel_plugins_dir = fuel_plugins_dir + self.fuel_plugins_conf_dir = fuel_plugins_conf_dir + self.no_plugins = no_plugins + self.deploy_timeout = deploy_timeout + self.no_deploy_environment = no_deploy_environment + self.deploy_log = deploy_log + self.dea = (DeploymentEnvironmentAdapter(dea_file) + if not cleanup_only else None) + self.dha = DeploymentHardwareAdapter(dha_file) + self.fuel_conf = {} + self.fuel_node_id = self.dha.get_fuel_node_id() + self.fuel_username, self.fuel_password = self.dha.get_fuel_access() + self.tmp_dir = None + + def modify_ip(self, ip_addr, index, val): + ip_str = str(netaddr.IPAddress(ip_addr)) + decimal_list = map(int, ip_str.split('.')) + decimal_list[index] = val + return '.'.join(map(str, decimal_list)) + + def collect_fuel_info(self): + self.fuel_conf['ip'] = self.dea.get_fuel_ip() + self.fuel_conf['gw'] = self.dea.get_fuel_gateway() + self.fuel_conf['dns1'] = self.dea.get_fuel_dns() + self.fuel_conf['netmask'] = self.dea.get_fuel_netmask() + self.fuel_conf['hostname'] = self.dea.get_fuel_hostname() + self.fuel_conf['showmenu'] = 'yes' + + def install_fuel_master(self): + log('Install Fuel Master') + new_iso = ('%s/deploy-%s' + % (self.tmp_dir, os.path.basename(self.iso_file))) + self.patch_iso(new_iso) + self.iso_file = new_iso + self.install_iso() + + def delete_old_fuel_env(self): + log('Delete old Fuel Master environments if present') + try: + old_dep = CloudDeploy(self.dea, self.dha, self.fuel_conf['ip'], + self.fuel_username, self.fuel_password, + self.dea_file, self.fuel_plugins_conf_dir, + WORK_DIR, self.no_health_check, + self.deploy_timeout, + self.no_deploy_environment, self.deploy_log) + with old_dep.ssh: + old_dep.check_previous_installation() + except Exception as e: + log('Could not delete old env: %s' % str(e)) + + def install_iso(self): + fuel = InstallFuelMaster(self.dea_file, self.dha_file, + self.fuel_conf['ip'], self.fuel_username, + self.fuel_password, self.fuel_node_id, + self.iso_file, WORK_DIR, + self.fuel_plugins_dir, self.no_plugins) + fuel.install() + + def patch_iso(self, new_iso): + tmp_orig_dir = '%s/origiso' % self.tmp_dir + tmp_new_dir = '%s/newiso' % self.tmp_dir + try: + self.copy(tmp_orig_dir, tmp_new_dir) + self.patch(tmp_new_dir, new_iso) + except Exception as e: + exec_cmd('fusermount -u %s' % tmp_orig_dir, False) + os.environ.pop(MOUNT_STATE_VAR, None) + delete(self.tmp_dir) + err(e) + + def copy(self, tmp_orig_dir, tmp_new_dir): + log('Copying...') + os.makedirs(tmp_orig_dir) + os.makedirs(tmp_new_dir) + exec_cmd('fuseiso %s %s' % (self.iso_file, tmp_orig_dir)) + os.environ[MOUNT_STATE_VAR] = tmp_orig_dir + with cd(tmp_orig_dir): + exec_cmd('find . | cpio -pd %s' % tmp_new_dir) + exec_cmd('fusermount -u %s' % tmp_orig_dir) + os.environ.pop(MOUNT_STATE_VAR, None) + delete(tmp_orig_dir) + exec_cmd('chmod -R 755 %s' % tmp_new_dir) + + def patch(self, tmp_new_dir, new_iso): + log('Patching...') + patch_dir = '%s/%s' % (CWD, PATCH_DIR) + ks_path = '%s/ks.cfg.patch' % patch_dir + + with cd(tmp_new_dir): + exec_cmd('cat %s | patch -p0' % ks_path) + delete('.rr_moved') + isolinux = 'isolinux/isolinux.cfg' + log('isolinux.cfg before: %s' + % exec_cmd('grep ip= %s' % isolinux)) + self.update_fuel_isolinux(isolinux) + log('isolinux.cfg after: %s' + % exec_cmd('grep ip= %s' % isolinux)) + + iso_label = self.parse_iso_volume_label(self.iso_file) + log('Volume label: %s' % iso_label) + + iso_linux_bin = 'isolinux/isolinux.bin' + exec_cmd('mkisofs -quiet -r -J -R -b %s ' + '-no-emul-boot -boot-load-size 4 ' + '-boot-info-table -hide-rr-moved ' + '-joliet-long ' + '-x "lost+found:" -V %s -o %s .' + % (iso_linux_bin, iso_label, new_iso)) + + delete(tmp_new_dir) + + def update_fuel_isolinux(self, file): + with io.open(file) as f: + data = f.read() + for key, val in self.fuel_conf.iteritems(): + # skip replacing these keys, as the format is different + if key in ['ip', 'gw', 'netmask', 'hostname']: + continue + + pattern = r'%s=[^ ]\S+' % key + replace = '%s=%s' % (key, val) + data = re.sub(pattern, replace, data) + + # process networking parameters + ip = ':'.join([self.fuel_conf['ip'], + '', + self.fuel_conf['gw'], + self.fuel_conf['netmask'], + self.fuel_conf['hostname'], + 'eth0:off:::']) + + data = re.sub(r'ip=[^ ]\S+', 'ip=%s' % ip, data) + + with io.open(file, 'w') as f: + f.write(data) + + def parse_iso_volume_label(self, iso_filename): + label_line = exec_cmd('isoinfo -d -i %s | grep -i "Volume id: "' % iso_filename) + # cut leading text: 'Volume id: ' + return label_line[11:] + + def deploy_env(self): + dep = CloudDeploy(self.dea, self.dha, self.fuel_conf['ip'], + self.fuel_username, self.fuel_password, + self.dea_file, self.fuel_plugins_conf_dir, + WORK_DIR, self.no_health_check, self.deploy_timeout, + self.no_deploy_environment, self.deploy_log) + return dep.deploy() + + def setup_execution_environment(self): + exec_env = ExecutionEnvironment(self.storage_dir, self.pxe_bridge, + self.dha_file, self.dea) + exec_env.setup_environment() + + def cleanup_execution_environment(self): + exec_env = ExecutionEnvironment(self.storage_dir, self.pxe_bridge, + self.dha_file, self.dea) + exec_env.cleanup_environment() + + def create_tmp_dir(self): + self.tmp_dir = '%s/fueltmp' % CWD + delete(self.tmp_dir) + create_dir_if_not_exists(self.tmp_dir) + + def deploy(self): + self.collect_fuel_info() + if not self.no_fuel: + self.delete_old_fuel_env() + self.setup_execution_environment() + self.create_tmp_dir() + self.install_fuel_master() + if not self.fuel_only: + return self.deploy_env() + # Exit status + return 0 + + def run(self): + check_if_root() + if self.cleanup_only: + self.cleanup_execution_environment() + else: + deploy_success = self.deploy() + if self.cleanup: + self.cleanup_execution_environment() + return deploy_success + # Exit status + return 0 + + +def check_bridge(pxe_bridge, dha_path): + # Assume that bridges on remote nodes exists, we could ssh but + # the remote user might not have a login shell. + if os.environ.get('LIBVIRT_DEFAULT_URI'): + return + + with io.open(dha_path) as yaml_file: + dha_struct = yaml.load(yaml_file) + if dha_struct['adapter'] != 'libvirt': + log('Using Linux Bridge %s for booting up the Fuel Master VM' + % pxe_bridge) + r = exec_cmd('ip link show %s' % pxe_bridge) + if pxe_bridge in r and 'state DOWN' in r: + err('Linux Bridge {0} is not Active, bring' + ' it UP first: [ip link set dev {0} up]'.format(pxe_bridge)) + + +def check_fuel_plugins_dir(dir): + msg = None + if not dir: + msg = 'Fuel Plugins Directory not specified!' + elif not os.path.isdir(dir): + msg = 'Fuel Plugins Directory does not exist!' + elif not os.listdir(dir): + msg = 'Fuel Plugins Directory is empty!' + if msg: + warn('%s No external plugins will be installed!' % msg) + + +def parse_arguments(): + parser = ArgParser(prog='python %s' % __file__) + parser.add_argument('-nf', dest='no_fuel', action='store_true', + default=False, + help='Do not install Fuel Master (and Node VMs when ' + 'using libvirt)') + parser.add_argument('-nh', dest='no_health_check', action='store_true', + default=False, + help='Don\'t run health check after deployment') + parser.add_argument('-fo', dest='fuel_only', action='store_true', + default=False, + help='Install Fuel Master only (and Node VMs when ' + 'using libvirt)') + parser.add_argument('-co', dest='cleanup_only', action='store_true', + default=False, + help='Cleanup VMs and Virtual Networks according to ' + 'what is defined in DHA') + parser.add_argument('-c', dest='cleanup', action='store_true', + default=False, + help='Cleanup after deploy') + if {'-iso', '-dea', '-dha', '-h'}.intersection(sys.argv): + parser.add_argument('-iso', dest='iso_file', action='store', nargs='?', + default='%s/OPNFV.iso' % CWD, + help='ISO File [default: OPNFV.iso]') + parser.add_argument('-dea', dest='dea_file', action='store', nargs='?', + default='%s/dea.yaml' % CWD, + help='Deployment Environment Adapter: dea.yaml') + parser.add_argument('-dha', dest='dha_file', action='store', nargs='?', + default='%s/dha.yaml' % CWD, + help='Deployment Hardware Adapter: dha.yaml') + else: + parser.add_argument('iso_file', action='store', nargs='?', + default='%s/OPNFV.iso' % CWD, + help='ISO File [default: OPNFV.iso]') + parser.add_argument('dea_file', action='store', nargs='?', + default='%s/dea.yaml' % CWD, + help='Deployment Environment Adapter: dea.yaml') + parser.add_argument('dha_file', action='store', nargs='?', + default='%s/dha.yaml' % CWD, + help='Deployment Hardware Adapter: dha.yaml') + parser.add_argument('-s', dest='storage_dir', action='store', + default='%s/images' % CWD, + help='Storage Directory [default: images]') + parser.add_argument('-b', dest='pxe_bridge', action='append', + default=[], + help='Linux Bridge for booting up the Fuel Master VM ' + '[default: pxebr]') + parser.add_argument('-p', dest='fuel_plugins_dir', action='store', + help='Fuel Plugins directory') + parser.add_argument('-pc', dest='fuel_plugins_conf_dir', action='store', + help='Fuel Plugins Configuration directory') + parser.add_argument('-np', dest='no_plugins', action='store_true', + default=False, help='Do not install Fuel Plugins') + parser.add_argument('-dt', dest='deploy_timeout', action='store', + default=240, help='Deployment timeout (in minutes) ' + '[default: 240]') + parser.add_argument('-nde', dest='no_deploy_environment', + action='store_true', default=False, + help=('Do not launch environment deployment')) + parser.add_argument('-log', dest='deploy_log', + action='store', default='../ci/.', + help=('Path and name of the deployment log archive')) + + args = parser.parse_args() + log(args) + + if not args.pxe_bridge: + args.pxe_bridge = ['pxebr'] + + check_file_exists(args.dha_file) + + check_dir_exists(os.path.dirname(args.deploy_log)) + + if not args.cleanup_only: + check_file_exists(args.dea_file) + check_fuel_plugins_dir(args.fuel_plugins_dir) + + iso_abs_path = os.path.abspath(args.iso_file) + if not args.no_fuel and not args.cleanup_only: + log('Using OPNFV ISO file: %s' % iso_abs_path) + check_file_exists(iso_abs_path) + log('Using image directory: %s' % args.storage_dir) + create_dir_if_not_exists(args.storage_dir) + for bridge in args.pxe_bridge: + check_bridge(bridge, args.dha_file) + + + kwargs = {'no_fuel': args.no_fuel, 'fuel_only': args.fuel_only, + 'no_health_check': args.no_health_check, + 'cleanup_only': args.cleanup_only, 'cleanup': args.cleanup, + 'storage_dir': args.storage_dir, 'pxe_bridge': args.pxe_bridge, + 'iso_file': iso_abs_path, 'dea_file': args.dea_file, + 'dha_file': args.dha_file, + 'fuel_plugins_dir': args.fuel_plugins_dir, + 'fuel_plugins_conf_dir': args.fuel_plugins_conf_dir, + 'no_plugins': args.no_plugins, + 'deploy_timeout': args.deploy_timeout, + 'no_deploy_environment': args.no_deploy_environment, + 'deploy_log': args.deploy_log} + return kwargs + + +def handle_signals(signal_num, frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGTERM, signal.SIG_IGN) + + log('Caught signal %s, cleaning up and exiting.' % signal_num) + + mount_point = os.environ.get(MOUNT_STATE_VAR) + if mount_point: + log('Unmounting ISO from "%s"' % mount_point) + # Prevent 'Device or resource busy' errors when unmounting + os.chdir('/') + exec_cmd('fusermount -u %s' % mount_point, True) + # Be nice and remove our environment variable, even though the OS would + # would clean it up anyway + os.environ.pop(MOUNT_STATE_VAR) + + sys.exit(1) + + +def main(): + signal.signal(signal.SIGINT, handle_signals) + signal.signal(signal.SIGTERM, handle_signals) + kwargs = parse_arguments() + d = AutoDeploy(**kwargs) + sys.exit(d.run()) + +if __name__ == '__main__': + main() diff --git a/deploy/deploy_env.py b/deploy/deploy_env.py new file mode 100644 index 000000000..93dc3959b --- /dev/null +++ b/deploy/deploy_env.py @@ -0,0 +1,285 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import os +import io +import yaml +import glob +import time +import shutil + +from ssh_client import SSHClient + +from common import ( + err, + log, + exec_cmd, + parse, + N, + E, + R, + delete, +) + +CLOUD_DEPLOY_FILE = 'deploy.py' +BLADE_RESTART_TIMES = 3 + + +class CloudDeploy(object): + + def __init__(self, dea, dha, fuel_ip, fuel_username, fuel_password, + dea_file, fuel_plugins_conf_dir, work_dir, no_health_check, + deploy_timeout, no_deploy_environment, deploy_log): + self.dea = dea + self.dha = dha + self.fuel_ip = fuel_ip + self.fuel_username = fuel_username + self.fuel_password = fuel_password + self.dea_file = dea_file + self.updated_dea_file = ( + '%s/.%s' % (os.path.dirname(self.dea_file), + os.path.basename(self.dea_file))) + shutil.copy2(self.dea_file, self.updated_dea_file) + self.fuel_plugins_conf_dir = fuel_plugins_conf_dir + self.work_dir = work_dir + self.no_health_check = no_health_check + self.deploy_timeout = deploy_timeout + self.no_deploy_environment = no_deploy_environment + self.deploy_log = deploy_log + self.file_dir = os.path.dirname(os.path.realpath(__file__)) + self.ssh = SSHClient(self.fuel_ip, self.fuel_username, + self.fuel_password) + self.node_ids = self.dha.get_node_ids() + self.wanted_release = self.dea.get_property('wanted_release') + self.blade_node_dict = {} + self.macs_per_blade = {} + + def merge_plugin_config_files_to_dea_file(self): + plugins_conf_dir = ( + self.fuel_plugins_conf_dir if self.fuel_plugins_conf_dir + else '%s/plugins_conf' % os.path.dirname(self.dea_file)) + if os.path.isdir(plugins_conf_dir): + with io.open(self.updated_dea_file) as stream: + updated_dea = yaml.load(stream) + for plugin_file in glob.glob('%s/*.yaml' % plugins_conf_dir): + with io.open(plugin_file) as stream: + plugin_conf = yaml.load(stream) + updated_dea['settings']['editable'].update(plugin_conf) + with io.open(self.updated_dea_file, 'w') as stream: + yaml.dump(updated_dea, stream, default_flow_style=False) + + def upload_cloud_deployment_files(self): + with self.ssh as s: + s.exec_cmd('rm -rf %s' % self.work_dir, False) + s.exec_cmd('mkdir %s' % self.work_dir) + s.scp_put(self.updated_dea_file, '%s/%s' % ( + self.work_dir, os.path.basename(self.dea_file))) + s.scp_put('%s/common.py' % self.file_dir, self.work_dir) + s.scp_put('%s/dea.py' % self.file_dir, self.work_dir) + for f in glob.glob('%s/cloud/*' % self.file_dir): + s.scp_put(f, self.work_dir) + + def power_off_nodes(self): + for node_id in self.node_ids: + self.dha.node_power_off(node_id) + + def power_on_nodes(self): + for node_id in self.node_ids: + self.dha.node_power_on(node_id) + + def set_boot_order(self, boot_order_list): + for node_id in self.node_ids: + self.dha.node_set_boot_order(node_id, boot_order_list[:]) + + def get_mac_addresses(self): + self.macs_per_blade = {} + for node_id in self.node_ids: + self.macs_per_blade[node_id] = self.dha.get_node_pxe_mac(node_id) + + def run_cloud_deploy(self, deploy_app): + log('START CLOUD DEPLOYMENT') + deploy_app = '%s/%s' % (self.work_dir, deploy_app) + dea_file = '%s/%s' % (self.work_dir, os.path.basename(self.dea_file)) + with self.ssh as s: + status = s.run('python %s %s %s %s %s' % ( + deploy_app, + ('-nh' if self.no_health_check else ''), + ('-dt %s' % + self.deploy_timeout if self.deploy_timeout else ''), + ('-nde' if self.no_deploy_environment else ''), + dea_file)) + return status + + def check_supported_release(self): + log('Check supported release: %s' % self.wanted_release) + found = False + release_list = parse(self.ssh.exec_cmd('fuel release -l')) + for release in release_list: + if release[R['name']] == self.wanted_release: + found = True + break + if not found: + err('This Fuel does not contain the following release: %s' + % self.wanted_release) + + def check_previous_installation(self): + log('Check previous installation') + env_list = parse(self.ssh.exec_cmd('fuel env list')) + if env_list: + self.cleanup_fuel_environments(env_list) + node_list = parse(self.ssh.exec_cmd('fuel node list')) + if node_list: + self.cleanup_fuel_nodes(node_list) + + def cleanup_fuel_environments(self, env_list): + WAIT_LOOP = 60 + SLEEP_TIME = 10 + for env in env_list: + log('Deleting environment %s' % env[E['id']]) + self.ssh.exec_cmd('fuel env --env %s --delete --force' + % env[E['id']]) + all_env_erased = False + for i in range(WAIT_LOOP): + env_list = parse(self.ssh.exec_cmd('fuel env list')) + if env_list: + time.sleep(SLEEP_TIME) + else: + all_env_erased = True + break + if not all_env_erased: + err('Could not erase these environments %s' + % [(env[E['id']], env[E['status']]) for env in env_list]) + + def cleanup_fuel_nodes(self, node_list): + for node in node_list: + if node[N['status']] == 'discover': + log('Deleting node %s' % node[N['id']]) + self.ssh.exec_cmd('fuel node --node-id %s --delete-from-db ' + '--force' % node[N['id']]) + self.ssh.exec_cmd('cobbler system remove --name node-%s' + % node[N['id']], False) + + def check_prerequisites(self): + log('Check prerequisites') + with self.ssh: + self.check_supported_release() + self.check_previous_installation() + + def wait_for_discovered_blades(self): + log('Wait for discovered blades') + discovered_macs = [] + restart_times = BLADE_RESTART_TIMES + + for blade in self.node_ids: + self.blade_node_dict[blade] = None + + with self.ssh: + all_discovered = self.discovery_waiting_loop(discovered_macs) + + while not all_discovered and restart_times != 0: + restart_times -= 1 + for blade in self.get_not_discovered_blades(): + self.dha.node_reset(blade) + with self.ssh: + all_discovered = self.discovery_waiting_loop(discovered_macs) + + if not all_discovered: + err('Not all blades have been discovered: %s' + % self.not_discovered_blades_summary()) + + with io.open(self.updated_dea_file) as stream: + updated_dea = yaml.load(stream) + updated_dea.update({'blade_node_map': self.blade_node_dict}) + with io.open(self.updated_dea_file, 'w') as stream: + yaml.dump(updated_dea, stream, default_flow_style=False) + + def discovery_waiting_loop(self, discovered_macs): + WAIT_LOOP = 360 + SLEEP_TIME = 10 + all_discovered = False + for i in range(WAIT_LOOP): + node_list = parse(self.ssh.exec_cmd('fuel node list')) + if node_list: + self.node_discovery(node_list, discovered_macs) + if self.all_blades_discovered(): + all_discovered = True + break + else: + time.sleep(SLEEP_TIME) + return all_discovered + + def node_discovery(self, node_list, discovered_macs): + for node in node_list: + if (node[N['status']] == 'discover' and + (node[N['online']] == 'True' or + node[N['online']] == '1') and + node[N['mac']] not in discovered_macs): + discovered_macs.append(node[N['mac']]) + blade = self.find_mac_in_dict(node[N['mac']]) + if blade: + log('Blade %s discovered as Node %s with MAC %s' + % (blade, node[N['id']], node[N['mac']])) + self.blade_node_dict[blade] = int(node[N['id']]) + + def find_mac_in_dict(self, mac): + for blade, mac_list in self.macs_per_blade.iteritems(): + if mac in mac_list: + return blade + + def all_blades_discovered(self): + for blade, node_id in self.blade_node_dict.iteritems(): + if not node_id: + return False + return True + + def not_discovered_blades_summary(self): + summary = '' + for blade, node_id in self.blade_node_dict.iteritems(): + if not node_id: + summary += '\n[blade %s]' % blade + return summary + + def get_not_discovered_blades(self): + not_discovered_blades = [] + for blade, node_id in self.blade_node_dict.iteritems(): + if not node_id: + not_discovered_blades.append(blade) + return not_discovered_blades + + def set_boot_order_nodes(self): + self.power_off_nodes() + self.set_boot_order(['pxe', 'disk']) + self.power_on_nodes() + + def get_put_deploy_log(self): + with self.ssh as s: + s.scp_get("deploy-*", local=self.deploy_log) + + def deploy(self): + + self.set_boot_order_nodes() + + self.check_prerequisites() + + self.get_mac_addresses() + + self.wait_for_discovered_blades() + + self.merge_plugin_config_files_to_dea_file() + + self.upload_cloud_deployment_files() + + delete(self.updated_dea_file) + + rc = self.run_cloud_deploy(CLOUD_DEPLOY_FILE) + + self.get_put_deploy_log() + + return rc diff --git a/deploy/dha.py b/deploy/dha.py new file mode 100644 index 000000000..3f09da40a --- /dev/null +++ b/deploy/dha.py @@ -0,0 +1,38 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import yaml +import io + +from dha_adapters.libvirt_adapter import LibvirtAdapter +from dha_adapters.ipmi_adapter import IpmiAdapter +from dha_adapters.hp_adapter import HpAdapter +from dha_adapters.amt_adapter import AmtAdapter +from dha_adapters.zte_adapter import ZteAdapter + +class DeploymentHardwareAdapter(object): + + def __new__(cls, yaml_path): + with io.open(yaml_path) as yaml_file: + dha_struct = yaml.load(yaml_file) + type = dha_struct['adapter'] + + if cls is DeploymentHardwareAdapter: + if type == 'libvirt': + return LibvirtAdapter(yaml_path) + if type == 'ipmi': + return IpmiAdapter(yaml_path) + if type == 'hp': + return HpAdapter(yaml_path) + if type == 'amt': + return AmtAdapter(yaml_path) + if type == 'zte': + return ZteAdapter(yaml_path) + return super(DeploymentHardwareAdapter, cls).__new__(cls) diff --git a/deploy/dha_adapters/__init__.py b/deploy/dha_adapters/__init__.py new file mode 100644 index 000000000..fb73157f9 --- /dev/null +++ b/deploy/dha_adapters/__init__.py @@ -0,0 +1,8 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### diff --git a/deploy/dha_adapters/amt_adapter.py b/deploy/dha_adapters/amt_adapter.py new file mode 100644 index 000000000..02025b9dd --- /dev/null +++ b/deploy/dha_adapters/amt_adapter.py @@ -0,0 +1,100 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# liyi.meng@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +from hardware_adapter import HardwareAdapter + +from common import ( + log, + exec_cmd, + err, +) + + +''' +This is hardware adapter for Intel AMT based system. It use amttool to interact + with the targeting node. It dose not support vPro v9. if the targeting system + is v9 or later, we need to consider a new adpater with using lib + like https://github.com/sdague/amt +''' +class AmtAdapter(HardwareAdapter): + + def __init__(self, yaml_path): + super(AmtAdapter, self).__init__(yaml_path) + #amttool dose not allow you change bios setting permanently. + # so we have to make a workaround to make it IPMI like. + self.boot_order = {} + + def node_get_boot_dev(self, node_id): + if node_id in self.boot_order: + dev = self.boot_order[node_id][0] + if dev == 'pxe': + return 'PXE-boot' + elif dev == 'iso': + return 'cd-boot' + elif dev == 'disk': + return 'HD-boot' + else: + return 'HD-boot' + + def get_access_info(self, node_id): + ip = self.get_node_property(node_id, 'amtIp') + username = self.get_node_property(node_id, 'amtUser') + password = self.get_node_property(node_id, 'amtPass') + return ip, username, password + + def amt_cmd(self, node_id): + ip, username, password = self.get_access_info(node_id) + # We first Setup password for amttool, then use ping to wake up the node over LAN + cmd = 'export AMT_PASSWORD={0};' \ + 'ping {1} -W 5 -c 1 -q;' \ + 'yes | amttool {1}'.format(password, ip) + return cmd + + def get_node_pxe_mac(self, node_id): + mac_list = [] + mac_list.append(self.get_node_property(node_id, 'pxeMac').lower()) + return mac_list + + def node_power_on(self, node_id): + log('Power ON Node %s' % node_id) + cmd_prefix = self.amt_cmd(node_id) + resp, ret = exec_cmd('{0} info'.format(cmd_prefix), check=False) + if 'Powerstate: S0' not in resp: + dev = self.node_get_boot_dev(node_id) + resp, ret = exec_cmd('{0} powerup {1}'.format(cmd_prefix, dev), check=False) + if 'pt_status: success' not in resp: + err('Could Not Power ON Node %s' % node_id) + + def node_power_off(self, node_id): + log('Power OFF Node %s' % node_id) + cmd_prefix = self.amt_cmd(node_id) + resp, ret = exec_cmd('{0} info'.format(cmd_prefix), check=False) + if "Powerstate: S0" in resp: + resp, ret = exec_cmd('{0} powerdown'.format(cmd_prefix), check=False) + if 'pt_status: success' not in resp: + err('Could Not Power OFF Node %s' % node_id) + + def node_reset(self, node_id): + log('RESET Node %s' % node_id) + cmd_prefix = self.amt_cmd(node_id) + dev = self.node_get_boot_dev(node_id) + resp, ret = exec_cmd('{0} info'.format(cmd_prefix), check=False) + if 'Powerstate: S0' in resp: + resp, ret = exec_cmd('{0} reset {1}'.format(cmd_prefix, dev), check=False) + if 'pt_status: success' not in resp: + err('Could Not RESET Node %s' % node_id) + else: + err('Cannot RESET Node %s because it\'s not Active, state: %s' + % (node_id, resp)) + + def node_set_boot_order(self, node_id, boot_order_list): + log('Set boot order %s on Node %s' % (boot_order_list, node_id)) + self.boot_order[node_id] = boot_order_list + diff --git a/deploy/dha_adapters/hardware_adapter.py b/deploy/dha_adapters/hardware_adapter.py new file mode 100644 index 000000000..aa59581ee --- /dev/null +++ b/deploy/dha_adapters/hardware_adapter.py @@ -0,0 +1,65 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import yaml +import io + + +class HardwareAdapter(object): + + def __init__(self, yaml_path): + self.dha_struct = None + self.parse_yaml(yaml_path) + + def parse_yaml(self, yaml_path): + with io.open(yaml_path) as yaml_file: + self.dha_struct = yaml.load(yaml_file) + + def get_adapter_type(self): + return self.dha_struct['adapter'] + + def get_all_node_ids(self): + node_ids = [] + for node in self.dha_struct['nodes']: + node_ids.append(node['id']) + node_ids.sort() + return node_ids + + def get_fuel_node_id(self): + for node in self.dha_struct['nodes']: + if 'isFuel' in node and node['isFuel']: + return node['id'] + + def get_node_ids(self): + node_ids = [] + fuel_node_id = self.get_fuel_node_id() + for node in self.dha_struct['nodes']: + if node['id'] != fuel_node_id: + node_ids.append(node['id']) + node_ids.sort() + return node_ids + + def get_node_property(self, node_id, property_name): + for node in self.dha_struct['nodes']: + if node['id'] == node_id and property_name in node: + return node[property_name] + + def get_fuel_access(self): + for node in self.dha_struct['nodes']: + if 'isFuel' in node and node['isFuel']: + return node['username'], node['password'] + + def get_disks(self): + return self.dha_struct['disks'] + + def get_vm_definition(self, role): + vm_definition = self.dha_struct.get('define_vms') + if vm_definition: + return vm_definition.get(role) diff --git a/deploy/dha_adapters/hp_adapter.py b/deploy/dha_adapters/hp_adapter.py new file mode 100644 index 000000000..6434da868 --- /dev/null +++ b/deploy/dha_adapters/hp_adapter.py @@ -0,0 +1,37 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +from ipmi_adapter import IpmiAdapter +from ssh_client import SSHClient + +from common import ( + log, +) + +DEV = {'pxe': 'bootsource5', + 'disk': 'bootsource3', + 'iso': 'bootsource1'} + +ROOT = '/system1/bootconfig1' + + +class HpAdapter(IpmiAdapter): + + def __init__(self, yaml_path): + super(HpAdapter, self).__init__(yaml_path) + + def node_set_boot_order(self, node_id, boot_order_list): + log('Set boot order %s on Node %s' % (boot_order_list, node_id)) + ip, username, password, ipmiport = self.get_access_info(node_id) + ssh = SSHClient(ip, username, password) + with ssh as s: + for order, dev in enumerate(boot_order_list): + s.exec_cmd('set %s/%s bootorder=%s' + % (ROOT, DEV[dev], order + 1)) diff --git a/deploy/dha_adapters/ipmi_adapter.py b/deploy/dha_adapters/ipmi_adapter.py new file mode 100644 index 000000000..7cc930554 --- /dev/null +++ b/deploy/dha_adapters/ipmi_adapter.py @@ -0,0 +1,114 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# (c) 2016 Enea Software AB +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import time +from hardware_adapter import HardwareAdapter + +from common import ( + log, + exec_cmd, + err, +) + + +class IpmiAdapter(HardwareAdapter): + + def __init__(self, yaml_path, attempts=20, delay=3): + super(IpmiAdapter, self).__init__(yaml_path) + self.attempts = attempts + self.delay = delay + + def get_access_info(self, node_id): + ip = self.get_node_property(node_id, 'ipmiIp') + username = self.get_node_property(node_id, 'ipmiUser') + password = self.get_node_property(node_id, 'ipmiPass') + ipmiport = self.get_node_property(node_id, 'ipmiPort') + return ip, username, password, ipmiport + + def ipmi_cmd(self, node_id): + ip, username, password, ipmiport = self.get_access_info(node_id) + cmd = 'ipmitool -I lanplus -A password' + cmd += ' -H %s -U %s -P %s' % (ip, username, password) + if ipmiport: + cmd += ' -p %d' % int(ipmiport) + return cmd + + def get_node_pxe_mac(self, node_id): + mac_list = [] + mac_list.append(self.get_node_property(node_id, 'pxeMac').lower()) + return mac_list + + def node_get_state(self, node_id): + state = exec_cmd('%s chassis power status' % self.ipmi_cmd(node_id), + attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) + return state + + def _node_power_cmd(self, node_id, cmd): + expected = 'Chassis Power is %s' % cmd + if self.node_get_state(node_id) == expected: + return + + pow_cmd = '%s chassis power %s' % (self.ipmi_cmd(node_id), cmd) + exec_cmd(pow_cmd, attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) + + attempts = self.attempts + while attempts: + time.sleep(self.delay) + state = self.node_get_state(node_id) + attempts -= 1 + if state == expected: + return + elif attempts != 0: + # reinforce our will, but allow the command to fail, + # we know our message got across once already... + exec_cmd(pow_cmd, check=False, mask_args=[8,10]) + + err('Could not set chassis %s for node %s' % (cmd, node_id)) + + def node_power_on(self, node_id): + log('Power ON Node %s' % node_id) + self._node_power_cmd(node_id, 'on') + + def node_power_off(self, node_id): + log('Power OFF Node %s' % node_id) + self._node_power_cmd(node_id, 'off') + + def node_reset(self, node_id): + log('RESET Node %s' % node_id) + cmd = '%s chassis power reset' % self.ipmi_cmd(node_id) + exec_cmd(cmd, attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) + + def node_set_boot_order(self, node_id, boot_order_list): + log('Set boot order %s on Node %s' % (boot_order_list, node_id)) + boot_order_list.reverse() + cmd_prefix = self.ipmi_cmd(node_id) + for dev in boot_order_list: + if dev == 'pxe': + exec_cmd('%s chassis bootdev pxe options=persistent' + % cmd_prefix, attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) + elif dev == 'iso': + exec_cmd('%s chassis bootdev cdrom' % cmd_prefix, + attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) + elif dev == 'disk': + exec_cmd('%s chassis bootdev disk options=persistent' + % cmd_prefix, attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) diff --git a/deploy/dha_adapters/libvirt_adapter.py b/deploy/dha_adapters/libvirt_adapter.py new file mode 100644 index 000000000..466f134ae --- /dev/null +++ b/deploy/dha_adapters/libvirt_adapter.py @@ -0,0 +1,173 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +from lxml import etree +from hardware_adapter import HardwareAdapter +import tempfile +import os + +from common import ( + log, + exec_cmd, + err, + delete, +) + +DEV = {'pxe': 'network', + 'disk': 'hd', + 'iso': 'cdrom'} + +VOL_XML_TEMPLATE = ''' + {name} + {size!s} + + + +''' + +DEFAULT_POOL = 'jenkins' + +class LibvirtAdapter(HardwareAdapter): + + def __init__(self, yaml_path): + super(LibvirtAdapter, self).__init__(yaml_path) + self.parser = etree.XMLParser(remove_blank_text=True) + + def node_power_off(self, node_id): + vm_name = self.get_node_property(node_id, 'libvirtName') + log('Power OFF Node %s' % vm_name) + state = exec_cmd('virsh domstate %s' % vm_name) + if state == 'running': + exec_cmd('virsh destroy %s' % vm_name, False) + + def node_power_on(self, node_id): + vm_name = self.get_node_property(node_id, 'libvirtName') + log('Power ON Node %s' % vm_name) + state = exec_cmd('virsh domstate %s' % vm_name) + if state == 'shut off': + exec_cmd('virsh start %s' % vm_name) + + def node_reset(self, node_id): + vm_name = self.get_node_property(node_id, 'libvirtName') + log('Reset Node %s' % vm_name) + exec_cmd('virsh reset %s' % vm_name) + + def translate(self, boot_order_list): + translated = [] + for boot_dev in boot_order_list: + if boot_dev in DEV: + translated.append(DEV[boot_dev]) + else: + err('Boot device %s not recognized' % boot_dev) + return translated + + def node_set_boot_order(self, node_id, boot_order_list): + boot_order_list = self.translate(boot_order_list) + vm_name = self.get_node_property(node_id, 'libvirtName') + temp_dir = tempfile.mkdtemp() + log('Set boot order %s on Node %s' % (boot_order_list, vm_name)) + resp = exec_cmd('virsh dumpxml %s' % vm_name) + xml_dump = etree.fromstring(resp, self.parser) + os = xml_dump.xpath('/domain/os') + for o in os: + for bootelem in ['boot', 'bootmenu']: + boot = o.xpath(bootelem) + for b in boot: + o.remove(b) + for dev in boot_order_list: + b = etree.Element('boot') + b.set('dev', dev) + o.append(b) + bmenu = etree.Element('bootmenu') + bmenu.set('enable', 'no') + o.append(bmenu) + tree = etree.ElementTree(xml_dump) + xml_file = temp_dir + '/%s.xml' % vm_name + with open(xml_file, 'w') as f: + tree.write(f, pretty_print=True, xml_declaration=True) + exec_cmd('virsh define %s' % xml_file) + delete(temp_dir) + + def node_zero_mbr(self, node_id): + vm_name = self.get_node_property(node_id, 'libvirtName') + resp = exec_cmd('virsh dumpxml %s' % vm_name) + xml_dump = etree.fromstring(resp) + disks = xml_dump.xpath('/domain/devices/disk') + for disk in disks: + if disk.get('device') == 'disk': + sources = disk.xpath('source') + for source in sources: + disk_file = source.get('file') + disk_size = exec_cmd('qemu-img info ' + '%s |grep \"virtual size:\"' + % disk_file).split()[2] + delete(disk_file) + exec_cmd('qemu-img create -f qcow2 %s %s' % (disk_file, + disk_size)) + + def node_eject_iso(self, node_id): + vm_name = self.get_node_property(node_id, 'libvirtName') + device = self.get_name_of_device(vm_name, 'cdrom') + exec_cmd('virsh change-media %s --eject %s --config --live' + % (vm_name, device), False) + + def node_insert_iso(self, node_id, iso_file): + vm_name = self.get_node_property(node_id, 'libvirtName') + device = self.get_name_of_device(vm_name, 'cdrom') + exec_cmd('virsh change-media %s --insert %s %s' + % (vm_name, device, iso_file)) + + def get_node_pxe_mac(self, node_id): + mac_list = [] + vm_name = self.get_node_property(node_id, 'libvirtName') + resp = exec_cmd('virsh dumpxml %s' % vm_name) + xml_dump = etree.fromstring(resp) + interfaces = xml_dump.xpath('/domain/devices/interface') + for interface in interfaces: + macs = interface.xpath('mac') + for mac in macs: + mac_list.append(mac.get('address').lower()) + return mac_list + + def get_name_of_device(self, vm_name, device_type): + resp = exec_cmd('virsh dumpxml %s' % vm_name) + xml_dump = etree.fromstring(resp) + disks = xml_dump.xpath('/domain/devices/disk') + for disk in disks: + if disk.get('device') == device_type: + targets = disk.xpath('target') + for target in targets: + device = target.get('dev') + if device: + return device + + def get_virt_net_conf_dir(self): + return self.dha_struct['virtNetConfDir'] + + def upload_iso(self, iso_file): + size = os.path.getsize(iso_file) + vol_name = os.path.basename(iso_file) + vol_xml = VOL_XML_TEMPLATE.format(name=vol_name, unit='bytes', + size=size, format_type='raw') + fd, fname = tempfile.mkstemp(text=True, suffix='deploy') + os.write(fd, vol_xml) + os.close(fd) + + log(vol_xml) + pool = DEFAULT_POOL # FIXME + exec_cmd('virsh vol-create --pool %s %s' % (pool, fname)) + vol_path = exec_cmd('virsh vol-path --pool %s %s' % (pool, vol_name)) + + exec_cmd('virsh vol-upload %s %s' % (vol_path, iso_file), + attempts=5, delay=10, verbose=True) + + delete(fname) + + return vol_path diff --git a/deploy/dha_adapters/zte_adapter.py b/deploy/dha_adapters/zte_adapter.py new file mode 100644 index 000000000..da651ca15 --- /dev/null +++ b/deploy/dha_adapters/zte_adapter.py @@ -0,0 +1,32 @@ +############################################################################### +# Copyright (c) 2016 Ericsson AB, ZTE and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import time +from ipmi_adapter import IpmiAdapter + +from common import ( + log, + exec_cmd, + err, +) + + +class ZteAdapter(IpmiAdapter): + + def __init__(self, yaml_path, attempts=100): + super(ZteAdapter, self).__init__(yaml_path, attempts) + + def node_reset(self, node_id): + log('RESET Node %s' % node_id) + cmd = '%s chassis power cycle' % self.ipmi_cmd(node_id) + exec_cmd(cmd, attempts=self.attempts, delay=self.delay, + verbose=True, + mask_args=[8,10]) + diff --git a/deploy/environments/__init__.py b/deploy/environments/__init__.py new file mode 100644 index 000000000..fb73157f9 --- /dev/null +++ b/deploy/environments/__init__.py @@ -0,0 +1,8 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### diff --git a/deploy/environments/execution_environment.py b/deploy/environments/execution_environment.py new file mode 100644 index 000000000..3812902aa --- /dev/null +++ b/deploy/environments/execution_environment.py @@ -0,0 +1,100 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +from lxml import etree +from dha_adapters.libvirt_adapter import LibvirtAdapter + +from common import ( + exec_cmd, + log, + delete, +) + + +class ExecutionEnvironment(object): + + def __init__(self, storage_dir, dha_file, root_dir): + self.storage_dir = storage_dir + self.dha = LibvirtAdapter(dha_file) + self.root_dir = root_dir + self.parser = etree.XMLParser(remove_blank_text=True) + self.fuel_node_id = self.dha.get_fuel_node_id() + + def delete_vm(self, node_id): + vm_name = self.dha.get_node_property(node_id, 'libvirtName') + r, c = exec_cmd('virsh dumpxml %s' % vm_name, False) + if c: + return + self.undefine_vm_delete_disk(r, vm_name) + + def undefine_vm_delete_disk(self, printout, vm_name): + disk_files = [] + xml_dump = etree.fromstring(printout, self.parser) + disks = xml_dump.xpath('/domain/devices/disk') + for disk in disks: + sources = disk.xpath('source') + for source in sources: + source_file = source.get('file') + if source_file: + disk_files.append(source_file) + log('Deleting VM %s with disks %s' % (vm_name, disk_files)) + exec_cmd('virsh destroy %s' % vm_name, False) + exec_cmd('virsh undefine --managed-save --remove-all-storage %s' % vm_name, False) + + def overwrite_xml(self, vm_xml, vm_definition_overwrite): + if not vm_definition_overwrite: + return + for key, value in vm_definition_overwrite.iteritems(): + if key == 'attribute_equlas': + continue + if key == 'value': + vm_xml.text = str(value) + return + if key == 'attribute': + for attr_key, attr_value in value.iteritems(): + vm_xml.set(attr_key, str(attr_value)) + return + + if isinstance(value, dict): + only_when_attribute = value.get('attribute_equlas') + for xml_element in vm_xml.xpath(key): + if only_when_attribute: + for attr_key, attr_value in \ + only_when_attribute.iteritems(): + if attr_value != xml_element.get(attr_key): + continue + self.overwrite_xml(xml_element, value) + + def define_vm(self, vm_name, temp_vm_file, disk_path, + vm_definition_overwrite): + log('Creating VM %s with disks %s' % (vm_name, disk_path)) + with open(temp_vm_file) as f: + vm_xml = etree.parse(f) + names = vm_xml.xpath('/domain/name') + for name in names: + name.text = vm_name + uuids = vm_xml.xpath('/domain/uuid') + for uuid in uuids: + uuid.getparent().remove(uuid) + self.overwrite_xml(vm_xml.xpath('/domain')[0], + vm_definition_overwrite) + disks = vm_xml.xpath('/domain/devices/disk') + for disk in disks: + if (disk.get('type') == 'file' and + disk.get('device') == 'disk'): + sources = disk.xpath('source') + for source in sources: + disk.remove(source) + source = etree.Element('source') + source.set('file', disk_path) + disk.append(source) + with open(temp_vm_file, 'w') as f: + vm_xml.write(f, pretty_print=True, xml_declaration=True) + exec_cmd('virsh define %s' % temp_vm_file) diff --git a/deploy/environments/libvirt_environment.py b/deploy/environments/libvirt_environment.py new file mode 100644 index 000000000..c9fa41fd7 --- /dev/null +++ b/deploy/environments/libvirt_environment.py @@ -0,0 +1,107 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +from lxml import etree +import glob +from execution_environment import ExecutionEnvironment +import tempfile + +from common import ( + exec_cmd, + log, + check_dir_exists, + check_file_exists, + delete, +) + + +class LibvirtEnvironment(ExecutionEnvironment): + + def __init__(self, storage_dir, dha_file, dea, root_dir): + super(LibvirtEnvironment, self).__init__( + storage_dir, dha_file, root_dir) + self.dea = dea + self.network_dir = '%s/%s' % (self.root_dir, + self.dha.get_virt_net_conf_dir()) + self.node_ids = self.dha.get_all_node_ids() + self.net_names = self.collect_net_names() + + def create_storage(self, node_id, disk_path, disk_sizes): + role = self.dea.get_node_main_role(node_id, self.fuel_node_id) + disk_size = disk_sizes[role] + exec_cmd('qemu-img create -f qcow2 %s %s' % (disk_path, disk_size)) + + def create_vms(self): + temp_dir = tempfile.mkdtemp() + disk_sizes = self.dha.get_disks() + for node_id in self.node_ids: + vm_name = self.dha.get_node_property(node_id, 'libvirtName') + vm_template = '%s/%s' % (self.root_dir, + self.dha.get_node_property( + node_id, 'libvirtTemplate')) + check_file_exists(vm_template) + disk_path = '%s/%s.raw' % (self.storage_dir, vm_name) + self.create_storage(node_id, disk_path, disk_sizes) + temp_vm_file = '%s/%s' % (temp_dir, vm_name) + exec_cmd('cp %s %s' % (vm_template, temp_vm_file)) + vm_definition_overwrite = self.dha.get_vm_definition( + self.dea.get_node_main_role(node_id, self.fuel_node_id)) + self.define_vm(vm_name, temp_vm_file, disk_path, + vm_definition_overwrite) + delete(temp_dir) + + def start_vms(self): + for node_id in self.node_ids: + self.dha.node_power_on(node_id) + + def create_networks(self): + for net_file in glob.glob('%s/*' % self.network_dir): + exec_cmd('virsh net-define %s' % net_file) + for net in self.net_names: + log('Creating network %s' % net) + exec_cmd('virsh net-autostart %s' % net) + exec_cmd('virsh net-start %s' % net) + + def delete_networks(self): + for net in self.net_names: + log('Deleting network %s' % net) + exec_cmd('virsh net-destroy %s' % net, False) + exec_cmd('virsh net-undefine %s' % net, False) + + def get_net_name(self, net_file): + with open(net_file) as f: + net_xml = etree.parse(f) + name_list = net_xml.xpath('/network/name') + for name in name_list: + net_name = name.text + return net_name + + def collect_net_names(self): + net_list = [] + for net_file in glob.glob('%s/*' % self.network_dir): + name = self.get_net_name(net_file) + net_list.append(name) + return net_list + + def delete_vms(self): + for node_id in self.node_ids: + self.delete_vm(node_id) + + + def setup_environment(self): + check_dir_exists(self.network_dir) + self.cleanup_environment() + self.create_networks() + self.create_vms() + self.start_vms() + + def cleanup_environment(self): + self.delete_vms() + self.delete_networks() diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py new file mode 100644 index 000000000..b1a76e479 --- /dev/null +++ b/deploy/environments/virtual_fuel.py @@ -0,0 +1,143 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +from lxml import etree +from execution_environment import ExecutionEnvironment +import tempfile +import os +import re +import time + +from common import ( + exec_cmd, + check_file_exists, + check_if_root, + delete, + log, +) + +VOL_XML_TEMPLATE = ''' + {name} + {size!s} + + + +''' + +DEFAULT_POOL = 'jenkins' + +def get_size_and_unit(s): + p = re.compile('^(\d+)\s*(\D+)') + m = p.match(s) + if m == None: + return None, None + size = m.groups()[0] + unit = m.groups()[1] + return size, unit + +class VirtualFuel(ExecutionEnvironment): + + def __init__(self, storage_dir, pxe_bridge, dha_file, root_dir): + super(VirtualFuel, self).__init__(storage_dir, dha_file, root_dir) + self.pxe_bridge = pxe_bridge + self.temp_dir = tempfile.mkdtemp() + self.vm_name = self.dha.get_node_property(self.fuel_node_id, + 'libvirtName') + self.vm_template = '%s/%s' % (self.root_dir, + self.dha.get_node_property( + self.fuel_node_id, 'libvirtTemplate')) + check_file_exists(self.vm_template) + with open(self.vm_template) as f: + self.vm_xml = etree.parse(f) + + self.temp_vm_file = '%s/%s' % (self.temp_dir, self.vm_name) + self.update_vm_template_file() + + def __del__(self): + delete(self.temp_dir) + + def update_vm_template_file(self): + with open(self.temp_vm_file, "wc") as f: + self.vm_xml.write(f, pretty_print=True, xml_declaration=True) + + def del_vm_nics(self): + interfaces = self.vm_xml.xpath('/domain/devices/interface') + for interface in interfaces: + interface.getparent().remove(interface) + + def add_vm_nic(self, bridge): + interface = etree.Element('interface') + interface.set('type', 'bridge') + source = etree.SubElement(interface, 'source') + source.set('bridge', bridge) + model = etree.SubElement(interface, 'model') + model.set('type', 'virtio') + + devices = self.vm_xml.xpath('/domain/devices') + if devices: + device = devices[0] + device.append(interface) + else: + err('No devices!') + + def create_volume(self, pool, name, su, img_type='qcow2'): + log('Creating image using Libvirt volumes in pool %s, name: %s' % + (pool, name)) + size, unit = get_size_and_unit(su) + if size == None: + err('Could not determine size and unit of %s' % s) + + vol_xml = VOL_XML_TEMPLATE.format(name=name, unit=unit, size=size, + format_type=img_type) + fname = os.path.join(self.temp_dir, '%s_vol.xml' % name) + with file(fname, 'w') as f: + f.write(vol_xml) + + exec_cmd('virsh vol-create --pool %s %s' % (pool, fname)) + vol_path = exec_cmd('virsh vol-path --pool %s %s' % (pool, name)) + + delete(fname) + + return vol_path + + def create_image(self, disk_path, disk_size): + if os.environ.get('LIBVIRT_DEFAULT_URI') == None: + exec_cmd('qemu-img create -f qcow2 %s %s' % (disk_path, disk_size)) + else: + pool = DEFAULT_POOL # FIXME + name = os.path.basename(disk_path) + disk_path = self.create_volume(pool, name, disk_size) + + return disk_path + + def create_vm(self): + stamp = time.strftime("%Y%m%d%H%M%S") + disk_path = '%s/%s-%s.raw' % (self.storage_dir, self.vm_name, stamp) + disk_sizes = self.dha.get_disks() + disk_size = disk_sizes['fuel'] + disk_path = self.create_image(disk_path, disk_size) + + self.del_vm_nics() + for bridge in self.pxe_bridge: + self.add_vm_nic(bridge) + self.update_vm_template_file() + + vm_definition_overwrite = self.dha.get_vm_definition('fuel') + + self.define_vm(self.vm_name, self.temp_vm_file, disk_path, + vm_definition_overwrite) + + def setup_environment(self): + check_if_root() + self.cleanup_environment() + self.create_vm() + + def cleanup_environment(self): + self.delete_vm(self.fuel_node_id) diff --git a/deploy/execution_environment.py b/deploy/execution_environment.py new file mode 100644 index 000000000..b8e861c4a --- /dev/null +++ b/deploy/execution_environment.py @@ -0,0 +1,37 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import yaml +import io +import os + +from environments.libvirt_environment import LibvirtEnvironment +from environments.virtual_fuel import VirtualFuel + + +class ExecutionEnvironment(object): + + def __new__(cls, storage_dir, pxe_bridge, dha_path, dea): + + with io.open(dha_path) as yaml_file: + dha_struct = yaml.load(yaml_file) + + type = dha_struct['adapter'] + + root_dir = os.path.dirname(os.path.realpath(__file__)) + + if cls is ExecutionEnvironment: + if type == 'libvirt': + return LibvirtEnvironment(storage_dir, dha_path, dea, root_dir) + + if type in ['ipmi', 'hp', 'amt', 'zte']: + return VirtualFuel(storage_dir, pxe_bridge, dha_path, root_dir) + + return super(ExecutionEnvironment, cls).__new__(cls) diff --git a/deploy/fuel_patch/ks.cfg.patch b/deploy/fuel_patch/ks.cfg.patch new file mode 100644 index 000000000..8c9cebc0f --- /dev/null +++ b/deploy/fuel_patch/ks.cfg.patch @@ -0,0 +1,19 @@ +*** ks.cfg.orig 2016-01-25 08:56:16.406241267 +0100 +--- ks.cfg 2016-01-25 14:31:11.417761494 +0100 +*************** +*** 98,104 **** + default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'` + + installdrive=${installdrive:-undefined} +! forceformat=${forceformat:-no} + for I in $(cat /proc/cmdline); do + case "$I" in + *=*) +--- 98,104 ---- + default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'` + + installdrive=${installdrive:-undefined} +! forceformat=${forceformat:-yes} + for I in $(cat /proc/cmdline); do + case "$I" in + *=*) diff --git a/deploy/install_fuel_master.py b/deploy/install_fuel_master.py new file mode 100644 index 000000000..a0e28b033 --- /dev/null +++ b/deploy/install_fuel_master.py @@ -0,0 +1,222 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + +import time +import os +import glob +from ssh_client import SSHClient +from dha_adapters.libvirt_adapter import LibvirtAdapter + +from common import ( + log, + err, + clean, + delete, +) + +TRANSPLANT_FUEL_SETTINGS = 'transplant_fuel_settings.py' +BOOTSTRAP_ADMIN = 'bootstrap_admin_node' +FUEL_CLIENT_CONFIG = '/etc/fuel/client/config.yaml' +PLUGINS_DIR = '~/plugins' +LOCAL_PLUGIN_FOLDER = '/opt/opnfv' +IGNORABLE_FUEL_ERRORS = ['does not update installed package', + 'Couldn\'t resolve host'] + + +class InstallFuelMaster(object): + + def __init__(self, dea_file, dha_file, fuel_ip, fuel_username, + fuel_password, fuel_node_id, iso_file, work_dir, + fuel_plugins_dir, no_plugins): + self.dea_file = dea_file + self.dha = LibvirtAdapter(dha_file) + self.fuel_ip = fuel_ip + self.fuel_username = fuel_username + self.fuel_password = fuel_password + self.fuel_node_id = fuel_node_id + self.iso_file = iso_file + self.iso_dir = os.path.dirname(self.iso_file) + self.work_dir = work_dir + self.fuel_plugins_dir = fuel_plugins_dir + self.no_plugins = no_plugins + self.file_dir = os.path.dirname(os.path.realpath(__file__)) + self.ssh = SSHClient(self.fuel_ip, self.fuel_username, + self.fuel_password) + + def install(self): + log('Start Fuel Installation') + + self.dha.node_power_off(self.fuel_node_id) + + if os.environ.get('LIBVIRT_DEFAULT_URI'): + log('Upload ISO to pool') + self.iso_file = self.dha.upload_iso(self.iso_file) + else: + log('Zero the MBR') + self.dha.node_zero_mbr(self.fuel_node_id) + + self.dha.node_set_boot_order(self.fuel_node_id, ['disk', 'iso']) + + try: + self.proceed_with_installation() + except Exception as e: + self.post_install_cleanup() + err(e) + + def proceed_with_installation(self): + log('Eject ISO') + self.dha.node_eject_iso(self.fuel_node_id) + + log('Insert ISO %s' % self.iso_file) + self.dha.node_insert_iso(self.fuel_node_id, self.iso_file) + + self.dha.node_power_on(self.fuel_node_id) + + log('Waiting for Fuel master to accept SSH') + self.wait_for_node_up() + + log('Wait until Fuel menu is up') + fuel_menu_pid = self.wait_until_fuel_menu_up() + + log('Inject our own astute.yaml and fuel_bootstrap_cli.yaml settings') + self.inject_own_astute_and_bootstrap_yaml() + + log('Let the Fuel deployment continue') + log('Found FUEL menu as PID %s, now killing it' % fuel_menu_pid) + self.ssh_exec_cmd('kill %s' % fuel_menu_pid, False) + + log('Wait until installation is complete') + self.wait_until_installation_completed() + + log('Waiting for one minute for Fuel to stabilize') + time.sleep(60) + + self.delete_deprecated_fuel_client_config() + + if not self.no_plugins: + + self.collect_plugin_files() + + self.install_plugins() + + self.post_install_cleanup() + + log('Fuel Master installed successfully !') + + def collect_plugin_files(self): + with self.ssh as s: + s.exec_cmd('mkdir %s' % PLUGINS_DIR) + if self.fuel_plugins_dir: + for f in glob.glob('%s/*.rpm' % self.fuel_plugins_dir): + s.scp_put(f, PLUGINS_DIR) + + def install_plugins(self): + log('Installing Fuel Plugins') + plugin_files = [] + with self.ssh as s: + for plugin_location in [PLUGINS_DIR, LOCAL_PLUGIN_FOLDER]: + s.exec_cmd('mkdir -p %s' % plugin_location) + r = s.exec_cmd('find %s -type f -name \'*.rpm\'' + % plugin_location) + plugin_files.extend(r.splitlines()) + for f in plugin_files: + log('Found plugin %s, installing ...' % f) + r, e = s.exec_cmd('fuel plugins --install %s' % f, False) + printout = r + e if e else r + if e and all([err not in printout + for err in IGNORABLE_FUEL_ERRORS]): + raise Exception('Installation of Fuel Plugin %s ' + 'failed: %s' % (f, e)) + + def wait_for_node_up(self): + WAIT_LOOP = 240 + SLEEP_TIME = 10 + success = False + for i in range(WAIT_LOOP): + try: + self.ssh.open() + success = True + break + except Exception: + log('Trying to SSH into Fuel VM %s ... sleeping %s seconds' + % (self.fuel_ip, SLEEP_TIME)) + time.sleep(SLEEP_TIME) + finally: + self.ssh.close() + + if not success: + raise Exception('Could not SSH into Fuel VM %s' % self.fuel_ip) + + def wait_until_fuel_menu_up(self): + WAIT_LOOP = 60 + SLEEP_TIME = 10 + CMD = 'pgrep -f fuelmenu' + fuel_menu_pid = None + with self.ssh: + for i in range(WAIT_LOOP): + ret = self.ssh.exec_cmd(CMD) + fuel_menu_pid = ret.strip() + if not fuel_menu_pid: + time.sleep(SLEEP_TIME) + else: + break + if not fuel_menu_pid: + raise Exception('Could not find the Fuel Menu Process ID') + return fuel_menu_pid + + def ssh_exec_cmd(self, cmd, check=True): + with self.ssh: + ret = self.ssh.exec_cmd(cmd, check=check) + return ret + + def inject_own_astute_and_bootstrap_yaml(self): + with self.ssh as s: + s.exec_cmd('rm -rf %s' % self.work_dir, False) + s.exec_cmd('mkdir %s' % self.work_dir) + s.scp_put(self.dea_file, self.work_dir) + s.scp_put('%s/common.py' % self.file_dir, self.work_dir) + s.scp_put('%s/dea.py' % self.file_dir, self.work_dir) + s.scp_put('%s/transplant_fuel_settings.py' + % self.file_dir, self.work_dir) + log('Modifying Fuel astute') + s.run('python %s/%s %s/%s' + % (self.work_dir, TRANSPLANT_FUEL_SETTINGS, + self.work_dir, os.path.basename(self.dea_file))) + + def wait_until_installation_completed(self): + WAIT_LOOP = 360 + SLEEP_TIME = 10 + CMD = 'pgrep -f %s' % BOOTSTRAP_ADMIN + + install_completed = False + with self.ssh: + for i in range(WAIT_LOOP): + ret = self.ssh.exec_cmd(CMD) + if not ret: + install_completed = True + break + else: + time.sleep(SLEEP_TIME) + + if not install_completed: + raise Exception('Fuel installation did not complete') + + def post_install_cleanup(self): + log('Eject ISO file %s' % self.iso_file) + self.dha.node_eject_iso(self.fuel_node_id) + delete(self.iso_dir) + + def delete_deprecated_fuel_client_config(self): + with self.ssh as s: + response, error = s.exec_cmd('fuel -v', False) + if (error and + 'DEPRECATION WARNING' in error and FUEL_CLIENT_CONFIG in error): + log('Delete deprecated fuel client config %s' % FUEL_CLIENT_CONFIG) + with self.ssh as s: + s.exec_cmd('rm %s' % FUEL_CLIENT_CONFIG, False) diff --git a/deploy/reap.py b/deploy/reap.py new file mode 100644 index 000000000..69c98d10c --- /dev/null +++ b/deploy/reap.py @@ -0,0 +1,413 @@ +#!/usr/bin/python +############################################################################### +# Copyright (c) 2015, 2016 Ericsson AB and others. +# szilard.cserey@ericsson.com +# peter.barabas@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import time +import os +import yaml +import glob +import shutil +import tempfile +import re +import netaddr +import templater + +from common import ( + N, + E, + R, + ArgParser, + exec_cmd, + parse, + err, + log, + delete, + commafy, +) + +DEA_1 = ''' +title: Deployment Environment Adapter (DEA) +# DEA API version supported +version: 1.1 +created: {date} +comment: {comment} +''' + +DHA_1 = ''' +title: Deployment Hardware Adapter (DHA) +# DHA API version supported +version: 1.1 +created: {date} +comment: {comment} + +# Adapter to use for this definition +# adapter: [ipmi|libvirt] +adapter: + +# Node list. +# Mandatory properties are id and role. +# All other properties are adapter specific. +# For Non-Fuel nodes controlled by: +# - ipmi adapter you need to provide: +# pxeMac +# ipmiIp +# ipmiUser +# ipmiPass +# and you *MAY* provide (optional, not added by reap.py): +# ipmiPort +# - libvirt adapter you need to provide: +# libvirtName: +# libvirtTemplate: [libvirt/vms/controller.xml | libvirt/vms/compute.xml] +# +# For the Fuel Node you need to provide: +# libvirtName: +# libvirtTemplate: libvirt/vms/fuel.xml +# isFuel: yes +# username: root +# password: r00tme +''' + +DHA_2 = ''' +# Adding the Fuel node as node id {node_id} +# which may not be correct - please adjust as needed. +''' + +DISKS = {'fuel': '100G', + 'controller': '100G', + 'compute': '100G'} + + +class Reap(object): + + def __init__(self, dea_file, dha_file, comment, base_dea, template): + self.dea_file = dea_file + self.dha_file = dha_file + self.comment = comment + self.base_dea = base_dea + self.template = template + self.temp_dir = None + self.env = None + self.env_id = None + self.last_node = None + + def get_env(self): + env_list = parse(exec_cmd('fuel env')) + if len(env_list) == 0: + err('No environment deployed') + elif len(env_list) > 1: + err('More than 1 environment deployed') + self.env = env_list[0] + self.env_id = self.env[E['id']] + + def download_config(self, config_type): + log('Download %s config for environment %s' + % (config_type, self.env_id)) + exec_cmd('fuel %s --env %s --download --dir %s' + % (config_type, self.env_id, self.temp_dir)) + + def download_node_config(self, nodeid): + log('Download node %s config for environment %s to %s' + % (nodeid, self.env_id,self.temp_dir)) + exec_cmd('fuel deployment --node-id %s --env %s --default --dir %s' + % (nodeid, self.env_id, self.temp_dir)) + + def write(self, file, text, newline=True): + mode = 'a' if os.path.isfile(file) else 'w' + with open(file, mode) as f: + f.write('%s%s' % (text, ('\n' if newline else ''))) + + def write_yaml(self, file, data, newline=True): + self.write(file, yaml.dump(data, default_flow_style=False).strip(), + newline) + + def get_node_by_id(self, node_list, node_id): + for node in node_list: + if node[N['id']] == node_id: + return node + + def reap_interface(self, node_id, interfaces): + interface, mac = self.get_interface(node_id) + if_name = None + if interfaces: + if_name = self.check_dict_exists(interfaces, interface) + if not if_name: + if_name = 'interfaces_%s' % str(len(interfaces) + 1) + interfaces[if_name] = interface + return if_name, mac + + def reap_transformation(self, node_id, roles, transformations): + main_role = 'controller' if 'controller' in roles else 'compute' + node_file = glob.glob('%s/deployment_%s/%s.yaml' + % (self.temp_dir, self.env_id, node_id)) + tr_name = None + with open(node_file[0]) as f: + node_config = yaml.load(f) + transformation = {'transformations': + node_config['network_scheme']['transformations']} + if transformations: + tr_name = self.check_dict_exists(transformations, transformation) + if not tr_name: + tr_name = 'transformations_%s' % str(len(transformations) + 1) + transformations[tr_name] = transformation + return tr_name + + def check_dict_exists(self, main_dict, dict): + for key, val in main_dict.iteritems(): + if cmp(dict, val) == 0: + return key + + def reap_nodes_interfaces_transformations(self): + node_list = parse(exec_cmd('fuel node')) + real_node_ids = [node[N['id']] for node in node_list] + real_node_ids.sort() + min_node = real_node_ids[0] + interfaces = {} + transformations = {} + dea_nodes = [] + dha_nodes = [] + + for real_node_id in real_node_ids: + node_id = int(real_node_id) - int(min_node) + 1 + self.last_node = node_id + node = self.get_node_by_id(node_list, real_node_id) + roles = commafy(node[N['roles']]) + if not roles: + err('Fuel Node %s has no role' % real_node_id) + dea_node = {'id': node_id, + 'role': roles} + dha_node = {'id': node_id} + if_name, mac = self.reap_interface(real_node_id, interfaces) + log('reap transformation for node %s' % real_node_id) + tr_name = self.reap_transformation(real_node_id, roles, + transformations) + dea_node.update( + {'interfaces': if_name, + 'transformations': tr_name}) + + dha_node.update( + {'pxeMac': mac if mac else None, + 'ipmiIp': None, + 'ipmiUser': None, + 'ipmiPass': None, + 'libvirtName': None, + 'libvirtTemplate': None}) + + dea_nodes.append(dea_node) + dha_nodes.append(dha_node) + + self.write_yaml(self.dha_file, {'nodes': dha_nodes}, False) + self.write_yaml(self.dea_file, {'nodes': dea_nodes}) + self.write_yaml(self.dea_file, interfaces) + self.write_yaml(self.dea_file, transformations) + self.reap_fuel_node_info() + self.write_yaml(self.dha_file, {'disks': DISKS}) + + def reap_fuel_node_info(self): + dha_nodes = [] + dha_node = { + 'id': self.last_node + 1, + 'libvirtName': None, + 'libvirtTemplate': None, + 'isFuel': True, + 'username': 'root', + 'password': 'r00tme'} + + dha_nodes.append(dha_node) + + self.write(self.dha_file, DHA_2.format(node_id=dha_node['id']), False) + self.write_yaml(self.dha_file, dha_nodes) + + def reap_environment_info(self): + network_file = ('%s/network_%s.yaml' + % (self.temp_dir, self.env_id)) + network = self.read_yaml(network_file) + + env = {'environment': + {'name': self.env[E['name']], + 'net_segment_type': + network['networking_parameters']['segmentation_type']}} + self.write_yaml(self.dea_file, env) + wanted_release = None + rel_list = parse(exec_cmd('fuel release')) + for rel in rel_list: + if rel[R['id']] == self.env[E['release_id']]: + wanted_release = rel[R['name']] + self.write_yaml(self.dea_file, {'wanted_release': wanted_release}) + + def reap_fuel_settings(self): + data = self.read_yaml('/etc/fuel/astute.yaml') + fuel = {} + del data['ADMIN_NETWORK']['mac'] + del data['ADMIN_NETWORK']['interface'] + for key in ['ADMIN_NETWORK', 'HOSTNAME', 'DNS_DOMAIN', 'DNS_SEARCH', + 'DNS_UPSTREAM', 'NTP1', 'NTP2', 'NTP3', 'FUEL_ACCESS']: + fuel[key] = data[key] + for key in fuel['ADMIN_NETWORK'].keys(): + if key not in ['ipaddress', 'netmask', + 'dhcp_pool_start', 'dhcp_pool_end', 'ssh_network']: + del fuel['ADMIN_NETWORK'][key] + + ## FIXME(armband): Factor in support for adding public/other interfaces. + ## TODO: Following block expects interface name(s) to be lowercase only + interfaces_list = exec_cmd('ip -o -4 a | grep -e "e[nt][hopsx].*"') + for interface in re.split('\n', interfaces_list): + # Sample output line from above cmd: + # 3: eth1 inet 10.0.2.10/24 scope global eth1 valid_lft forever ... + ifcfg = re.split(r'\s+', interface) + ifcfg_name = ifcfg[1] + ifcfg_ipaddr = ifcfg[3] + + # Filter out admin interface (device name is not known, match IP) + current_network = netaddr.IPNetwork(ifcfg_ipaddr) + if str(current_network.ip) == fuel['ADMIN_NETWORK']['ipaddress']: + continue + + # Read ifcfg-* network interface config file, write IFCFG_ + ifcfg_sec = 'IFCFG_%s' % ifcfg_name.upper() + fuel[ifcfg_sec] = {} + ifcfg_data = {} + ifcfg_f = ('/etc/sysconfig/network-scripts/ifcfg-%s' % ifcfg_name) + with open(ifcfg_f) as f: + for line in f: + if line.startswith('#'): + continue + (key, val) = line.split('=') + ifcfg_data[key.lower()] = val.rstrip() + + # Keep only needed info (e.g. filter-out type=Ethernet). + fuel[ifcfg_sec]['ipaddress'] = ifcfg_data['ipaddr'] + fuel[ifcfg_sec]['device'] = ifcfg_data['device'] + fuel[ifcfg_sec]['netmask'] = str(current_network.netmask) + fuel[ifcfg_sec]['gateway'] = ifcfg_data['gateway'] + + self.write_yaml(self.dea_file, {'fuel': fuel}) + + def reap_network_settings(self): + network_file = ('%s/network_%s.yaml' + % (self.temp_dir, self.env_id)) + data = self.read_yaml(network_file) + network = {} + network['networking_parameters'] = data['networking_parameters'] + network['networks'] = data['networks'] + for net in network['networks']: + del net['id'] + del net['group_id'] + self.write_yaml(self.dea_file, {'network': network}) + + def reap_settings(self): + settings_file = '%s/settings_%s.yaml' % (self.temp_dir, self.env_id) + settings = self.read_yaml(settings_file) + self.write_yaml(self.dea_file, {'settings': settings}) + + def get_interface(self, real_node_id): + exec_cmd('fuel node --node-id %s --network --download --dir %s' + % (real_node_id, self.temp_dir)) + interface_file = ('%s/node_%s/interfaces.yaml' + % (self.temp_dir, real_node_id)) + interfaces = self.read_yaml(interface_file) + interface_config = {} + pxe_mac = None + for interface in interfaces: + networks = [] + for network in interface['assigned_networks']: + networks.append(network['name']) + if network['name'] == 'fuelweb_admin': + pxe_mac = interface['mac'] + if networks: + interface_config[interface['name']] = networks + return interface_config, pxe_mac + + def read_yaml(self, yaml_file): + with open(yaml_file) as f: + data = yaml.load(f) + return data + + def intro(self): + delete(self.dea_file) + delete(self.dha_file) + + self.temp_dir = tempfile.mkdtemp() + date = time.strftime('%c') + self.write(self.dea_file, + DEA_1.format(date=date, comment=self.comment), False) + self.write(self.dha_file, + DHA_1.format(date=date, comment=self.comment)) + self.get_env() + + # Need to download deployment with explicit node ids + node_list = parse(exec_cmd('fuel node')) + real_node_ids = [node[N['id']] for node in node_list] + real_node_ids.sort() + self.download_node_config(','.join(real_node_ids)) + + self.download_config('settings') + self.download_config('network') + + def create_base_dea(self): + templater = templater.Templater(self.dea_file, + self.template, + self.base_dea) + templater.run() + + def finale(self): + log('DEA file is available at %s' % self.dea_file) + log('DHA file is available at %s (this is just a template)' + % self.dha_file) + if self.base_dea: + log('DEA base file is available at %s' % self.base_dea) + shutil.rmtree(self.temp_dir) + + def reap(self): + self.intro() + self.reap_environment_info() + self.reap_nodes_interfaces_transformations() + self.reap_fuel_settings() + self.reap_network_settings() + self.reap_settings() + if self.base_dea: + self.create_base_dea() + self.finale() + + +def parse_arguments(): + parser = ArgParser(prog='python %s' % __file__) + parser.add_argument('dea_file', nargs='?', action='store', + default='dea.yaml', + help='Deployment Environment Adapter: dea.yaml') + parser.add_argument('dha_file', nargs='?', action='store', + default='dha.yaml', + help='Deployment Hardware Adapter: dha.yaml') + parser.add_argument('comment', nargs='?', action='store', help='Comment') + parser.add_argument('-base_dea', + dest='base_dea', + help='Create specified base DEA file from "dea_file"') + parser.add_argument('-template', + dest='template', + nargs='?', + default='base_dea_template.yaml', + help='Base DEA is generated from this template') + args = parser.parse_args() + return (args.dea_file, + args.dha_file, + args.comment, + args.base_dea, + args.template) + + +def main(): + dea_file, dha_file, comment, base_dea, template = parse_arguments() + + r = Reap(dea_file, dha_file, comment, base_dea, template) + r.reap() + + +if __name__ == '__main__': + main() diff --git a/deploy/scenario/README b/deploy/scenario/README new file mode 100644 index 000000000..e32262d0d --- /dev/null +++ b/deploy/scenario/README @@ -0,0 +1,159 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +Abstract: +--------- +The directory contains configuration files for different OPNFV deployment +feature scenarios used by Fuel@OPNFV, eg.: +- High availability configuration +- Type of SDN controller to be deployed +- OPNFV collaboration project features to be deployed. +- Provisioning of any other sevices + +Creating a new plugin +--------------------- +Creating a new plugin involves creating a plugin config yaml file in +/deploy/config/plugins. The filename should comply to following structure: +fuel-.yaml. +The plugin configuration must include plugin configuration metadata as below: + +plugin-config-metadata: + title: + version: + created: + comment: + +Moreover, naturaly the plugin configuration must include the plugin yaml +fragment, eg: + +opendaylight: + metadata: + enabled: true + label: OpenDaylight Lithium plugin +....... + +Creating a new deployment scenario +---------------------------------- +Creating a new deployment scenario involve creating a deployment scenario +yaml file under deploy/scenario/. The filename should comply to following +format: ___..._.yaml + +The deployment configuration file must contain configuration metadata as stated +below: + +deployment-scenario-metadata: + title: + version: + created: + comment: + +To include fuel plugins, use the stack-extentions key: +stack-extensions, eg: + +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.0.1 + module-config-override: + # Module config overrides + rest_api_port: + value: '8282' + enable_gbp: + value: false + enable_l3_odl: + value: true + enable_sfc: + value: false + +"module-config-name" and "module-config-version" must correspond to how +the plugin configuration yaml was named. +Everything under the "module-config-override" overrides the corresponding +keys in the plugin config yaml file, this can for instance be used to configure +the plugin. + +Everything under the "dea-override-config" overrides corresponding keys in the dea_base.yaml and dea_pod_override.yaml. +You must at least provide {environment:{mode:'value},{net_segment_type:'value'} +and {nodes:....} in order to configure the HA mode, network segmentation types +and role to node assignments. +Other ovverides may also be used to enable stack features such as ceph, heat, +etc. +Example: + +dea-override-config: + environment: + mode: ha + net_segment_type: tun + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller,opendaylight + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: mongo,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + + settings: + editable: + additional_components: + ceilometer: + description: If selected, Ceilometer component will be installed + label: Install Ceilometer + type: checkbox + value: true + weight: 40 + heat: + description: '' + label: '' + type: hidden + value: true + weight: 30 + metadata: + label: Additional Components + weight: 20 + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works + best if Ceph is enabled for volumes and images, too. Enables live migration + of all types of Ceph backed VMs (without this option, live migration will + only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: true + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. + If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could + be selected. + type: checkbox + value: true + weight: 30 + +Optionally you may override the pod dha defenition under the +"dha-override-config" key. + +Short names +----------- +scenario.yaml provides a mapping between a deployment scenario short-name +and one or several deployment scenario configuration yaml files. + +Other +----- +These configuration files are used by deploy.sh provided by Fuel@OPNFV, e.g. +deploy.sh will clone this repo when deploying. diff --git a/deploy/scenario/ha_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..4051c478a --- /dev/null +++ b/deploy/scenario/ha_heat_ceilometer_scenario.yaml @@ -0,0 +1,86 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: OpenStack-only, HA deployment + version: 0.0.3 + created: Jan 26 2016 + comment: Rebased to Fuel8 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller + - id: 2 + interfaces: interfaces_1 + role: mongo, controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_nfv-kvm_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_nfv-kvm_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..1217f7273 --- /dev/null +++ b/deploy/scenario/ha_nfv-kvm_heat_ceilometer_scenario.yaml @@ -0,0 +1,173 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: NFV KVM HA deployment + version: 0.0.6 + created: 27.07.2016 + comment: Ceph cannot be assigned to compute, ceph is collocated with one of the controllers + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-kvm + module-config-name: fuel-nfvkvm + module-config-version: 0.9.0 + module-config-override: + # Module config overrides + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,mongo + - id: 2 + interfaces: interfaces_1 + role: controller + - id: 3 + interfaces: interfaces_1 + role: controller + - id: 4 + interfaces: interfaces_1 + role: compute,ceph-osd + - id: 5 + interfaces: interfaces_1 + role: compute,ceph-osd + + settings: + editable: + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works best if Ceph is enabled for volumes and images, too. Enables live migration of all types of Ceph backed VMs (without this option, live migration will only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: false + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could be selected. + type: checkbox + value: false + weight: 30 + images_vcenter: + description: Configures Glance to use the vCenter/ESXi backend to store images. If enabled, this option will prevent Swift from installing. + label: VMware vCenter/ESXi datastore for images (Glance) + restrictions: + - action: hide + condition: settings:common.use_vcenter.value != true + - condition: settings:storage.images_ceph.value == true + message: Only one Glance backend could be selected. + type: checkbox + value: false + weight: 35 + iser: + description: 'High performance block storage: Cinder volumes over iSER protocol (iSCSI over RDMA). This feature requires SR-IOV capabilities in the NIC, and will use a dedicated virtual function for the storage network.' + label: iSER protocol for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value != true or settings:common.libvirt_type.value != 'kvm' + - action: hide + condition: not ('experimental' in version:feature_groups) + type: checkbox + value: false + weight: 11 + metadata: + group: storage + label: Storage Backends + weight: 60 + objects_ceph: + description: Configures RadosGW front end for Ceph RBD. This exposes S3 and Swift API Interfaces. If enabled, this option will prevent Swift from installing. + label: Ceph RadosGW for objects (Swift API) + type: checkbox + value: false + weight: 80 + osd_pool_size: + description: Configures the default number of object replicas in Ceph. This number must be equal to or lower than the number of deployed 'Storage - Ceph OSD' nodes. + label: Ceph object replication factor + regex: + error: Invalid number + source: ^[1-9]\d*$ + type: text + value: '2' + weight: 85 + volumes_block_device: + description: High performance block device storage. It is recommended to have at least one Storage - Cinder Block Device + label: Cinder Block device driver + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 15 + volumes_ceph: + description: Configures Cinder to store volumes in Ceph RBD images. + label: Ceph RBD for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value == true or settings:storage.volumes_block_device.value == true + type: checkbox + value: true + weight: 20 + volumes_lvm: + description: It is recommended to have at least one Storage - Cinder LVM node. + label: Cinder LVM over iSCSI for volumes + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 10 + +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_nfv-ovs_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_nfv-ovs_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..51deb4e28 --- /dev/null +++ b/deploy/scenario/ha_nfv-ovs_heat_ceilometer_scenario.yaml @@ -0,0 +1,134 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: NFV OVS HA deployment + version: 0.9.0 + created: Jul 12 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - install_dpdk: + value: true + metadata: + plugin_version: 0.9.0 + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + fuel: + FEATURE_GROUPS: + - experimental + environment: + net_segment_type: vlan + nodes: + - id: 1 + interfaces: interfaces_vlan + role: controller + - id: 2 + interfaces: interfaces_vlan + role: mongo,controller + - id: 3 + interfaces: interfaces_vlan + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_dpdk + role: ceph-osd,compute + attributes: attributes_1 + - id: 5 + interfaces: interfaces_dpdk + role: ceph-osd,compute + attributes: attributes_1 + + attributes_1: + hugepages: + dpdk: + value: 128 + nova: + value: + '2048': 1024 + + network: + networking_parameters: + segmentation_type: vlan + vlan_range: + - 1000 + - 1030 + networks: + - cidr: null + gateway: null + ip_ranges: [] + meta: + configurable: false + map_priority: 2 + name: private + neutron_vlan_range: true + notation: null + render_addr_mask: null + render_type: null + seg_type: vlan + use_gateway: false + vlan_start: null + name: private + vlan_start: null + +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_odl-bgpvpn_scenario.yaml b/deploy/scenario/ha_odl-bgpvpn_scenario.yaml new file mode 100644 index 000000000..7d52e77e2 --- /dev/null +++ b/deploy/scenario/ha_odl-bgpvpn_scenario.yaml @@ -0,0 +1,104 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL HA BGPVPN deployment + version: 0.9.0 + created: 29.06.2016 + comment: Fuel ODL HA with BGPVPN, Ceph, Ceilometer and Heat Rebased for Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - enable_bgpvpn: + value: true + metadata: + plugin_version: 0.9.0 + + - module: bgpvpn + module-config-name: fuel-bgpvpn + module-config-version: 0.9.0 + + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,opendaylight + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + + +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_odl-l2_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_odl-l2_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..90c89aedc --- /dev/null +++ b/deploy/scenario/ha_odl-l2_heat_ceilometer_scenario.yaml @@ -0,0 +1,104 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL-L2 HA deployment + version: 0.0.4 + created: Jun 02 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: +# Note that the module substitionion does not support arrays +# This is a quick fix +# - module: opendaylight +# module-config-name: fuel-odl +# module-config-version: 0.0.2 +# module-config-override: + # Module config overrides +# rest_api_port: +# value: '8282' +# enable_gbp: +# value: false +# enable_l3_odl: +# value: false +# enable_sfc: +# value: false + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,opendaylight + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_odl-l2_sfc_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_odl-l2_sfc_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..e6aef2aba --- /dev/null +++ b/deploy/scenario/ha_odl-l2_sfc_heat_ceilometer_scenario.yaml @@ -0,0 +1,119 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL-L2 SFC HA deployment + version: 0.0.1 + created: Feb 10 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - install_nsh: + value: true + metadata: + plugin_version: 0.9.0 + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - enable_sfc: + value: true + metadata: + plugin_version: 0.9.0 +# Note that the module substitionion does not support arrays +# This is a quick fix +# - module: opendaylight +# module-config-name: fuel-odl +# module-config-version: 0.0.2 +# module-config-override: + # Module config overrides +# rest_api_port: +# value: '8282' +# enable_gbp: +# value: false +# enable_l3_odl: +# value: false +# enable_sfc: +# value: false + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,opendaylight + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_odl-l3_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_odl-l3_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..967e7d295 --- /dev/null +++ b/deploy/scenario/ha_odl-l3_heat_ceilometer_scenario.yaml @@ -0,0 +1,120 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL-L3 HA deployment + version: 0.0.5 + created: Jun 02 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +# Note that the module substitionion does not support arrays +# This is a quick fix +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - enable_l3_odl: + value: true + metadata: + plugin_version: 0.9.0 + + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + +# - module: opendaylight +# module-config-name: fuel-odl +# module-config-version: 0.0.2 +# module-config-override: +# # Module config overrides +# rest_api_port: +# value: '8282' +# enable_gbp: +# value: false +# enable_l3_odl: +# value: true +# enable_sfc: +# value: false + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,opendaylight + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + public_network_assignment: + assign_to_all_nodes: + value: true + +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_onos_nofeature_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_onos_nofeature_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..f813458d0 --- /dev/null +++ b/deploy/scenario/ha_onos_nofeature_heat_ceilometer_scenario.yaml @@ -0,0 +1,115 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ONOS HA deployment + version: 0.0.6 + created: Jun 08 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: onos + module-config-name: fuel-onos + module-config-version: 0.0.3 + module-config-override: + metadata: + class: plugin + default: false + enabled: true + label: onos plugin + toggleable: true + versions: + - enable_sfc: + label: SFC features + type: checkbox + value: false + weight: 13 + metadata: + hot_pluggable: false + plugin_version: 0.9.0 + restrictions: + - cluster:net_provider != 'neutron': Neutron only + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + weight: 70 + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + net_segment_type: tun + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,onos + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + public_network_assignment: + assign_to_all_nodes: + value: true +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_onos_sfc_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_onos_sfc_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..32fbfcf6c --- /dev/null +++ b/deploy/scenario/ha_onos_sfc_heat_ceilometer_scenario.yaml @@ -0,0 +1,95 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ONOS HA deployment + version: 0.0.6 + created: Jun 08 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: onos + module-config-name: fuel-onos + module-config-version: 0.0.3 + module-config-override: + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + net_segment_type: tun + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller,onos + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + public_network_assignment: + assign_to_all_nodes: + value: true +dha-override-config: + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/ha_vlan_heat_ceilometer_scenario.yaml b/deploy/scenario/ha_vlan_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..d1d5191f0 --- /dev/null +++ b/deploy/scenario/ha_vlan_heat_ceilometer_scenario.yaml @@ -0,0 +1,129 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: OpenStack-only, HA deployment with VLAN segmentation + version: 0.0.2 + created: Jan 19 2016 + comment: Rebased to Fuel8 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + mode: ha + net_segment_type: vlan + name: opnfv-vlan-noha + nodes: + - id: 1 + interfaces: interfaces_1 + role: controller + - id: 2 + interfaces: interfaces_1 + role: mongo,controller + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,controller + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 5 + interfaces: interfaces_1 + role: ceph-osd,compute + + settings: + editable: + additional_components: + ceilometer: + description: If selected, Ceilometer component will be installed + label: Install Ceilometer + type: checkbox + value: true + weight: 40 + heat: + description: '' + label: '' + type: hidden + value: true + weight: 30 + metadata: + label: Additional Components + weight: 20 + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works + best if Ceph is enabled for volumes and images, too. Enables live migration + of all types of Ceph backed VMs (without this option, live migration will + only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: true + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. + If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could + be selected. + type: checkbox + value: true + weight: 30 + +dha-override-config: +# These overrides only take effect for virtual deployment scenarios + nodes: + - id: 1 + libvirtName: controller1 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 2 + libvirtName: controller2 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 3 + libvirtName: controller3 + libvirtTemplate: templates/virtual_environment/vms/controller.xml + - id: 4 + libvirtName: compute1 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 5 + libvirtName: compute2 + libvirtTemplate: templates/virtual_environment/vms/compute.xml + - id: 6 + libvirtName: fuel-master + libvirtTemplate: templates/virtual_environment/vms/fuel.xml + isFuel: yes + username: root + password: r00tme + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..3dd5f841e --- /dev/null +++ b/deploy/scenario/no-ha_heat_ceilometer_scenario.yaml @@ -0,0 +1,62 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: OpenStack-only, No-HA deployment + version: 0.0.2 + created: Jan 26 2016 + comment: Fuel OpenStack-only with Ceph, Ceilometer and Heat, No-HA deployment rebased with Fuel8 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_nfv-kvm_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_nfv-kvm_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..4661a263d --- /dev/null +++ b/deploy/scenario/no-ha_nfv-kvm_heat_ceilometer_scenario.yaml @@ -0,0 +1,151 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: NFV KVM NO-HA deployment + version: 0.0.5 + created: Aug 03 2016 + comment: Ceph cannot be assigned to compute, using a seperate node for it + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-kvm + module-config-name: fuel-nfvkvm + module-config-version: 0.9.0 + module-config-override: + # Module config overrides + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + net_segment_type: tun + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd + - id: 3 + interfaces: interfaces_1 + role: compute + - id: 4 + interfaces: interfaces_1 + role: compute + + settings: + editable: + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works best if Ceph is enabled for volumes and images, too. Enables live migration of all types of Ceph backed VMs (without this option, live migration will only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: false + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could be selected. + type: checkbox + value: false + weight: 30 + images_vcenter: + description: Configures Glance to use the vCenter/ESXi backend to store images. If enabled, this option will prevent Swift from installing. + label: VMware vCenter/ESXi datastore for images (Glance) + restrictions: + - action: hide + condition: settings:common.use_vcenter.value != true + - condition: settings:storage.images_ceph.value == true + message: Only one Glance backend could be selected. + type: checkbox + value: false + weight: 35 + iser: + description: 'High performance block storage: Cinder volumes over iSER protocol (iSCSI over RDMA). This feature requires SR-IOV capabilities in the NIC, and will use a dedicated virtual function for the storage network.' + label: iSER protocol for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value != true or settings:common.libvirt_type.value != 'kvm' + - action: hide + condition: not ('experimental' in version:feature_groups) + type: checkbox + value: false + weight: 11 + metadata: + group: storage + label: Storage Backends + weight: 60 + objects_ceph: + description: Configures RadosGW front end for Ceph RBD. This exposes S3 and Swift API Interfaces. If enabled, this option will prevent Swift from installing. + label: Ceph RadosGW for objects (Swift API) + type: checkbox + value: false + weight: 80 + osd_pool_size: + description: Configures the default number of object replicas in Ceph. This number must be equal to or lower than the number of deployed 'Storage - Ceph OSD' nodes. + label: Ceph object replication factor + regex: + error: Invalid number + source: ^[1-9]\d*$ + type: text + value: '1' + weight: 85 + volumes_block_device: + description: High performance block device storage. It is recommended to have at least one Storage - Cinder Block Device + label: Cinder Block device driver + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 15 + volumes_ceph: + description: Configures Cinder to store volumes in Ceph RBD images. + label: Ceph RBD for volumes (Cinder) + restrictions: + - settings:storage.volumes_lvm.value == true or settings:storage.volumes_block_device.value == true + type: checkbox + value: true + weight: 20 + volumes_lvm: + description: It is recommended to have at least one Storage - Cinder LVM node. + label: Cinder LVM over iSCSI for volumes + restrictions: + - settings:storage.volumes_ceph.value == true + type: checkbox + value: false + weight: 10 + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_nfv-kvm_nfv-ovs_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_nfv-kvm_nfv-ovs_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..87364e83a --- /dev/null +++ b/deploy/scenario/no-ha_nfv-kvm_nfv-ovs_heat_ceilometer_scenario.yaml @@ -0,0 +1,114 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: NFV KVM and OVS No-HA deployment + version: 0.0.1 + created: Jan 6 2016 + comment: NFV KVM and OVS + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-qemu + module-config-name: fuel-nfvkvm + module-config-version: 0.0.1 + module-config-override: + # Module config overrides + + - module: fuel-plugin-ovsnfv + module-config-name: fuel-nfvovs + module-config-version: 0.0.1 + module-config-override: + # Module config overrides + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + mode: ha + net_segment_type: tun + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + additional_components: + ceilometer: + description: If selected, Ceilometer component will be installed + label: Install Ceilometer + type: checkbox + value: true + weight: 40 + heat: + description: '' + label: '' + type: hidden + value: true + weight: 30 + metadata: + label: Additional Components + weight: 20 + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works + best if Ceph is enabled for volumes and images, too. Enables live migration + of all types of Ceph backed VMs (without this option, live migration will + only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: true + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. + If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could + be selected. + type: checkbox + value: true + weight: 30 + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_nfv-ovs_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_nfv-ovs_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..7ab76cbcf --- /dev/null +++ b/deploy/scenario/no-ha_nfv-ovs_heat_ceilometer_scenario.yaml @@ -0,0 +1,112 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: NFV OVS NO-HA deployment + version: 0.9.0 + created: Jul 12 2016 + comment: NFV OVS NO-HA Rebased for Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - install_dpdk: + value: true + metadata: + plugin_version: 0.9.0 + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + fuel: + FEATURE_GROUPS: + - experimental + environment: + net_segment_type: vlan + nodes: + - id: 1 + interfaces: interfaces_vlan + role: mongo,controller + - id: 2 + interfaces: interfaces_dpdk + role: ceph-osd,compute + attributes: attributes_1 + - id: 3 + interfaces: interfaces_dpdk + role: ceph-osd,compute + attributes: attributes_1 + - id: 4 + interfaces: interfaces_dpdk + role: ceph-osd,compute + attributes: attributes_1 + + attributes_1: + hugepages: + dpdk: + value: 128 + nova: + value: + '2048': 1024 + + network: + networking_parameters: + segmentation_type: vlan + vlan_range: + - 1000 + - 1030 + networks: + - cidr: null + gateway: null + ip_ranges: [] + meta: + configurable: false + map_priority: 2 + name: private + neutron_vlan_range: true + notation: null + render_addr_mask: null + render_type: null + seg_type: vlan + use_gateway: false + vlan_start: null + name: private + vlan_start: null + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_odl-bgpvpn_scenario.yaml b/deploy/scenario/no-ha_odl-bgpvpn_scenario.yaml new file mode 100644 index 000000000..6f21ea2c8 --- /dev/null +++ b/deploy/scenario/no-ha_odl-bgpvpn_scenario.yaml @@ -0,0 +1,81 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL HA BGPVPN deployment + version: 0.9.0 + created: 29.06.2016 + comment: Fuel ODL No HA with BGPVPN, Ceph, Ceilometer and Heat Rebased for Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - enable_bgpvpn: + value: true + metadata: + plugin_version: 0.9.0 + + - module: bgpvpn + module-config-name: fuel-bgpvpn + module-config-version: 0.9.0 + + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,opendaylight + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_odl-l2_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_odl-l2_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..f8787d780 --- /dev/null +++ b/deploy/scenario/no-ha_odl-l2_heat_ceilometer_scenario.yaml @@ -0,0 +1,82 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL-L2 No-HA deployment + version: 0.0.3 + created: Jun 02 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: +# Note that the module substitionion does not support arrays +# This is a quick fix +# - module: opendaylight +# module-config-name: fuel-odl +# module-config-version: 0.0.2 +# module-config-override: +# # Module config overrides +# rest_api_port: +# value: '8282' +# enable_gbp: +# value: false +# enable_l3_odl: +# value: false +# enable_sfc: +# value: false + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,opendaylight + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_odl-l2_sfc_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_odl-l2_sfc_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..a8d9ed848 --- /dev/null +++ b/deploy/scenario/no-ha_odl-l2_sfc_heat_ceilometer_scenario.yaml @@ -0,0 +1,98 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL-L2-SFC No-HA deployment + version: 0.0.2 + created: Feb 10 2016 + comment: Fuel ODL-L2 SFC No HA with Ceph, Ceilometer and Heat Rebased for Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - install_nsh: + value: true + metadata: + plugin_version: 0.9.0 + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - enable_sfc: + value: true + metadata: + plugin_version: 0.9.0 + +# Note that the module substitionion does not support arrays +# This is a quick fix +# - module: opendaylight +# module-config-name: fuel-odl +# module-config-version: 0.0.2 +# module-config-override: +# # Module config overrides +# rest_api_port: +# value: '8282' +# enable_gbp: +# value: false +# enable_l3_odl: +# value: false +# enable_sfc: +# value: false + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,opendaylight + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_odl-l3_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_odl-l3_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..0c8415f78 --- /dev/null +++ b/deploy/scenario/no-ha_odl-l3_heat_ceilometer_scenario.yaml @@ -0,0 +1,97 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ODL-L3 No-HA deployment + version: 0.0.4 + created: Jun 02 2016 + comment: Rebased to Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +# Note that the module substitionion does not support arrays +# This is a quick fix +stack-extensions: + - module: opendaylight + module-config-name: fuel-odl + module-config-version: 0.9.0 + module-config-override: + metadata: + versions: + - enable_l3_odl: + value: true + metadata: + plugin_version: 0.9.0 + + - module: fuel-plugin-ovs + module-config-name: fuel-nshovs + module-config-version: 0.9.0 + +# - module: opendaylight +# module-config-name: fuel-odl +# module-config-version: 0.0.2 +# module-config-override: + # Module config overrides +# rest_api_port: +# value: '8282' +# enable_gbp: +# value: false +# enable_l3_odl: +# value: true +# enable_sfc: +# value: false + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,opendaylight + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + public_network_assignment: + assign_to_all_nodes: + value: true + +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_onos_nofeature_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_onos_nofeature_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..f5c00f0c9 --- /dev/null +++ b/deploy/scenario/no-ha_onos_nofeature_heat_ceilometer_scenario.yaml @@ -0,0 +1,93 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ONOS No-HA deployment + version: 0.0.5 + created: Jun 08 2016 + comment: ONOS No HA with Ceph, Ceilometer and Heat - Rebased for Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: onos + module-config-name: fuel-onos + module-config-version: 0.0.3 + module-config-override: + metadata: + class: plugin + default: false + enabled: true + label: onos plugin + toggleable: true + versions: + - enable_sfc: + label: SFC features + type: checkbox + value: false + weight: 13 + metadata: + hot_pluggable: false + plugin_version: 0.9.0 + restrictions: + - cluster:net_provider != 'neutron': Neutron only + - settings:public_network_assignment.assign_to_all_nodes.value == false: Assign + public network to all nodes + weight: 70 + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + net_segment_type: tun + name: onos_no-ha + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller,onos + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + public_network_assignment: + assign_to_all_nodes: + value: true +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_onos_sfc_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_onos_sfc_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..587346ef4 --- /dev/null +++ b/deploy/scenario/no-ha_onos_sfc_heat_ceilometer_scenario.yaml @@ -0,0 +1,73 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: ONOS No-HA deployment + version: 0.0.5 + created: Jun 08 2016 + comment: ONOS No HA with Ceph, Ceilometer and Heat - Rebased for Fuel9 + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + - module: onos + module-config-name: fuel-onos + module-config-version: 0.0.3 + module-config-override: + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + net_segment_type: tun + name: onos_no-ha + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller,onos + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + public_network_assignment: + assign_to_all_nodes: + value: true +dha-override-config: +# disks: +# contrail: 500G + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/no-ha_vlan_heat_ceilometer_scenario.yaml b/deploy/scenario/no-ha_vlan_heat_ceilometer_scenario.yaml new file mode 100644 index 000000000..567ea9867 --- /dev/null +++ b/deploy/scenario/no-ha_vlan_heat_ceilometer_scenario.yaml @@ -0,0 +1,103 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################### # Description: +# This .yaml configuration file defines the configuration of the fuel +# deployment and is passed as an argument to deploy.sh +# eg. deploy.sh -c https://artifact.opnfv.org/fuel/config +# This will make build.sh fetch this configuration file and configure the +# deployment accordingly. +# After the deployment, a copy of this file gets uploaded to fuel: +# /root/deploy-config.yaml, as well as the sha-1 sum of this file: +# /root/deploy-config.sha1 +############################################################################## + +############################################################################## +# deployment configuration meta-data +deployment-scenario-metadata: + title: OpenStack-only, No-HA deployment with VLAN segmentation + version: 0.0.1 + created: Jan 12 2016 + comment: Fuel OpenStack-only with VLAN segmentation, Ceph, Ceilometer and Heat, No-HA deployment + +############################################################################## +# Stack extentions are opnfv added value features in form of a fuel-plugin +# plug-ins listed below will be enabled and configured according to the +# /_.yaml +# It does so by copying the config file to the local plugin config directory +stack-extensions: + +############################################################################## +# By editing the override-config sections below, you can override arbitrary +# configuration name-space settings +dea-override-config: + environment: + mode: ha + net_segment_type: vlan + name: opnfv-vlan-noha + nodes: + - id: 1 + interfaces: interfaces_1 + role: mongo,controller + - id: 2 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 3 + interfaces: interfaces_1 + role: ceph-osd,compute + - id: 4 + interfaces: interfaces_1 + role: ceph-osd,compute + settings: + editable: + additional_components: + ceilometer: + description: If selected, Ceilometer component will be installed + label: Install Ceilometer + type: checkbox + value: true + weight: 40 + heat: + description: '' + label: '' + type: hidden + value: true + weight: 30 + metadata: + label: Additional Components + weight: 20 + storage: + ephemeral_ceph: + description: Configures Nova to store ephemeral volumes in RBD. This works + best if Ceph is enabled for volumes and images, too. Enables live migration + of all types of Ceph backed VMs (without this option, live migration will + only work with VMs launched from Cinder volumes). + label: Ceph RBD for ephemeral volumes (Nova) + type: checkbox + value: true + weight: 75 + images_ceph: + description: Configures Glance to use the Ceph RBD backend to store images. + If enabled, this option will prevent Swift from installing. + label: Ceph RBD for images (Glance) + restrictions: + - settings:storage.images_vcenter.value == true: Only one Glance backend could + be selected. + type: checkbox + value: true + weight: 30 + +dha-override-config: +# These overrides only take effect for virtual deployment scenarios + +############################################################################## +# The verification pipeline may populate the section below with arbitrary +# testing information, which post deploy can be retreived from the fuel master: +# /root/deploy-config.yaml +test: diff --git a/deploy/scenario/scenario.yaml b/deploy/scenario/scenario.yaml new file mode 100644 index 000000000..648ff22b3 --- /dev/null +++ b/deploy/scenario/scenario.yaml @@ -0,0 +1,83 @@ +############################################################################## +# Copyright (c) 2015 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +############################################################################## +# Description: +# This configuration file defines translation between a short deployment +# scenario name and an actual deployment scenario configuration file +# +# Short deployment scenario names are aligned between installer, test, and +# releng projects according to below pattern. +# os-[controller]-[feature]-[mode](-[optionalparameter]) +# +# Please note that the mechanism to get the details regarding the scenarios +# is different currently which needs to be aligned as well. +############################################################################## + +############################################################################## +# Short scenario name convention to be followed: +# os---[-] +# controler: nosdn|odl|onos|ocl|... +# feaure: nofeature | [vlan]_[kvm]_[ovs]_[vlan]_.... +# mode: ha|noha +############################################################################## + +os-nosdn-nofeature-ha: + configfile: ha_heat_ceilometer_scenario.yaml + +os-nosdn-nofeature-noha: + configfile: no-ha_heat_ceilometer_scenario.yaml + +os-odl_l3-nofeature-ha: + configfile: ha_odl-l3_heat_ceilometer_scenario.yaml + +os-odl_l3-nofeature-noha: + configfile: no-ha_odl-l3_heat_ceilometer_scenario.yaml + +os-odl_l2-nofeature-ha: + configfile: ha_odl-l2_heat_ceilometer_scenario.yaml + +os-odl_l2-nofeature-noha: + configfile: no-ha_odl-l2_heat_ceilometer_scenario.yaml + +os-onos-nofeature-ha: + configfile: ha_onos_nofeature_heat_ceilometer_scenario.yaml + +os-onos-nofeature-noha: + configfile: no-ha_onos_nofeature_heat_ceilometer_scenario.yaml + +os-onos-sfc-ha: + configfile: ha_onos_sfc_heat_ceilometer_scenario.yaml + +os-onos-sfc-noha: + configfile: no-ha_onos_sfc_heat_ceilometer_scenario.yaml + +os-nosdn-kvm-ha: + configfile: ha_nfv-kvm_heat_ceilometer_scenario.yaml + +os-nosdn-kvm-noha: + configfile: no-ha_nfv-kvm_heat_ceilometer_scenario.yaml + +os-nosdn-ovs-ha: + configfile: ha_nfv-ovs_heat_ceilometer_scenario.yaml + +os-nosdn-ovs-noha: + configfile: no-ha_nfv-ovs_heat_ceilometer_scenario.yaml + +os-odl_l2-bgpvpn-ha: + configfile: ha_odl-bgpvpn_scenario.yaml + +os-odl_l2-bgpvpn-noha: + configfile: no-ha_odl-bgpvpn_scenario.yaml + +os-odl_l2-sfc-ha: + configfile: ha_odl-l2_sfc_heat_ceilometer_scenario.yaml + +os-odl_l2-sfc-noha: + configfile: no-ha_odl-l2_sfc_heat_ceilometer_scenario.yaml diff --git a/deploy/ssh_client.py b/deploy/ssh_client.py new file mode 100644 index 000000000..24119dbfa --- /dev/null +++ b/deploy/ssh_client.py @@ -0,0 +1,103 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# peter.barabas@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import paramiko +import scp + +from common import ( + log, + err, +) + +TIMEOUT = 600 + +class SSHClient(object): + + def __init__(self, host, username, password): + self.host = host + self.username = username + self.password = password + self.client = None + + def open(self, timeout=TIMEOUT): + self.client = paramiko.SSHClient() + self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + self.client.connect(self.host, username=self.username, + password=self.password, look_for_keys=False, + timeout=timeout) + + def close(self): + if self.client is not None: + self.client.close() + self.client = None + + def __enter__(self): + self.open() + return self + + def __exit__(self, type, value, traceback): + self.close() + + def exec_cmd(self, command, check=True, sudo=False, timeout=TIMEOUT): + if sudo and self.username != 'root': + command = "sudo -S -p '' %s" % command + stdin, stdout, stderr = self.client.exec_command(command, + timeout=timeout) + if sudo: + stdin.write(self.password + '\n') + stdin.flush() + response = stdout.read().strip() + error = stderr.read().strip() + + if check: + if error: + self.close() + raise Exception(error) + else: + return response + return response, error + + def run(self, command): + transport = self.client.get_transport() + transport.set_keepalive(1) + chan = transport.open_session() + chan.exec_command(command) + while not chan.exit_status_ready(): + if chan.recv_ready(): + data = chan.recv(1024) + while data: + log(data.strip()) + data = chan.recv(1024) + + if chan.recv_stderr_ready(): + error_buff = chan.recv_stderr(1024) + while error_buff: + log(error_buff.strip()) + error_buff = chan.recv_stderr(1024) + return chan.recv_exit_status() + + def scp_get(self, remote, local='.', dir=False): + try: + with scp.SCPClient(self.client.get_transport(), + sanitize=lambda x: x, + socket_timeout=TIMEOUT) as _scp: + _scp.get(remote, local, dir) + except Exception as e: + err(e) + + def scp_put(self, local, remote='.', dir=False): + try: + with scp.SCPClient(self.client.get_transport(), + sanitize=lambda x: x, + socket_timeout=TIMEOUT) as _scp: + _scp.put(local, remote, dir) + except Exception as e: + err(e) diff --git a/deploy/templater.py b/deploy/templater.py new file mode 100755 index 000000000..bda60c7fe --- /dev/null +++ b/deploy/templater.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python +############################################################################### +# Copyright (c) 2016 Ericsson AB and others. +# peter.barabas@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import io +import re +import yaml +import urllib2 +from common import( + err, + ArgParser, +) + + +TAG_START = '%{' +TAG_END = '}' +DELIMITER = '/' + + +class Templater(object): + def __init__(self, base_file, template_file, output_file): + self.template_file = template_file + self.output_file = output_file + self.base = self.load_yaml(base_file) + + def is_url(self, filespec): + regex = re.compile('^([^/:]+)://') + return re.search(regex, filespec) + + def load_template(self, filespec): + try: + if(self.is_url(filespec)): + response = urllib2.urlopen(filespec) + return response.read() + else: + with io.open(filespec) as f: + return f.readlines() + except Exception as error: + err('Error opening template file: %s' % error) + + def load_yaml(self, filespec): + try: + if(self.is_url(filespec)): + response = urllib2.urlopen(filespec) + return yaml.load(response) + else: + with io.open(filespec) as f: + return yaml.load(f) + except Exception as error: + err('Error opening YAML file: %s' % error) + + def save_yaml(self, filename, content): + try: + with io.open(filename, 'w') as yaml_file: + yaml_file.write(content) + except Exception as error: + err('Error writing YAML file: %s' % error) + + def get_indent(self, line): + return len(line) - len(line.lstrip(' ')) + + def format_fragment(self, fragment, indent): + result = '' + is_first_line = True + + for line in fragment.splitlines(): + # Skip indenting the first line as it is already indented + if is_first_line: + line += '\n' + is_first_line = False + else: + line = ' ' * indent + line + '\n' + + result += line + + return result.rstrip('\n') + + def format_substitution(self, string): + if isinstance(string, basestring): + return string + else: + return yaml.dump(string, default_flow_style=False) + + def parse_interface_tag(self, tag): + # Remove 'interface(' prefix, trailing ')' and split arguments + args = tag[len('interface('):].rstrip(')').split(',') + + if len(args) == 1 and not args[0]: + err('No arguments for interface().') + elif len(args) == 2 and (not args[0] or not args[1]): + err('Empty argument for interface().') + elif len(args) > 2: + err('Too many arguments for interface().') + else: + return args + + def get_interface_from_network(self, interfaces, network): + nics = self.base[interfaces] + for nic in nics: + if network in nics[nic]: + return nic + + err('Network not found: %s' % network) + + def get_role_interfaces(self, role): + nodes = self.base['nodes'] + for node in nodes: + if role in node['role']: + return node['interfaces'] + + err('Role not found: %s' % role) + + def lookup_interface(self, args): + nodes = self.base['nodes'] + + if len(args) == 1: + interfaces = nodes[0]['interfaces'] + if len(args) == 2: + interfaces = self.get_role_interfaces(args[1]) + + return self.get_interface_from_network(interfaces, args[0]) + + def parse_include_tag(self, tag): + # Remove 'include(' prefix and trailing ')' + filename = tag[len('include('):].rstrip(')') + + if not filename: + err('No argument for include().') + + return filename + + def include_file(self, filename): + fragment = self.load_yaml(filename) + return yaml.dump(fragment, default_flow_style=False) + + def parse_tag(self, tag, indent): + fragment = '' + + if 'interface(' in tag: + args = self.parse_interface_tag(tag) + fragment = self.lookup_interface(args) + elif 'include(' in tag: + filename = self.parse_include_tag(tag) + fragment = self.include_file(filename) + else: + path = tag.split(DELIMITER) + fragment = self.base + for i in path: + if i in fragment: + fragment = fragment.get(i) + else: + err('Error: key "%s" does not exist in base YAML file' % i) + + fragment = self.format_substitution(fragment) + + return self.format_fragment(fragment, indent) + + def run(self): + result = '' + + regex = re.compile(re.escape(TAG_START) + r'([a-z].+)' + re.escape(TAG_END), + flags=re.IGNORECASE) + for line in self.load_template(self.template_file): + indent = self.get_indent(line) + result += re.sub(regex, + lambda match: self.parse_tag(match.group(1), indent), + line) + + self.save_yaml(self.output_file, result) + + +def parse_arguments(): + description = '''Process 'template_file' using 'base_file' as source for +template variable substitution and write the results to 'output_file'.''' + + parser = ArgParser(prog='python %s' % __file__, + description=description) + parser.add_argument('base_file', + help='Base YAML file or URL') + parser.add_argument('template_file', + help='Template file or URL') + parser.add_argument('output_file', + help='Output filename') + + args = parser.parse_args() + return(args.base_file, args.template_file, args.output_file) + + +def main(): + base_file, template_file, output_file = parse_arguments() + + templater = Templater(base_file, template_file, output_file) + templater.run() + + +if __name__ == '__main__': + main() diff --git a/deploy/templates/ericsson/virtual_environment/noha/networks/fuel1.xml b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel1.xml new file mode 100644 index 000000000..7b2b15423 --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel1.xml @@ -0,0 +1,12 @@ + + fuel1 + + + + + + + + + + diff --git a/deploy/templates/ericsson/virtual_environment/noha/networks/fuel2.xml b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel2.xml new file mode 100644 index 000000000..615c92094 --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel2.xml @@ -0,0 +1,5 @@ + + fuel2 + + + diff --git a/deploy/templates/ericsson/virtual_environment/noha/networks/fuel3.xml b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel3.xml new file mode 100644 index 000000000..2383e6c1f --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel3.xml @@ -0,0 +1,5 @@ + + fuel3 + + + diff --git a/deploy/templates/ericsson/virtual_environment/noha/networks/fuel4.xml b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel4.xml new file mode 100644 index 000000000..5b69f912d --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/networks/fuel4.xml @@ -0,0 +1,12 @@ + + fuel4 + + + + + + + + + + diff --git a/deploy/templates/ericsson/virtual_environment/noha/vms/compute.xml b/deploy/templates/ericsson/virtual_environment/noha/vms/compute.xml new file mode 100644 index 000000000..310ce292a --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/vms/compute.xml @@ -0,0 +1,91 @@ + + compute + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/ericsson/virtual_environment/noha/vms/controller.xml b/deploy/templates/ericsson/virtual_environment/noha/vms/controller.xml new file mode 100644 index 000000000..d0d0ef14c --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/vms/controller.xml @@ -0,0 +1,91 @@ + + controller + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/ericsson/virtual_environment/noha/vms/fuel.xml b/deploy/templates/ericsson/virtual_environment/noha/vms/fuel.xml new file mode 100644 index 000000000..223a65805 --- /dev/null +++ b/deploy/templates/ericsson/virtual_environment/noha/vms/fuel.xml @@ -0,0 +1,93 @@ + + fuel + 2097152 + 2097152 + 2 + + /machine + + + hvm + + + + + + + + + + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/hardware_environment/vms/ericsson_montreal_lab/fuel.xml b/deploy/templates/hardware_environment/vms/ericsson_montreal_lab/fuel.xml new file mode 100644 index 000000000..fe547b811 --- /dev/null +++ b/deploy/templates/hardware_environment/vms/ericsson_montreal_lab/fuel.xml @@ -0,0 +1,91 @@ + + fuel + 8290304 + 8290304 + 4 + + /machine + + + hvm + + + + + + + + + + + SandyBridge + + + + + + + destroy + restart + restart + + + + + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + system_u:object_r:svirt_image_t:s0:c52,c932 + + diff --git a/deploy/templates/hardware_environment/vms/fuel.xml b/deploy/templates/hardware_environment/vms/fuel.xml new file mode 100644 index 000000000..8d8dd4494 --- /dev/null +++ b/deploy/templates/hardware_environment/vms/fuel.xml @@ -0,0 +1,91 @@ + + fuel + 8290304 + 8290304 + 4 + + /machine + + + hvm + + + + + + + + + + + SandyBridge + + + + + + + destroy + restart + restart + + + + + + /usr/libexec/qemu-kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + system_u:object_r:svirt_image_t:s0:c52,c932 + + diff --git a/deploy/templates/intel/virtual_environment/noha/networks/fuel1.xml b/deploy/templates/intel/virtual_environment/noha/networks/fuel1.xml new file mode 100644 index 000000000..7b2b15423 --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/networks/fuel1.xml @@ -0,0 +1,12 @@ + + fuel1 + + + + + + + + + + diff --git a/deploy/templates/intel/virtual_environment/noha/networks/fuel2.xml b/deploy/templates/intel/virtual_environment/noha/networks/fuel2.xml new file mode 100644 index 000000000..615c92094 --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/networks/fuel2.xml @@ -0,0 +1,5 @@ + + fuel2 + + + diff --git a/deploy/templates/intel/virtual_environment/noha/networks/fuel3.xml b/deploy/templates/intel/virtual_environment/noha/networks/fuel3.xml new file mode 100644 index 000000000..2383e6c1f --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/networks/fuel3.xml @@ -0,0 +1,5 @@ + + fuel3 + + + diff --git a/deploy/templates/intel/virtual_environment/noha/networks/fuel4.xml b/deploy/templates/intel/virtual_environment/noha/networks/fuel4.xml new file mode 100644 index 000000000..5b69f912d --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/networks/fuel4.xml @@ -0,0 +1,12 @@ + + fuel4 + + + + + + + + + + diff --git a/deploy/templates/intel/virtual_environment/noha/vms/compute.xml b/deploy/templates/intel/virtual_environment/noha/vms/compute.xml new file mode 100644 index 000000000..310ce292a --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/vms/compute.xml @@ -0,0 +1,91 @@ + + compute + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/intel/virtual_environment/noha/vms/controller.xml b/deploy/templates/intel/virtual_environment/noha/vms/controller.xml new file mode 100644 index 000000000..d0d0ef14c --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/vms/controller.xml @@ -0,0 +1,91 @@ + + controller + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/intel/virtual_environment/noha/vms/fuel.xml b/deploy/templates/intel/virtual_environment/noha/vms/fuel.xml new file mode 100644 index 000000000..b8af5a633 --- /dev/null +++ b/deploy/templates/intel/virtual_environment/noha/vms/fuel.xml @@ -0,0 +1,93 @@ + + fuel + 2097152 + 2097152 + 2 + + /machine + + + hvm + + + + + + + + + + + SandyBridge + Intel + + + + + + + + + + + + + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/plugins/.gitkeep b/deploy/templates/plugins/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/templates/templater/base_dea_template.yaml b/deploy/templates/templater/base_dea_template.yaml new file mode 100644 index 000000000..bdc1b2684 --- /dev/null +++ b/deploy/templates/templater/base_dea_template.yaml @@ -0,0 +1,24 @@ +############################################################################## +# Copyright (c) 2015, 2016 Ericsson AB and others. +# jonas.bjurel@ericsson.com +# peter.barabas@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +dea-base-config-metadata: + title: 'Deployment Environment Adapter Base configuration' + # DEA API version supported + version: '0.4' + created: 'Fri Jun 10 2016' + comment: 'Rebased for Fuel 9' +environment: + net_segment_type: %{network/networking_parameters/segmentation_type} +fuel: + FUEL_ACCESS: + %{fuel/FUEL_ACCESS} +wanted_release: %{wanted_release} +settings: + %{settings} diff --git a/deploy/templates/virtual_environment/networks/fuel1.xml b/deploy/templates/virtual_environment/networks/fuel1.xml new file mode 100644 index 000000000..7b2b15423 --- /dev/null +++ b/deploy/templates/virtual_environment/networks/fuel1.xml @@ -0,0 +1,12 @@ + + fuel1 + + + + + + + + + + diff --git a/deploy/templates/virtual_environment/networks/fuel2.xml b/deploy/templates/virtual_environment/networks/fuel2.xml new file mode 100644 index 000000000..558788664 --- /dev/null +++ b/deploy/templates/virtual_environment/networks/fuel2.xml @@ -0,0 +1,6 @@ + + fuel2 + + + + diff --git a/deploy/templates/virtual_environment/networks/fuel3.xml b/deploy/templates/virtual_environment/networks/fuel3.xml new file mode 100644 index 000000000..2383e6c1f --- /dev/null +++ b/deploy/templates/virtual_environment/networks/fuel3.xml @@ -0,0 +1,5 @@ + + fuel3 + + + diff --git a/deploy/templates/virtual_environment/networks/fuel4.xml b/deploy/templates/virtual_environment/networks/fuel4.xml new file mode 100644 index 000000000..5b69f912d --- /dev/null +++ b/deploy/templates/virtual_environment/networks/fuel4.xml @@ -0,0 +1,12 @@ + + fuel4 + + + + + + + + + + diff --git a/deploy/templates/virtual_environment/vms/compute.xml b/deploy/templates/virtual_environment/vms/compute.xml new file mode 100644 index 000000000..0bff88827 --- /dev/null +++ b/deploy/templates/virtual_environment/vms/compute.xml @@ -0,0 +1,67 @@ + + compute + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/virtual_environment/vms/controller.xml b/deploy/templates/virtual_environment/vms/controller.xml new file mode 100644 index 000000000..422aa39e2 --- /dev/null +++ b/deploy/templates/virtual_environment/vms/controller.xml @@ -0,0 +1,64 @@ + + controller + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/virtual_environment/vms/fuel.xml b/deploy/templates/virtual_environment/vms/fuel.xml new file mode 100644 index 000000000..e2a05d86e --- /dev/null +++ b/deploy/templates/virtual_environment/vms/fuel.xml @@ -0,0 +1,64 @@ + + fuel + 2097152 + 2097152 + 2 + + /machine + + + hvm + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/virtual_environment_noha/networks/fuel1.xml b/deploy/templates/virtual_environment_noha/networks/fuel1.xml new file mode 100644 index 000000000..7b2b15423 --- /dev/null +++ b/deploy/templates/virtual_environment_noha/networks/fuel1.xml @@ -0,0 +1,12 @@ + + fuel1 + + + + + + + + + + diff --git a/deploy/templates/virtual_environment_noha/networks/fuel2.xml b/deploy/templates/virtual_environment_noha/networks/fuel2.xml new file mode 100644 index 000000000..615c92094 --- /dev/null +++ b/deploy/templates/virtual_environment_noha/networks/fuel2.xml @@ -0,0 +1,5 @@ + + fuel2 + + + diff --git a/deploy/templates/virtual_environment_noha/networks/fuel3.xml b/deploy/templates/virtual_environment_noha/networks/fuel3.xml new file mode 100644 index 000000000..2383e6c1f --- /dev/null +++ b/deploy/templates/virtual_environment_noha/networks/fuel3.xml @@ -0,0 +1,5 @@ + + fuel3 + + + diff --git a/deploy/templates/virtual_environment_noha/networks/fuel4.xml b/deploy/templates/virtual_environment_noha/networks/fuel4.xml new file mode 100644 index 000000000..5b69f912d --- /dev/null +++ b/deploy/templates/virtual_environment_noha/networks/fuel4.xml @@ -0,0 +1,12 @@ + + fuel4 + + + + + + + + + + diff --git a/deploy/templates/virtual_environment_noha/vms/compute.xml b/deploy/templates/virtual_environment_noha/vms/compute.xml new file mode 100644 index 000000000..95db87984 --- /dev/null +++ b/deploy/templates/virtual_environment_noha/vms/compute.xml @@ -0,0 +1,64 @@ + + compute + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/virtual_environment_noha/vms/controller.xml b/deploy/templates/virtual_environment_noha/vms/controller.xml new file mode 100644 index 000000000..422aa39e2 --- /dev/null +++ b/deploy/templates/virtual_environment_noha/vms/controller.xml @@ -0,0 +1,64 @@ + + controller + 8388608 + 8388608 + 2 + + hvm + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/templates/virtual_environment_noha/vms/fuel.xml b/deploy/templates/virtual_environment_noha/vms/fuel.xml new file mode 100644 index 000000000..e9d454530 --- /dev/null +++ b/deploy/templates/virtual_environment_noha/vms/fuel.xml @@ -0,0 +1,65 @@ + + fuel + 2097152 + 2097152 + 2 + + /machine + + + hvm + + + + + + + + + + + destroy + restart + restart + + /usr/bin/kvm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deploy/transplant_fuel_settings.py b/deploy/transplant_fuel_settings.py new file mode 100644 index 000000000..993b0dcce --- /dev/null +++ b/deploy/transplant_fuel_settings.py @@ -0,0 +1,116 @@ +############################################################################### +# Copyright (c) 2015 Ericsson AB and others. +# szilard.cserey@ericsson.com +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################### + + +import sys +import io +import yaml +import re +import os +from dea import DeploymentEnvironmentAdapter + +from common import ( + check_file_exists, + exec_cmd, + log, +) + +ASTUTE_YAML = '/etc/fuel/astute.yaml' +FUEL_BOOTSTRAP_CLI_YAML = '/opt/opnfv/fuel_bootstrap_cli.yaml' + + +def usage(): + print ''' + Usage: + python transplant_fuel_settings.py + ''' + + +def parse_arguments(): + if len(sys.argv) != 2: + usage() + sys.exit(1) + dea_file = sys.argv[-1] + check_file_exists(dea_file) + return dea_file + +def write_ifcfg_file(key, fuel_conf): + config = ('BOOTPROTO=none\n' + 'ONBOOT=yes\n' + 'TYPE=Ethernet\n' + 'NM_CONTROLLED=yes\n') + for skey in ('ipaddress', 'device', 'netmask', 'gateway'): + if not fuel_conf[key].get(skey): + log('Warning: missing key %s for %s' % (skey, key)) + config += '%s=\n' % skey.upper() + elif skey == 'ipaddress': + config += 'IPADDR=%s\n' % fuel_conf[key][skey] + else: + config += '%s=%s\n' % (skey.upper(), fuel_conf[key][skey]) + + fname = os.path.join('/etc/sysconfig/network-scripts/', + key.lower().replace('_','-')) + with open(fname, 'wc') as f: + f.write(config) + +def transplant(dea, astute): + fuel_conf = dea.get_fuel_config() + require_network_restart = False + for key in fuel_conf.iterkeys(): + if key == 'ADMIN_NETWORK': + for skey in fuel_conf[key].iterkeys(): + astute[key][skey] = fuel_conf[key][skey] + elif re.match('^IFCFG', key): + log('Adding interface configuration for: %s' % key.lower()) + require_network_restart = True + write_ifcfg_file(key, fuel_conf) + if astute.has_key(key): + astute.pop(key, None) + else: + astute[key] = fuel_conf[key] + if require_network_restart: + admin_ifcfg = '/etc/sysconfig/network-scripts/ifcfg-eth0' + exec_cmd('echo "DEFROUTE=no" >> %s' % admin_ifcfg) + log('At least one interface was reconfigured, restart network manager') + exec_cmd('systemctl restart network') + return astute + + +def transplant_bootstrap(astute, fuel_bootstrap_cli): + if 'BOOTSTRAP' in astute: + for skey in astute['BOOTSTRAP'].iterkeys(): + # FIXME: astute.yaml repos point to public ones instead of + # local mirrors, this filter should be removed when in sync + if skey != 'repos': + fuel_bootstrap_cli[skey] = astute['BOOTSTRAP'][skey] + return fuel_bootstrap_cli + +def main(): + dea_file = parse_arguments() + check_file_exists(ASTUTE_YAML) + check_file_exists(FUEL_BOOTSTRAP_CLI_YAML) + dea = DeploymentEnvironmentAdapter(dea_file) + log('Reading astute file %s' % ASTUTE_YAML) + with io.open(ASTUTE_YAML) as stream: + astute = yaml.load(stream) + log('Initiating transplant') + transplant(dea, astute) + with io.open(ASTUTE_YAML, 'w') as stream: + yaml.dump(astute, stream, default_flow_style=False) + log('Transplant done') + # Update bootstrap config yaml with info from DEA/astute.yaml + with io.open(FUEL_BOOTSTRAP_CLI_YAML) as stream: + fuel_bootstrap_cli = yaml.load(stream) + transplant_bootstrap(astute, fuel_bootstrap_cli) + with io.open(FUEL_BOOTSTRAP_CLI_YAML, 'w') as stream: + yaml.dump(fuel_bootstrap_cli, stream, default_flow_style=False) + + +if __name__ == '__main__': + main() -- cgit 1.2.3-korg