[ovs-dev] [PATCH] xenserver: make ovs-xenserverd startup configurable and disable it for 5.6.0 onwards.

Ben Pfaff blp at nicira.com
Thu Jun 3 23:04:06 UTC 2010


On Thu, Jun 03, 2010 at 10:42:37PM +0100, Rob Hoes wrote:
> On 3 Jun 2010, at 20:40, Ian Campbell wrote:
> > I would have expected this to work on any build since I added the call
> > to set the network uuids for internal networks explicitly, which was
> > ages ago (before the switch to 5.6.810 numbering I think). I thought
> > xapi had always replugged all PIFs at start of day (Rob, is my
> > understanding here correct?).
> 
> Xapi does not re-plug any PIFs that are already up
> (PIF.currently_attached = true) when it restarts. I believe it used to
> do that in the past, but it was changed due to problems with broken
> network connections in VMs (e.g. in the case that xapi restarts as a
> result of a master handover this is undesirable). So
> interface-reconfigure is not called for these PIFs...
> 
> > Hopefully we can find a way to fix this on the xapi side but the
> > fallback would likely be to add an network-uuid update to the
> > openvswitch-cfg-update plugin. In any case I don't want a loop
> > polling /etc/xensource-inventory in the version integrated into
> > XenServer.
> 
> The plugin is called each time xapi restarts, including after pool
> join/eject. Wouldn't that be the best place to do any
> openvswitch-specific synchronisation?

Thank you.

I assume that this behavior is new in XenServer 5.6?  If it was also
present in XenServer 5.5, then we can get rid of ovs-xenserverd
entirely.

Here's a proposed fix for everyone to review, then:

--8<--------------------------cut here-------------------------->8--

>From 6315d5b3fe82bf7df7b938957fa46a3e42f5f42b Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp at nicira.com>
Date: Thu, 3 Jun 2010 16:03:26 -0700
Subject: [PATCH] xenserver: Update network UUIDs whenever XAPI restarts.

According to:
http://openvswitch.org/pipermail/dev_openvswitch.org/2010-June/002216.html
XAPI calls the "update" method of plugins whenever it starts or restarts.
Thus, this is a good place to trigger updating network UUIDs.  This commit
implements that behavior.

This should fix the problem of network UUIDs not being updated on pool
join, since XAPI restarts when it joins a pool.

When XenServer 5.5 support is no longer interesting, we should integrate
the refresh-network-uuids script into the XAPI plugin.

Lightly tested, works for me on 5.6.810-31078p.

Suggested-by: Rob Hoes <rob.hoes at citrix.com>
Bug #2097.
---
 .../etc_xapi.d_plugins_openvswitch-cfg-update      |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
index 04d0774..ebc1b36 100755
--- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
+++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
@@ -39,6 +39,15 @@ def delete_cacert():
         pass
 
 def update(session, args):
+    # Refresh bridge network UUIDs in case this host joined or left a pool.
+    script = "/usr/share/openvswitch/scripts/refresh-network-uuids"
+    try:
+        retval = subprocess.call(script)
+        if retval != 0:
+            syslog.syslog("%s exited with status %d" % (script, retval))
+    except OSError, e:
+        syslog.syslog("%s: failed to execute (%s)" % (script, e.strerror))
+
     pools = session.xenapi.pool.get_all()
     # We assume there is only ever one pool...
     if len(pools) == 0:
-- 
1.7.1





More information about the dev mailing list