diff options
author | Josep Puigdemont <josep.puigdemont@enea.com> | 2016-05-08 13:04:07 +0200 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2016-05-08 17:34:50 +0000 |
commit | a31faaebf959dca2793edd984f6776ae5c272f4f (patch) | |
tree | d09bf3d730b109339363c326dc96dfd187b037f9 /patches/opnfv-fuel/0023-deploy.py-add-multiple-bridges-support.patch | |
parent | 1158f729444aa16313e263b468e92555f8eb7eb4 (diff) |
ARMband patches for the fuel@opnfv deploy scripts
These are a collection of patches that adapt the current Fuel deploy
scripts for mainly two purposes:
- Make it possible to create a Fuel VM on a remote libvirt server.
We use the LIBVIRT_DEFAULT_URI environment variable to detect that.
Local deploys are possible by setting this variable to
'quemu:///system', or leaving it empty.
See: https://libvirt.org/remote.html for more details.
- Make it possible to add additional network interfaces. For this we
allow the user to pass the "-b bridge" paramter several times, and
creating a new virtual NIC for each of them, in the same order they
were given.
This required a bit of refactoring of the code.
None of the changes above should break backwards compatibility, except
when indicated in the commit (search for CHANGE in the log)
In addition there are some updates to the code that were deemed
necessary, like the ability to retry when executing shell commands
instead of directly failing, and a simplification of the DHA IPMI
adapter.
Change-Id: I8a0cd5b8672383decd861309328137971eaed14b
Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
(cherry picked from commit bedeb36ac9ad42fb1ead2449ed8e75f0171808a2)
Diffstat (limited to 'patches/opnfv-fuel/0023-deploy.py-add-multiple-bridges-support.patch')
-rw-r--r-- | patches/opnfv-fuel/0023-deploy.py-add-multiple-bridges-support.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/patches/opnfv-fuel/0023-deploy.py-add-multiple-bridges-support.patch b/patches/opnfv-fuel/0023-deploy.py-add-multiple-bridges-support.patch new file mode 100644 index 00000000..376a7221 --- /dev/null +++ b/patches/opnfv-fuel/0023-deploy.py-add-multiple-bridges-support.patch @@ -0,0 +1,69 @@ +From: Josep Puigdemont <josep.puigdemont@enea.com> +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 <josep.puigdemont@enea.com> +--- + 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 ff4582a..041ba2f 100755 +--- a/deploy/deploy.py ++++ b/deploy/deploy.py +@@ -312,8 +312,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', +@@ -332,6 +332,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) + + if not args.cleanup_only: +@@ -343,7 +346,8 @@ def parse_arguments(): + check_file_exists(args.iso_file) + 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 b68577e..6b673d0 100644 +--- a/deploy/environments/virtual_fuel.py ++++ b/deploy/environments/virtual_fuel.py +@@ -121,7 +121,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') |