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 276cd6c..5407aac 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.
 
         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
     root_vswitch_scripts_sysconfig.template
 
         Template for vswitch's /etc/sysconfig/vswitch configuration
index deb79bc..4c9c0a9 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/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 \
        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 b186e26..01f49f6 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
              $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 \
 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/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
 /root/vswitch/scripts/interface-reconfigure
 /root/vswitch/scripts/vif
 /root/vswitch/scripts/xen-bugtool