From 440c1f1321eb06f570207506d212220661bd3a9d Mon Sep 17 00:00:00 2001 From: Josep Puigdemont Date: Fri, 17 Jun 2016 17:28:59 +0200 Subject: opnv-fuel: updated deploy patch set Change-Id: I9442f217d2f840382b40f6eae77ddb9ae2ddbadc Signed-off-by: Josep Puigdemont --- ...l-prepare-class-to-allow-multiple-bridges.patch | 81 +++++++++++++++ ...2-deploy-add-support-for-multiple-bridges.patch | 111 ++++++++++++++++++++ .../0003-deploy.sh-accept-a-timeout-flag-T.patch | 86 ++++++++++++++++ .../0004-Fuel-VM-for-the-Enea-Armband-lab.patch | 111 ++++++++++++++++++++ ...ant-Generate-extra-interfaces-config-file.patch | 112 +++++++++++++++++++++ .../0006-deploy.sh-no-need-to-set-umask-0000.patch | 38 +++++++ .../opnfv-fuel/0007-Remove-check-for-root.patch | 85 ++++++++++++++++ ...l-add-XML-tree-as-attribute-of-VirtualFue.patch | 62 ------------ ...reap.py-Dump-extra-interfaces-information.patch | 95 +++++++++++++++++ ...l-prepare-class-to-allow-multiple-bridges.patch | 75 -------------- ...09-deploy.py-add-multiple-bridges-support.patch | 69 ------------- ...eploy.sh-allow-specifying-several-bridges.patch | 47 --------- .../0011-deploy.sh-accept-a-timeout-flag-T.patch | 81 --------------- .../0012-Fuel-VM-for-the-Enea-Armband-lab.patch | 106 ------------------- ...ant-Generate-extra-interfaces-config-file.patch | 107 -------------------- .../0014-deploy.sh-no-need-to-set-umask-0000.patch | 33 ------ .../opnfv-fuel/0015-Remove-check-for-root.patch | 80 --------------- ...reap.py-Dump-extra-interfaces-information.patch | 88 ---------------- 18 files changed, 719 insertions(+), 748 deletions(-) create mode 100644 patches/opnfv-fuel/0001-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch create mode 100644 patches/opnfv-fuel/0002-deploy-add-support-for-multiple-bridges.patch create mode 100644 patches/opnfv-fuel/0003-deploy.sh-accept-a-timeout-flag-T.patch create mode 100644 patches/opnfv-fuel/0004-Fuel-VM-for-the-Enea-Armband-lab.patch create mode 100644 patches/opnfv-fuel/0005-transplant-Generate-extra-interfaces-config-file.patch create mode 100644 patches/opnfv-fuel/0006-deploy.sh-no-need-to-set-umask-0000.patch create mode 100644 patches/opnfv-fuel/0007-Remove-check-for-root.patch delete mode 100644 patches/opnfv-fuel/0007-virtual_fuel-add-XML-tree-as-attribute-of-VirtualFue.patch create mode 100644 patches/opnfv-fuel/0008-deploy-reap.py-Dump-extra-interfaces-information.patch delete mode 100644 patches/opnfv-fuel/0008-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch delete mode 100644 patches/opnfv-fuel/0009-deploy.py-add-multiple-bridges-support.patch delete mode 100644 patches/opnfv-fuel/0010-deploy.sh-allow-specifying-several-bridges.patch delete mode 100644 patches/opnfv-fuel/0011-deploy.sh-accept-a-timeout-flag-T.patch delete mode 100644 patches/opnfv-fuel/0012-Fuel-VM-for-the-Enea-Armband-lab.patch delete mode 100644 patches/opnfv-fuel/0013-transplant-Generate-extra-interfaces-config-file.patch delete mode 100644 patches/opnfv-fuel/0014-deploy.sh-no-need-to-set-umask-0000.patch delete mode 100644 patches/opnfv-fuel/0015-Remove-check-for-root.patch delete mode 100644 patches/opnfv-fuel/0018-deploy-reap.py-Dump-extra-interfaces-information.patch (limited to 'patches') diff --git a/patches/opnfv-fuel/0001-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch b/patches/opnfv-fuel/0001-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch new file mode 100644 index 00000000..63a4a706 --- /dev/null +++ b/patches/opnfv-fuel/0001-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch @@ -0,0 +1,81 @@ +From 2a9e72d95200161ec27e8f199a76c6ec1f88bff1 Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Fri, 20 May 2016 10:23:45 +0200 +Subject: [PATCH] virtual_fuel: prepare class to allow multiple bridges + +The VirtualFuel class has now two new methods: + + del_vm_nics: Deletes all interfaces from the VM. + + add_vm_nic: Adds a NIC to the VM, attached to the specified bridge. + +The following method has been deleted: + + set_vm_nic: implemented with the two new methods + +Apart from the deleted method, no functionality has been changed. + +This is just a small but necessary step towards adding support for +configuring more than one NIC in the fuel VM. + +Change-Id: I9f02c8163dfb9768510e78d5d5e77a0bb43306fb +Signed-off-by: Josep Puigdemont +--- + deploy/environments/virtual_fuel.py | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py +index 2fac98b..5a86c97 100644 +--- a/deploy/environments/virtual_fuel.py ++++ b/deploy/environments/virtual_fuel.py +@@ -67,22 +67,25 @@ class VirtualFuel(ExecutionEnvironment): + with open(self.temp_vm_file, "wc") as f: + self.vm_xml.write(f, pretty_print=True, xml_declaration=True) + +- def set_vm_nic(self): ++ 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', self.pxe_bridge) ++ 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) +- +- self.update_vm_template_file() ++ 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' % +@@ -121,11 +124,13 @@ class VirtualFuel(ExecutionEnvironment): + disk_size = disk_sizes['fuel'] + disk_path = self.create_image(disk_path, disk_size) + +- temp_vm_file = '%s/%s' % (self.temp_dir, self.vm_name) +- exec_cmd('cp %s %s' % (self.vm_template, temp_vm_file)) +- self.set_vm_nic() ++ self.del_vm_nics() ++ self.add_vm_nic(self.pxe_bridge) ++ self.update_vm_template_file() ++ + vm_definition_overwrite = self.dha.get_vm_definition('fuel') +- self.define_vm(self.vm_name, temp_vm_file, disk_path, ++ ++ self.define_vm(self.vm_name, self.temp_vm_file, disk_path, + vm_definition_overwrite) + + def setup_environment(self): +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0002-deploy-add-support-for-multiple-bridges.patch b/patches/opnfv-fuel/0002-deploy-add-support-for-multiple-bridges.patch new file mode 100644 index 00000000..379fc57a --- /dev/null +++ b/patches/opnfv-fuel/0002-deploy-add-support-for-multiple-bridges.patch @@ -0,0 +1,111 @@ +From dfc83244874060c4052bc3d29c256fa1bd52687d Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Fri, 6 May 2016 04:32:06 +0200 +Subject: [PATCH] deploy: add support for multiple bridges + +deploy.py: +Some Fuel VMs may need more than one network interface. To be able to +provide that, we now allow the user to specify the "-b" paramter +(bridge) multiple times, creating a new NIC for each one of them. + +The NICs are created in the same order as they are given in the command +line. + +There is no change in behavior from earlier versions, pxebr will still +be the default bridge if none is specified in the command line. + +deploy.sh: +To reflect the new capabilities of deploy.py, we introduce the +possibility to specify -B more than once in deploy.sh, and honor that +when calling deploy.py. We also make it possible to specify a comma +separated list of bridges, as in: -B br1,br2. + +Change-Id: I1a0100f2cfe755ec6adfeedafb391c2357f46f51 +Signed-off-by: Josep Puigdemont +--- + ci/deploy.sh | 11 +++++++---- + deploy/deploy.py | 10 +++++++--- + deploy/environments/virtual_fuel.py | 3 ++- + 3 files changed, 16 insertions(+), 8 deletions(-) + +diff --git a/ci/deploy.sh b/ci/deploy.sh +index c7a1d18..4e4586c 100755 +--- a/ci/deploy.sh ++++ b/ci/deploy.sh +@@ -58,7 +58,10 @@ and provides a fairly simple mechanism to execute a deployment. + Input parameters to the build script is: + -b Base URI to the configuration directory (needs to be provided in a URI + style, it can be a local resource: file:// or a remote resource http(s)://) +--B PXE Bridge for booting of Fuel master, default is pxebr ++-B PXE Bridge for booting of Fuel master. It can be specified several times, ++ or as a comma separated list of bridges, or both: -B br1 -B br2,br3 ++ One NIC connected to each specified bridge will be created in the Fuel VM, ++ in the same order as provided in the command line. The default is pxebr. + -d Dry-run - Produces deploy config files (config/dea.yaml and + config/dha.yaml), but does not execute deploy + -f Deploy on existing Fuel master +@@ -135,9 +138,9 @@ do + fi + ;; + B) +- if [[ ${OPTARG} ]]; then +- PXE_BRIDGE="-b ${OPTARG}" +- fi ++ for bridge in ${OPTARG//,/ }; do ++ PXE_BRIDGE+=" -b $bridge" ++ done + ;; + d) + DRY_RUN=1 +diff --git a/deploy/deploy.py b/deploy/deploy.py +index 8064af9..56e5bd5 100755 +--- a/deploy/deploy.py ++++ b/deploy/deploy.py +@@ -318,8 +318,8 @@ def parse_arguments(): + 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='store', +- default='pxebr', ++ 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', +@@ -341,6 +341,9 @@ def parse_arguments(): + 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)) +@@ -355,7 +358,8 @@ def parse_arguments(): + check_file_exists(iso_abs_path) + log('Using image directory: %s' % args.storage_dir) + create_dir_if_not_exists(args.storage_dir) +- check_bridge(args.pxe_bridge, args.dha_file) ++ for bridge in args.pxe_bridge: ++ check_bridge(bridge, args.dha_file) + + + kwargs = {'no_fuel': args.no_fuel, 'fuel_only': args.fuel_only, +diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py +index 5a86c97..b1a76e4 100644 +--- a/deploy/environments/virtual_fuel.py ++++ b/deploy/environments/virtual_fuel.py +@@ -125,7 +125,8 @@ class VirtualFuel(ExecutionEnvironment): + disk_path = self.create_image(disk_path, disk_size) + + self.del_vm_nics() +- self.add_vm_nic(self.pxe_bridge) ++ 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') +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0003-deploy.sh-accept-a-timeout-flag-T.patch b/patches/opnfv-fuel/0003-deploy.sh-accept-a-timeout-flag-T.patch new file mode 100644 index 00000000..641891bb --- /dev/null +++ b/patches/opnfv-fuel/0003-deploy.sh-accept-a-timeout-flag-T.patch @@ -0,0 +1,86 @@ +From 0ca4dada5b3528c84f2edcb7f1a2df8f0a18779d Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Mon, 9 May 2016 11:05:58 +0200 +Subject: [PATCH] deploy.sh: accept a timeout flag (-T) + +Change-Id: I58a7b9bc639bb03b994ea34fc317f5679140d9fd +Signed-off-by: Josep Puigdemont +--- + ci/deploy.sh | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +diff --git a/ci/deploy.sh b/ci/deploy.sh +index 4e4586c..8411714 100755 +--- a/ci/deploy.sh ++++ b/ci/deploy.sh +@@ -29,7 +29,7 @@ cat << EOF + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + `basename $0`: Deploys the Fuel@OPNFV stack + +-usage: `basename $0` -b base-uri [-B PXE Bridge] [-f] [-F] [-H] -l lab-name -p pod-name -s deploy-scenario [-S image-dir] -i iso ++usage: `basename $0` -b base-uri [-B PXE Bridge] [-f] [-F] [-H] -l lab-name -p pod-name -s deploy-scenario [-S image-dir] [-T timeout] -i iso + -s deployment-scenario [-S optional Deploy-scenario path URI] + [-R optional local relen repo (containing deployment Scenarios] + +@@ -47,6 +47,7 @@ OPTIONS: + -p Pod-name + -s Deploy-scenario short-name/base-file-name + -S Storage dir for VM images ++ -T Timeout, in minutes, for the deploy. + -i iso url + + Description: +@@ -78,6 +79,8 @@ Input parameters to the build script is: + or a deployment short-name as defined by scenario.yaml in the deployment + scenario path. + -S Storage dir for VM images, default is fuel/deploy/images ++-T Timeout, in minutes, for the deploy. It defaults to using the DEPLOY_TIMEOUT ++ environment variable when defined, or to the default in deploy.py otherwise + -i .iso image to be deployed (needs to be provided in a URI + style, it can be a local resource: file:// or a remote resource http(s)://) + +@@ -116,6 +119,11 @@ FUEL_CREATION_ONLY='' + NO_DEPLOY_ENVIRONMENT='' + STORAGE_DIR='' + DRY_RUN=0 ++if ! [ -z $DEPLOY_TIMEOUT ]; then ++ DEPLOY_TIMEOUT="-dt $DEPLOY_TIMEOUT" ++else ++ DEPLOY_TIMEOUT="" ++fi + # + # END of variables to customize + ############################################################################ +@@ -123,7 +131,7 @@ DRY_RUN=0 + ############################################################################ + # BEGIN of main + # +-while getopts "b:B:dfFHl:L:p:s:S:i:he" OPTION ++while getopts "b:B:dfFHl:L:p:s:S:T:i:he" OPTION + do + case $OPTION in + b) +@@ -174,6 +182,9 @@ do + STORAGE_DIR="-s ${OPTARG}" + fi + ;; ++ T) ++ DEPLOY_TIMEOUT="-dt ${OPTARG}" ++ ;; + i) + ISO=${OPTARG} + if [[ ! $ISO == file://* ]] && \ +@@ -243,8 +254,8 @@ if [ $DRY_RUN -eq 0 ]; then + ISO=${SCRIPT_PATH}/ISO/image.iso + fi + # Start deployment +- echo "python deploy.py $DEPLOY_LOG $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO" +- python deploy.py $DEPLOY_LOG $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO ++ echo "python deploy.py $DEPLOY_LOG $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO $DEPLOY_TIMEOUT" ++ python deploy.py $DEPLOY_LOG $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO $DEPLOY_TIMEOUT + fi + popd > /dev/null + +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0004-Fuel-VM-for-the-Enea-Armband-lab.patch b/patches/opnfv-fuel/0004-Fuel-VM-for-the-Enea-Armband-lab.patch new file mode 100644 index 00000000..224d8da8 --- /dev/null +++ b/patches/opnfv-fuel/0004-Fuel-VM-for-the-Enea-Armband-lab.patch @@ -0,0 +1,111 @@ +From 800aae6db0d0d79d01cec4df85075026073063dd Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Wed, 4 May 2016 14:27:23 +0200 +Subject: [PATCH] Fuel VM for the Enea Armband lab + +This is the initial VM description fit for Enea's Armband lab. + +Change-Id: Ia89f9728fff0ab1c279f6200fd558d9643cf4ea5 +Signed-off-by: Josep Puigdemont +--- + .../hardware_environment/vms/enea_lab/fuel.xml | 88 ++++++++++++++++++++++ + 1 file changed, 88 insertions(+) + create mode 100644 deploy/templates/hardware_environment/vms/enea_lab/fuel.xml + +diff --git a/deploy/templates/hardware_environment/vms/enea_lab/fuel.xml b/deploy/templates/hardware_environment/vms/enea_lab/fuel.xml +new file mode 100644 +index 0000000..8773ed4 +--- /dev/null ++++ b/deploy/templates/hardware_environment/vms/enea_lab/fuel.xml +@@ -0,0 +1,88 @@ ++ ++ fuel ++ 8290304 ++ 8290304 ++ 8 ++ ++ /machine ++ ++ ++ hvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ destroy ++ restart ++ restart ++ ++ ++ ++ ++ ++ /usr/libexec/qemu-kvm ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0005-transplant-Generate-extra-interfaces-config-file.patch b/patches/opnfv-fuel/0005-transplant-Generate-extra-interfaces-config-file.patch new file mode 100644 index 00000000..2c8587a5 --- /dev/null +++ b/patches/opnfv-fuel/0005-transplant-Generate-extra-interfaces-config-file.patch @@ -0,0 +1,112 @@ +From 7dad9f8350e8563942f4e9ffae595bbfe44e606d Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Wed, 4 May 2016 17:58:56 +0200 +Subject: [PATCH] transplant: Generate extra interfaces config file + +The DEA override may contain a IFCGF_ section in its 'fuel:' +section, containing the necessary keys to produce a ifcfg- +file, like in this example: + +fuel: + IFCFG_ETH1: + device: eth1 + ipaddress: 10.0.1.10 + netmask: 255.255.255.0 + gateway: 10.0.1.254 + +FIXME: In order for Network Manager to use the newly added interfaces +for outgoing traffic and honor their GATEWAY setting (e.g. if we just +added one public interface), the default route on admin iface (most of +the time called eth0) should be disabled. For now, we assume the admin +interface is always "eth0". + +Change-Id: I0457dc9a0d49e46b8ca85cfe7a4435c2b15f5238 +Signed-off-by: Josep Puigdemont +Signed-off-by: Alexandu Avadanii +--- + deploy/transplant_fuel_settings.py | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/deploy/transplant_fuel_settings.py b/deploy/transplant_fuel_settings.py +index e57a4fb..9a65cf6 100644 +--- a/deploy/transplant_fuel_settings.py ++++ b/deploy/transplant_fuel_settings.py +@@ -11,10 +11,14 @@ + 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' +@@ -35,15 +39,45 @@ def parse_arguments(): + 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 + + +@@ -51,11 +85,14 @@ def main(): + dea_file = parse_arguments() + check_file_exists(ASTUTE_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') + + + if __name__ == '__main__': +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0006-deploy.sh-no-need-to-set-umask-0000.patch b/patches/opnfv-fuel/0006-deploy.sh-no-need-to-set-umask-0000.patch new file mode 100644 index 00000000..9c005907 --- /dev/null +++ b/patches/opnfv-fuel/0006-deploy.sh-no-need-to-set-umask-0000.patch @@ -0,0 +1,38 @@ +From f67625ce6c607b47bc99c5118f5e52fe8a8e763b Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Fri, 6 May 2016 03:07:40 +0200 +Subject: [PATCH] deploy.sh: no need to set umask 0000 + +Change-Id: If3283a16139097db57b06c0535d33a88dc1b2ed2 +Signed-off-by: Josep Puigdemont +--- + ci/deploy.sh | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/ci/deploy.sh b/ci/deploy.sh +index 8411714..c08a94b 100755 +--- a/ci/deploy.sh ++++ b/ci/deploy.sh +@@ -84,9 +84,6 @@ Input parameters to the build script is: + -i .iso image to be deployed (needs to be provided in a URI + style, it can be a local resource: file:// or a remote resource http(s)://) + +-NOTE: Root priviledges are needed for this script to run +- +- + Examples: + sudo `basename $0` -b file:///home/jenkins/lab-config -l lf -p pod1 -s ha_odl-l3_heat_ceilometer -i file:///home/jenkins/myiso.iso + EOF +@@ -231,9 +228,6 @@ fi + # Enable the automatic exit trap + trap do_exit SIGINT SIGTERM EXIT + +-# Set no restrictive umask so that Jenkins can removeeee any residuals +-umask 0000 +- + clean + + pushd ${DEPLOY_DIR} > /dev/null +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0007-Remove-check-for-root.patch b/patches/opnfv-fuel/0007-Remove-check-for-root.patch new file mode 100644 index 00000000..2282f59d --- /dev/null +++ b/patches/opnfv-fuel/0007-Remove-check-for-root.patch @@ -0,0 +1,85 @@ +From b7d5f0ca9a76de6d99fc5d6f5cbb8df864c62b7b Mon Sep 17 00:00:00 2001 +From: Josep Puigdemont +Date: Wed, 4 May 2016 14:27:23 +0200 +Subject: [PATCH] Remove check for root + +Change-Id: Ic6bfaf07c0d9d347aec2df8724184d0314665503 +Signed-off-by: Josep Puigdemont +--- + ci/deploy.sh | 5 ----- + deploy/deploy-config.py | 1 - + deploy/deploy.py | 2 -- + deploy/environments/virtual_fuel.py | 2 -- + 4 files changed, 10 deletions(-) + +diff --git a/ci/deploy.sh b/ci/deploy.sh +index c08a94b..081806c 100755 +--- a/ci/deploy.sh ++++ b/ci/deploy.sh +@@ -209,11 +209,6 @@ do + esac + done + +-if [[ $EUID -ne 0 ]]; then +- echo "This script must be run as root" 1>&2 +- exit 1 +-fi +- + if [ -z $BASE_CONFIG_URI ] || [ -z $TARGET_LAB ] || \ + [ -z $TARGET_POD ] || [ -z $DEPLOY_SCENARIO ] || \ + [ -z $ISO ]; then +diff --git a/deploy/deploy-config.py b/deploy/deploy-config.py +index 65d51b2..88a1111 100644 +--- a/deploy/deploy-config.py ++++ b/deploy/deploy-config.py +@@ -40,7 +40,6 @@ from common import ( + check_file_exists, + create_dir_if_not_exists, + delete, +- check_if_root, + ArgParser, + ) + +diff --git a/deploy/deploy.py b/deploy/deploy.py +index 56e5bd5..a021e28 100755 +--- a/deploy/deploy.py ++++ b/deploy/deploy.py +@@ -33,7 +33,6 @@ from common import ( + check_dir_exists, + create_dir_if_not_exists, + delete, +- check_if_root, + ArgParser, + ) + +@@ -234,7 +233,6 @@ class AutoDeploy(object): + return 0 + + def run(self): +- check_if_root() + if self.cleanup_only: + self.cleanup_execution_environment() + else: +diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py +index b1a76e4..4ff68f6 100644 +--- a/deploy/environments/virtual_fuel.py ++++ b/deploy/environments/virtual_fuel.py +@@ -18,7 +18,6 @@ import time + from common import ( + exec_cmd, + check_file_exists, +- check_if_root, + delete, + log, + ) +@@ -135,7 +134,6 @@ class VirtualFuel(ExecutionEnvironment): + vm_definition_overwrite) + + def setup_environment(self): +- check_if_root() + self.cleanup_environment() + self.create_vm() + +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0007-virtual_fuel-add-XML-tree-as-attribute-of-VirtualFue.patch b/patches/opnfv-fuel/0007-virtual_fuel-add-XML-tree-as-attribute-of-VirtualFue.patch deleted file mode 100644 index 53e1a8db..00000000 --- a/patches/opnfv-fuel/0007-virtual_fuel-add-XML-tree-as-attribute-of-VirtualFue.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Josep Puigdemont -Date: Fri, 20 May 2016 10:05:11 +0200 -Subject: [PATCH] virtual_fuel: add XML tree as attribute of VirtualFuel - -Now the VM XML definition tree is an attribute of the object, this way -it can be used by all methods without having to re-read the file. - -Methods added: -update_vm_template_file: Flushes the contents of the in-memory XML - representation of the VM to the backing file. - -Signed-off-by: Josep Puigdemont ---- - deploy/environments/virtual_fuel.py | 21 ++++++++++++++------- - 1 file changed, 14 insertions(+), 7 deletions(-) - -diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py -index f9f9f7a..7dc9720 100644 ---- a/deploy/environments/virtual_fuel.py -+++ b/deploy/environments/virtual_fuel.py -@@ -54,14 +54,21 @@ class VirtualFuel(ExecutionEnvironment): - 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 set_vm_nic(self, temp_vm_file): -- with open(temp_vm_file) as f: -- vm_xml = etree.parse(f) -- interfaces = vm_xml.xpath('/domain/devices/interface') -+ 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 set_vm_nic(self): -+ interfaces = self.vm_xml.xpath('/domain/devices/interface') - for interface in interfaces: - interface.getparent().remove(interface) - interface = etree.Element('interface') -@@ -70,12 +77,12 @@ class VirtualFuel(ExecutionEnvironment): - source.set('bridge', self.pxe_bridge) - model = etree.SubElement(interface, 'model') - model.set('type', 'virtio') -- devices = vm_xml.xpath('/domain/devices') -+ devices = self.vm_xml.xpath('/domain/devices') - if devices: - device = devices[0] - device.append(interface) -- with open(temp_vm_file, 'w') as f: -- vm_xml.write(f, pretty_print=True, xml_declaration=True) -+ -+ self.update_vm_template_file() - - def create_volume(self, pool, name, su, img_type='qcow2'): - log('Creating image using Libvirt volumes in pool %s, name: %s' % diff --git a/patches/opnfv-fuel/0008-deploy-reap.py-Dump-extra-interfaces-information.patch b/patches/opnfv-fuel/0008-deploy-reap.py-Dump-extra-interfaces-information.patch new file mode 100644 index 00000000..7cb759e1 --- /dev/null +++ b/patches/opnfv-fuel/0008-deploy-reap.py-Dump-extra-interfaces-information.patch @@ -0,0 +1,95 @@ +From e8232eca62d67c2bac1d34f5b2adfeba1a580634 Mon Sep 17 00:00:00 2001 +From: Alexandru Avadanii +Date: Wed, 4 May 2016 18:31:09 +0200 +Subject: [PATCH] deploy/reap.py: Dump extra interfaces information. + +Since on AArch64, Ubuntu local mirror lacks arm64 packages (see [1]), +Fuel master requires internet connectivity during deploy, and hence +a way to setup such a public (extra) interface automatically. + +Previous commit "transplant: Generate extra interfaces config file" +introduced support for passing this information via DEA (override), +which may define a IFCGF_ section in its 'fuel:' +section, containing the necessary keys to produce a ifcfg- +file, like in this example: + +fuel: + IFCFG_ETH1: + device: eth1 + ipaddress: 10.0.1.10 + netmask: 255.255.255.0 + gateway: 10.0.1.254 + +In order for Network Manager to use the newly added interfaces +for outgoing traffic and honor their GATEWAY setting (e.g. if we just +added one public interface), the default route on admin iface (most of +the time called eth0) is disabled when extra interfaces are present. + +FIXME: Only supports lowercase interface names, but so does Fuel, +see related bug report [2]. + +[1] https://jira.opnfv.org/browse/ARMBAND-35 +[2] https://jira.opnfv.org/browse/FUEL-136 + +Change-Id: I6f0a759c65a435ec8bd883a04c8d1adca109cc13 +Signed-off-by: Alexandu Avadanii +Signed-off-by: Josep Puigdemont +--- + deploy/reap.py | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/deploy/reap.py b/deploy/reap.py +index ed5bc99..9f14e35 100644 +--- a/deploy/reap.py ++++ b/deploy/reap.py +@@ -15,6 +15,8 @@ import yaml + import glob + import shutil + import tempfile ++import re ++import netaddr + + from common import ( + N, +@@ -248,6 +250,38 @@ class Reap(object): + 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: ++ (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): +-- +2.5.5 + diff --git a/patches/opnfv-fuel/0008-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch b/patches/opnfv-fuel/0008-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch deleted file mode 100644 index f2e21e24..00000000 --- a/patches/opnfv-fuel/0008-virtual_fuel-prepare-class-to-allow-multiple-bridges.patch +++ /dev/null @@ -1,75 +0,0 @@ -From: Josep Puigdemont -Date: Fri, 20 May 2016 10:23:45 +0200 -Subject: [PATCH] virtual_fuel: prepare class to allow multiple bridges - -The VirtualFuel class has now two new methods: - - del_vm_nics: Deletes all interfaces from the VM. - - add_vm_nic: Adds a NIC to the VM, attached to the specified bridge. - -The following method has been deleted: - - set_vm_nic: implemented with the two new methods - -Apart from the deleted method, no functionality has been changed. This -is just a small but necessary step towards adding support for supporting -more than one bridge in the fuel VM. - -Signed-off-by: Josep Puigdemont ---- - deploy/environments/virtual_fuel.py | 21 +++++++++++++-------- - 1 file changed, 13 insertions(+), 8 deletions(-) - -diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py -index 7dc9720..5a86c97 100644 ---- a/deploy/environments/virtual_fuel.py -+++ b/deploy/environments/virtual_fuel.py -@@ -67,22 +67,25 @@ class VirtualFuel(ExecutionEnvironment): - with open(self.temp_vm_file, "wc") as f: - self.vm_xml.write(f, pretty_print=True, xml_declaration=True) - -- def set_vm_nic(self): -+ 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', self.pxe_bridge) -+ 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) -- -- self.update_vm_template_file() -+ 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' % -@@ -121,11 +124,13 @@ class VirtualFuel(ExecutionEnvironment): - disk_size = disk_sizes['fuel'] - disk_path = self.create_image(disk_path, disk_size) - -- temp_vm_file = '%s/%s' % (self.temp_dir, self.vm_name) -- exec_cmd('cp %s %s' % (self.vm_template, temp_vm_file)) -- self.set_vm_nic(temp_vm_file) -+ self.del_vm_nics() -+ self.add_vm_nic(self.pxe_bridge) -+ self.update_vm_template_file() -+ - vm_definition_overwrite = self.dha.get_vm_definition('fuel') -- self.define_vm(self.vm_name, temp_vm_file, disk_path, -+ -+ self.define_vm(self.vm_name, self.temp_vm_file, disk_path, - vm_definition_overwrite) - - def setup_environment(self): diff --git a/patches/opnfv-fuel/0009-deploy.py-add-multiple-bridges-support.patch b/patches/opnfv-fuel/0009-deploy.py-add-multiple-bridges-support.patch deleted file mode 100644 index 6743f25c..00000000 --- a/patches/opnfv-fuel/0009-deploy.py-add-multiple-bridges-support.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Josep Puigdemont -Date: Fri, 6 May 2016 04:32:06 +0200 -Subject: [PATCH] deploy.py: add multiple bridges support - -Some Fuel VMs may need more than one network interface. To be able to do -that, we now allow the user to specify the "-b" paramter (bridge) -multiple times, creating a new NIC for each one of them. - -The NICs are created in the same order as they are given in the command -line. - -There is no change in behavior from earlier versions, pxebr will still -be the default bridge if none is specified. - -Signed-off-by: Josep Puigdemont ---- - deploy/deploy.py | 10 +++++++--- - deploy/environments/virtual_fuel.py | 3 ++- - 2 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/deploy/deploy.py b/deploy/deploy.py -index 179ee7b..9db1754 100755 ---- a/deploy/deploy.py -+++ b/deploy/deploy.py -@@ -316,8 +316,8 @@ def parse_arguments(): - 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='store', -- default='pxebr', -+ 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', -@@ -333,6 +333,9 @@ def parse_arguments(): - action='store_true', default=False, - help=('Do not launch environment deployment')) - -+ if not args.pxe_bridge: -+ args.pxe_bridge = ['pxebr'] -+ - args = parser.parse_args() - log(args) - -@@ -348,7 +351,8 @@ def parse_arguments(): - check_file_exists(iso_abs_path) - log('Using image directory: %s' % args.storage_dir) - create_dir_if_not_exists(args.storage_dir) -- check_bridge(args.pxe_bridge, args.dha_file) -+ 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, -diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py -index 5a86c97..b1a76e4 100644 ---- a/deploy/environments/virtual_fuel.py -+++ b/deploy/environments/virtual_fuel.py -@@ -125,7 +125,8 @@ class VirtualFuel(ExecutionEnvironment): - disk_path = self.create_image(disk_path, disk_size) - - self.del_vm_nics() -- self.add_vm_nic(self.pxe_bridge) -+ 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') diff --git a/patches/opnfv-fuel/0010-deploy.sh-allow-specifying-several-bridges.patch b/patches/opnfv-fuel/0010-deploy.sh-allow-specifying-several-bridges.patch deleted file mode 100644 index d3de23f6..00000000 --- a/patches/opnfv-fuel/0010-deploy.sh-allow-specifying-several-bridges.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Josep Puigdemont -Date: Fri, 6 May 2016 04:39:44 +0200 -Subject: [PATCH] deploy.sh: allow specifying several bridges - -It might be desirable to add several bridges to the fuel VM, so we let -the user specify -B more than once, and honor that when calling -deploy.py. We also make it possible to specify a comma separated list of -bridges, as in: -B br1,br2, for convenience for the Jenkins jobs. - -There is a change in behavior from the previous version, and that is -that it may call the deploy.py python script with more than one instance -of the "-b" parameter. - -Signed-off-by: Josep Puigdemont ---- - ci/deploy.sh | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/ci/deploy.sh b/ci/deploy.sh -index dc13f1c..3a95327 100755 ---- a/ci/deploy.sh -+++ b/ci/deploy.sh -@@ -57,7 +57,10 @@ and provides a fairly simple mechanism to execute a deployment. - Input parameters to the build script is: - -b Base URI to the configuration directory (needs to be provided in a URI - style, it can be a local resource: file:// or a remote resource http(s)://) ---B PXE Bridge for booting of Fuel master, default is pxebr -+-B PXE Bridge for booting of Fuel master. It can be specified several times, -+ or as a comma separated list of bridges, or both: -B br1 -B br2,br3 -+ One NIC connected to each specified bridge will be created in the Fuel VM, -+ in the same order as provided in the command line. The default is pxebr. - -d Dry-run - Produces deploy config files (config/dea.yaml and - config/dha.yaml), but does not execute deploy - -f Deploy on existing Fuel master -@@ -133,9 +136,9 @@ do - fi - ;; - B) -- if [[ ${OPTARG} ]]; then -- PXE_BRIDGE="-b ${OPTARG}" -- fi -+ for bridge in ${OPTARG//,/ }; do -+ PXE_BRIDGE+=" -b $bridge" -+ done - ;; - d) - DRY_RUN=1 diff --git a/patches/opnfv-fuel/0011-deploy.sh-accept-a-timeout-flag-T.patch b/patches/opnfv-fuel/0011-deploy.sh-accept-a-timeout-flag-T.patch deleted file mode 100644 index 6ccafcc1..00000000 --- a/patches/opnfv-fuel/0011-deploy.sh-accept-a-timeout-flag-T.patch +++ /dev/null @@ -1,81 +0,0 @@ -From: Josep Puigdemont -Date: Mon, 9 May 2016 11:05:58 +0200 -Subject: [PATCH] deploy.sh: accept a timeout flag (-T) - -Signed-off-by: Josep Puigdemont ---- - ci/deploy.sh | 19 +++++++++++++++---- - 1 file changed, 15 insertions(+), 4 deletions(-) - -diff --git a/ci/deploy.sh b/ci/deploy.sh -index 3a95327..a8b3015 100755 ---- a/ci/deploy.sh -+++ b/ci/deploy.sh -@@ -29,7 +29,7 @@ cat << EOF - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - `basename $0`: Deploys the Fuel@OPNFV stack - --usage: `basename $0` -b base-uri [-B PXE Bridge] [-f] [-F] [-H] -l lab-name -p pod-name -s deploy-scenario [-S image-dir] -i iso -+usage: `basename $0` -b base-uri [-B PXE Bridge] [-f] [-F] [-H] -l lab-name -p pod-name -s deploy-scenario [-S image-dir] [-T timeout] -i iso - -s deployment-scenario [-S optional Deploy-scenario path URI] - [-R optional local relen repo (containing deployment Scenarios] - -@@ -46,6 +46,7 @@ OPTIONS: - -p Pod-name - -s Deploy-scenario short-name/base-file-name - -S Storage dir for VM images -+ -T Timeout, in minutes, for the deploy. - -i iso url - - Description: -@@ -76,6 +77,8 @@ Input parameters to the build script is: - or a deployment short-name as defined by scenario.yaml in the deployment - scenario path. - -S Storage dir for VM images, default is fuel/deploy/images -+-T Timeout, in minutes, for the deploy. It defaults to using the DEPLOY_TIMEOUT -+ environment variable when defined, or to the default in deploy.py otherwise - -i .iso image to be deployed (needs to be provided in a URI - style, it can be a local resource: file:// or a remote resource http(s)://) - -@@ -114,6 +117,11 @@ FUEL_CREATION_ONLY='' - NO_DEPLOY_ENVIRONMENT='' - STORAGE_DIR='' - DRY_RUN=0 -+if ! [ -z $DEPLOY_TIMEOUT ]; then -+ DEPLOY_TIMEOUT="-dt $DEPLOY_TIMEOUT" -+else -+ DEPLOY_TIMEOUT="" -+fi - # - # END of variables to customize - ############################################################################ -@@ -121,7 +129,7 @@ DRY_RUN=0 - ############################################################################ - # BEGIN of main - # --while getopts "b:B:dfFHl:p:s:S:i:he" OPTION -+while getopts "b:B:dfFHl:p:s:S:T:i:he" OPTION - do - case $OPTION in - b) -@@ -169,6 +177,9 @@ do - STORAGE_DIR="-s ${OPTARG}" - fi - ;; -+ T) -+ DEPLOY_TIMEOUT="-dt ${OPTARG}" -+ ;; - i) - ISO=${OPTARG} - if [[ ! $ISO == file://* ]] && \ -@@ -238,8 +249,8 @@ if [ $DRY_RUN -eq 0 ]; then - ISO=${SCRIPT_PATH}/ISO/image.iso - fi - # Start deployment -- echo "python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO" -- python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO -+ echo "python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO $DEPLOY_TIMEOUT" -+ python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO $DEPLOY_TIMEOUT - fi - popd > /dev/null - diff --git a/patches/opnfv-fuel/0012-Fuel-VM-for-the-Enea-Armband-lab.patch b/patches/opnfv-fuel/0012-Fuel-VM-for-the-Enea-Armband-lab.patch deleted file mode 100644 index fbcd11d1..00000000 --- a/patches/opnfv-fuel/0012-Fuel-VM-for-the-Enea-Armband-lab.patch +++ /dev/null @@ -1,106 +0,0 @@ -From: Josep Puigdemont -Date: Wed, 4 May 2016 14:27:23 +0200 -Subject: [PATCH] Fuel VM for the Enea Armband lab - -This is the initial VM description fit for Enea's Armband lab. - -Signed-off-by: Josep Puigdemont ---- - .../hardware_environment/vms/enea_lab/fuel.xml | 88 ++++++++++++++++++++++ - 1 file changed, 88 insertions(+) - create mode 100644 deploy/templates/hardware_environment/vms/enea_lab/fuel.xml - -diff --git a/deploy/templates/hardware_environment/vms/enea_lab/fuel.xml b/deploy/templates/hardware_environment/vms/enea_lab/fuel.xml -new file mode 100644 -index 0000000..8773ed4 ---- /dev/null -+++ b/deploy/templates/hardware_environment/vms/enea_lab/fuel.xml -@@ -0,0 +1,88 @@ -+ -+ fuel -+ 8290304 -+ 8290304 -+ 8 -+ -+ /machine -+ -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ destroy -+ restart -+ restart -+ -+ -+ -+ -+ -+ /usr/libexec/qemu-kvm -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ diff --git a/patches/opnfv-fuel/0013-transplant-Generate-extra-interfaces-config-file.patch b/patches/opnfv-fuel/0013-transplant-Generate-extra-interfaces-config-file.patch deleted file mode 100644 index b6a351e4..00000000 --- a/patches/opnfv-fuel/0013-transplant-Generate-extra-interfaces-config-file.patch +++ /dev/null @@ -1,107 +0,0 @@ -From: Josep Puigdemont -Date: Wed, 4 May 2016 17:58:56 +0200 -Subject: [PATCH] transplant: Generate extra interfaces config file - -The DEA override may contain a IFCGF_ section in its 'fuel:' -section, containing the necessary keys to produce a ifcfg- -file, like in this example: - -fuel: - IFCFG_ETH1: - device: eth1 - ipaddress: 10.0.1.10 - netmask: 255.255.255.0 - gateway: 10.0.1.254 - -FIXME: In order for Network Manager to use the newly added interfaces -for outgoing traffic and honor their GATEWAY setting (e.g. if we just -added one public interface), the default route on admin iface (most of -the time called eth0) should be disabled. For now, we assume the admin -interface is always "eth0". - -Signed-off-by: Josep Puigdemont -Signed-off-by: Alexandu Avadanii ---- - deploy/transplant_fuel_settings.py | 37 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 37 insertions(+) - -diff --git a/deploy/transplant_fuel_settings.py b/deploy/transplant_fuel_settings.py -index e57a4fb..9a65cf6 100644 ---- a/deploy/transplant_fuel_settings.py -+++ b/deploy/transplant_fuel_settings.py -@@ -11,10 +11,14 @@ - 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' -@@ -35,15 +39,45 @@ def parse_arguments(): - 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 - - -@@ -51,11 +85,14 @@ def main(): - dea_file = parse_arguments() - check_file_exists(ASTUTE_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') - - - if __name__ == '__main__': diff --git a/patches/opnfv-fuel/0014-deploy.sh-no-need-to-set-umask-0000.patch b/patches/opnfv-fuel/0014-deploy.sh-no-need-to-set-umask-0000.patch deleted file mode 100644 index 446a2071..00000000 --- a/patches/opnfv-fuel/0014-deploy.sh-no-need-to-set-umask-0000.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Josep Puigdemont -Date: Fri, 6 May 2016 03:07:40 +0200 -Subject: [PATCH] deploy.sh: no need to set umask 0000 - -Signed-off-by: Josep Puigdemont ---- - ci/deploy.sh | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/ci/deploy.sh b/ci/deploy.sh -index a8b3015..cd7f652 100755 ---- a/ci/deploy.sh -+++ b/ci/deploy.sh -@@ -82,9 +82,6 @@ Input parameters to the build script is: - -i .iso image to be deployed (needs to be provided in a URI - style, it can be a local resource: file:// or a remote resource http(s)://) - --NOTE: Root priviledges are needed for this script to run -- -- - Examples: - sudo `basename $0` -b file:///home/jenkins/lab-config -l lf -p pod1 -s ha_odl-l3_heat_ceilometer -i file:///home/jenkins/myiso.iso - EOF -@@ -226,9 +223,6 @@ fi - # Enable the automatic exit trap - trap do_exit SIGINT SIGTERM EXIT - --# Set no restrictive umask so that Jenkins can removeeee any residuals --umask 0000 -- - clean - - pushd ${DEPLOY_DIR} > /dev/null diff --git a/patches/opnfv-fuel/0015-Remove-check-for-root.patch b/patches/opnfv-fuel/0015-Remove-check-for-root.patch deleted file mode 100644 index ab0df01c..00000000 --- a/patches/opnfv-fuel/0015-Remove-check-for-root.patch +++ /dev/null @@ -1,80 +0,0 @@ -From: Josep Puigdemont -Date: Wed, 4 May 2016 14:27:23 +0200 -Subject: [PATCH] Remove check for root - -Signed-off-by: Josep Puigdemont ---- - ci/deploy.sh | 5 ----- - deploy/deploy-config.py | 1 - - deploy/deploy.py | 2 -- - deploy/environments/virtual_fuel.py | 2 -- - 4 files changed, 10 deletions(-) - -diff --git a/ci/deploy.sh b/ci/deploy.sh -index cd7f652..5f06a19 100755 ---- a/ci/deploy.sh -+++ b/ci/deploy.sh -@@ -204,11 +204,6 @@ do - esac - done - --if [[ $EUID -ne 0 ]]; then -- echo "This script must be run as root" 1>&2 -- exit 1 --fi -- - if [ -z $BASE_CONFIG_URI ] || [ -z $TARGET_LAB ] || \ - [ -z $TARGET_POD ] || [ -z $DEPLOY_SCENARIO ] || \ - [ -z $ISO ]; then -diff --git a/deploy/deploy-config.py b/deploy/deploy-config.py -index 65d51b2..88a1111 100644 ---- a/deploy/deploy-config.py -+++ b/deploy/deploy-config.py -@@ -40,7 +40,6 @@ from common import ( - check_file_exists, - create_dir_if_not_exists, - delete, -- check_if_root, - ArgParser, - ) - -diff --git a/deploy/deploy.py b/deploy/deploy.py -index 9db1754..ca092f5 100755 ---- a/deploy/deploy.py -+++ b/deploy/deploy.py -@@ -32,7 +32,6 @@ from common import ( - check_file_exists, - create_dir_if_not_exists, - delete, -- check_if_root, - ArgParser, - ) - -@@ -232,7 +231,6 @@ class AutoDeploy(object): - return 0 - - def run(self): -- check_if_root() - if self.cleanup_only: - self.cleanup_execution_environment() - else: -diff --git a/deploy/environments/virtual_fuel.py b/deploy/environments/virtual_fuel.py -index b1a76e4..4ff68f6 100644 ---- a/deploy/environments/virtual_fuel.py -+++ b/deploy/environments/virtual_fuel.py -@@ -18,7 +18,6 @@ import time - from common import ( - exec_cmd, - check_file_exists, -- check_if_root, - delete, - log, - ) -@@ -135,7 +134,6 @@ class VirtualFuel(ExecutionEnvironment): - vm_definition_overwrite) - - def setup_environment(self): -- check_if_root() - self.cleanup_environment() - self.create_vm() - diff --git a/patches/opnfv-fuel/0018-deploy-reap.py-Dump-extra-interfaces-information.patch b/patches/opnfv-fuel/0018-deploy-reap.py-Dump-extra-interfaces-information.patch deleted file mode 100644 index c1d7b6f0..00000000 --- a/patches/opnfv-fuel/0018-deploy-reap.py-Dump-extra-interfaces-information.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Alexandru Avadanii -Date: Wed, 4 May 2016 18:31:09 +0200 -Subject: [PATCH] deploy/reap.py: Dump extra interfaces information. - -Since on AArch64, Ubuntu local mirror lacks arm64 packages (see [1]), -Fuel master requires internet connectivity during deploy, and hence -a way to setup such a public (extra) interface automatically. - -Previous commit "transplant: Generate extra interfaces config file" -introduced support for passing this information via DEA (override), -which may define a IFCGF_ section in its 'fuel:' -section, containing the necessary keys to produce a ifcfg- -file, like in this example: - -fuel: - IFCFG_ETH1: - device: eth1 - ipaddress: 10.0.1.10 - netmask: 255.255.255.0 - gateway: 10.0.1.254 - -In order for Network Manager to use the newly added interfaces -for outgoing traffic and honor their GATEWAY setting (e.g. if we just -added one public interface), the default route on admin iface (most of -the time called eth0) is disabled when extra interfaces are present. - -FIXME: Only supports lowercase interface names, but so does Fuel, -see related bug report [2]. - -[1] https://jira.opnfv.org/browse/ARMBAND-35 -[2] https://jira.opnfv.org/browse/FUEL-136 - -Signed-off-by: Alexandu Avadanii -Signed-off-by: Josep Puigdemont ---- - deploy/reap.py | 34 ++++++++++++++++++++++++++++++++++ - 1 file changed, 34 insertions(+) - -diff --git a/deploy/reap.py b/deploy/reap.py -index 1262d4c..1f1b8ad 100644 ---- a/deploy/reap.py -+++ b/deploy/reap.py -@@ -15,6 +15,8 @@ import yaml - import glob - import shutil - import tempfile -+import re -+import netaddr - - from common import ( - N, -@@ -246,4 +248,36 @@ class Reap(object): - 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: -+ (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): -- cgit 1.2.3-korg