xenserver: Delete Bridge when creating vlan.
authorEthan Jackson <ethan@nicira.com>
Thu, 10 Mar 2011 00:12:10 +0000 (16:12 -0800)
committerEthan Jackson <ethan@nicira.com>
Thu, 10 Mar 2011 18:26:23 +0000 (10:26 -0800)
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" <dtsai@nicira.com>
Bug #4877.

tests/interface-reconfigure.at
xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py

index 1470967616349a4df1e7205b3b40e71a87210a83..9749fd586a385110d82f3296a875dcbec2c7c3a6 100644 (file)
@@ -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"
index 661199b4a7163f8d21c8db0c5e324510afdfcad9..6c9e3fa8c494d8cb628350ff93ea38a5a7109d48 100644 (file)
@@ -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',