From: Ben Pfaff Date: Mon, 28 Sep 2009 23:03:49 +0000 (-0700) Subject: xenserver: Add script refresh-xs-network-uuids. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b71f0116078b38b2bee0538b4633e19996badfe;p=openvswitch xenserver: Add script refresh-xs-network-uuids. On pool join, the 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. --- diff --git a/xenserver/README b/xenserver/README index 276cd6c2..5407aac9 100644 --- a/xenserver/README +++ b/xenserver/README @@ -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..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 diff --git a/xenserver/automake.mk b/xenserver/automake.mk index deb79bc8..4c9c0a97 100644 --- a/xenserver/automake.mk +++ b/xenserver/automake.mk @@ -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 index 00000000..34fe1e7e --- /dev/null +++ b/xenserver/root_vswitch_scripts_refresh-xs-network-uuids @@ -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 diff --git a/xenserver/vswitch-xen.spec b/xenserver/vswitch-xen.spec index b186e264..01f49f6d 100644 --- a/xenserver/vswitch-xen.spec +++ b/xenserver/vswitch-xen.spec @@ -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