From 7744280b18438e6e75d4a1867e57b5f4e48ad0ad Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 5 Oct 2009 16:27:01 +0100 Subject: [PATCH] xenserver: Include bridge.*.xs-network-uuids for all networks 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). --- ...opt_xensource_libexec_interface-reconfigure | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index f29e75b9..7b0c9eff 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -1448,9 +1448,13 @@ def action_up(pif): 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'])] @@ -1514,10 +1518,10 @@ def action_down(pif): 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] -- 2.30.2