From 9ec4d255acc5628f395fde8aff84a7027c2dc1c9 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Wed, 9 Mar 2011 16:12:10 -0800 Subject: [PATCH] xenserver: Delete Bridge when creating vlan. Commit 34edeccfd8d4273844d12c85fe38ec47002c47cd removed a workaround which still applies to XenServer versions older than 5.5. This could causes creation of vlans to fail in some cases. CC: "David Tsai" Bug #4877. --- tests/interface-reconfigure.at | 2 ++ .../opt_xensource_libexec_InterfaceReconfigureVswitch.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/tests/interface-reconfigure.at b/tests/interface-reconfigure.at index 147096761..9749fd586 100644 --- a/tests/interface-reconfigure.at +++ b/tests/interface-reconfigure.at @@ -743,6 +743,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi3 configuration set Bridge xenbr3 fail_mode=standalone remove Bridge xenbr3 other_config disable-in-band br-set-external-id xenbr3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 + --if-exists del-br xapi3 --may-exist add-br xapi3 xenbr3 123 br-set-external-id xapi3 xs-network-uuids 2902ae1b-8013-897a-b697-0b200ea3aaa5;db7bdc03-074d-42ae-fc73-9b06de1d57f6 set Interface xapi3 MAC="00:15:17:a0:29:81" @@ -916,6 +917,7 @@ Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration set Bridge xapi1 fail_mode=standalone remove Bridge xapi1 other_config disable-in-band br-set-external-id xapi1 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 + --if-exists del-br xapi2 --may-exist add-br xapi2 xapi1 4 br-set-external-id xapi2 xs-network-uuids 45cbbb43-113d-a712-3231-c6463f253cef;99be2da4-6c33-6f8e-49ea-3bc592fe3c85 set Interface xapi2 MAC="00:22:19:22:4b:af" diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index 661199b4a..6c9e3fa8c 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -475,6 +475,10 @@ class DatapathVswitch(Datapath): dpname = pif_bridge_name(self._dp) if pif_is_vlan(self._pif): + # In some cases XAPI may misguidedly leave an instance of + # 'bridge' which should be deleted. + vsctl_argv += ['--', '--if-exists', 'del-br', bridge] + # configure_datapath() set up the underlying datapath bridge. # Stack a VLAN bridge on top of it. vsctl_argv += ['--', '--may-exist', 'add-br', -- 2.45.2