From bc31db1fef627145149241281f33a92025ae50d5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 4 Jun 2010 10:02:15 -0700 Subject: [PATCH] xenserver: Update network UUIDs whenever XAPI restarts. XAPI calls the "update" method of the vswitch-cfg-update plugin 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. See-also: http://openvswitch.org/pipermail/dev_openvswitch.org/2010-June/002216.html Suggested-by: Rob Hoes Bug #2097. --- xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update index 04d0774b..ebc1b36b 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: -- 2.30.2