xenserver: Add script refresh-xs-network-uuids.
authorBen Pfaff <blp@nicira.com>
Mon, 28 Sep 2009 23:03:49 +0000 (16:03 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 28 Sep 2009 23:03:49 +0000 (16:03 -0700)
On pool join, the bridge.<bridge>.xs-network-uuids key is not updated
properly for the primary management interface.  We don't have a proper
fix for this problem yet, and probably won't ever have one for XenServer
5.5.0, so this commit adds a script that works around the problem.
Running the script is a shortcut for rebooting the XenServer host,
which should also solve the problem.

Bug #2097.

xenserver/README
xenserver/automake.mk
xenserver/root_vswitch_scripts_refresh-xs-network-uuids [new file with mode: 0755]
xenserver/vswitch-xen.spec

index 276cd6c2ae991ace44a6362d7ca78b5920cc4cc4..5407aac9d5f97edfbaef16f1df78e70240946f7a 100644 (file)
@@ -50,6 +50,12 @@ files are:
         needed by the controller.  This is called by the "vif" script,
         which is run when virtual interfaces are added and removed.
 
+    root_vswitch_scripts_refresh-xs-network-uuids
+
+        Script to refresh bridge.<bridge>.xs-network-uuids keys, which
+        can get out-of-sync following a pool join.  Running this script
+        is an alternative to rebooting the host.
+
     root_vswitch_scripts_sysconfig.template
 
         Template for vswitch's /etc/sysconfig/vswitch configuration
index deb79bc82ae99577384d3c63c53a818d3828f3a4..4c9c0a979c60012cede2643aa22d330062b3c9c0 100644 (file)
@@ -16,6 +16,7 @@ EXTRA_DIST += \
        xenserver/opt_xensource_libexec_interface-reconfigure \
        xenserver/root_vswitch_scripts_sysconfig.template \
        xenserver/root_vswitch_scripts_dump-vif-details \
+       xenserver/root_vswitch_scripts_refresh-xs-network-uuids \
        xenserver/usr_lib_xsconsole_plugins-base_XSFeatureVSwitch.py \
        xenserver/usr_sbin_brctl \
        xenserver/usr_sbin_xen-bugtool \
diff --git a/xenserver/root_vswitch_scripts_refresh-xs-network-uuids b/xenserver/root_vswitch_scripts_refresh-xs-network-uuids
new file mode 100755 (executable)
index 0000000..34fe1e7
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+. /etc/xensource-inventory
+
+for pif in $(xe pif-list --minimal host-uuid=${INSTALLATION_UUID} currently-attached=true VLAN=-1 | sed 's/,/ /g'); do
+    printf "Refreshing PIF %s...  " $pif
+    if /opt/xensource/libexec/interface-reconfigure --pif-uuid=$pif up; then
+        printf "done\n"
+    else
+        printf "error!\n"
+    fi
+done
index b186e2647944f8085b6015bbf855add13246451b..01f49f6d29db349e3bceca8d3d9739a290b65a96 100644 (file)
@@ -67,6 +67,8 @@ install -m 755 xenserver/etc_xensource_scripts_vif \
              $RPM_BUILD_ROOT%{_prefix}/scripts/vif
 install -m 755 xenserver/root_vswitch_scripts_dump-vif-details \
                $RPM_BUILD_ROOT%{_prefix}/scripts/dump-vif-details
+install -m 755 xenserver/root_vswitch_scripts_refresh-xs-network-uuids \
+               $RPM_BUILD_ROOT%{_prefix}/scripts/refresh-xs-network-uuids
 install -m 755 xenserver/usr_sbin_xen-bugtool \
              $RPM_BUILD_ROOT%{_prefix}/scripts/xen-bugtool
 install -m 755 xenserver/usr_sbin_brctl \
@@ -329,6 +331,7 @@ fi
 /root/vswitch/kernel_modules/openvswitch_mod.ko
 /root/vswitch/kernel_modules/veth_mod.ko
 /root/vswitch/scripts/dump-vif-details
+/root/vswitch/scripts/refresh-xs-network-uuids
 /root/vswitch/scripts/interface-reconfigure
 /root/vswitch/scripts/vif
 /root/vswitch/scripts/xen-bugtool