[ovs-dev] interface-reconfigure: Include bridge.*.xs-network-uuids for all networks in /etc/ovs-vswitchd.conf

Ian Campbell Ian.Campbell at citrix.com
Mon Oct 5 15:27:01 UTC 2009


Previously I advised that only networks which were currently attached to
the host be listed in /etc/ovs-vswitchd.conf. However I've just realised
that this interacts badly with the slightly ugly special case used for
PIF.currently-attached when reading from dbcache instead of talking to
Xapi. This bites on boot when /etc/init.d/management-interface tries to
plug a selection of PIFs which are deemed to be somehow required by
xapi. (not helped by a bug in XenServer 5.7.0 which can cause this list
to be larger than it should be and not internally consistent).

For now I think it prudent to simply list all networks which could
potentially be attached to a given datapath, until I can figure out what
the sane fix is on the XenServer end.

(I think there are two options for a proper fix, either inspect the
current state of the network devices or assume dbcache represents the
desired final state after devices are plugged on boot. I'm leaning
towards the later since the dbcache should indicate the set of PIFs
which were attached on shutdown, which xapi will likely be trying to
replug on boot... Needs more thought though).

Ian.

diff -r 21f14599b05e scripts/interface-reconfigure
--- a/scripts/interface-reconfigure	Mon Oct 05 16:15:08 2009 +0100
+++ b/scripts/interface-reconfigure	Mon Oct 05 16:15:17 2009 +0100
@@ -1448,9 +1448,13 @@
 
         for nwpif in db.get_pifs_by_device(db.get_pif_record(pif)['device']):
             rec = db.get_pif_record(nwpif)
-            if nwpif != pif and not rec['currently_attached']:
-                log("Network PIF %s not currently attached (%s)" % (rec['uuid'],pifrec['uuid']))
-                continue
+            
+            # When state is read from dbcache PIF.currently_attached
+            # is always assumed to be false... Err on the side of
+            # listing even detached networks for the time being.
+            #if nwpif != pif and not rec['currently_attached']:
+            #    log("Network PIF %s not currently attached (%s)" % (rec['uuid'],pifrec['uuid']))
+            #    continue
             nwrec = db.get_network_record(rec['network'])
             cfgmod_argv += ['--add=bridge.%s.xs-network-uuids=%s' % (bridge, nwrec['uuid'])]
 
@@ -1515,10 +1519,10 @@
     ifdown(ipdev)
 
     if dp:
-        nw = db.get_pif_record(pif)['network']
-        nwrec = db.get_network_record(nw)
-        cfgmod_argv += ['# deconfigure xs-network-uuids']
-        cfgmod_argv += ['--del-entry=bridge.%s.xs-network-uuids=%s' % (bridge,nwrec['uuid'])]
+        #nw = db.get_pif_record(pif)['network']
+        #nwrec = db.get_network_record(nw)
+        #cfgmod_argv += ['# deconfigure xs-network-uuids']
+        #cfgmod_argv += ['--del-entry=bridge.%s.xs-network-uuids=%s' % (bridge,nwrec['uuid'])]
 
         log("deconfigure ipdev %s on %s" % (ipdev,bridge))
         cfgmod_argv += ["# deconfigure ipdev %s" % ipdev]






More information about the dev mailing list