From: Alex Zeffertt Date: Wed, 26 Jan 2011 17:39:04 +0000 (+0000) Subject: Call /opt/xensource/sm/mpathcount.py after xapi started if root disk is multipathed X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0d8da431aca3b9199edd460455cc36b937439fb3;p=xcp%2Fxen-api.git Call /opt/xensource/sm/mpathcount.py after xapi started if root disk is multipathed mpathcount.py now updates the host object when the root disk is multipathed as well as updating pbd objects. (It writes values into other-config to show XenCenter how many paths are active and how many are failed.) Normally it is multipathd that calls mpathcount.py, but in the case of the root disk the /dev/mapper node is created by the initrd before multipathd is started. Signed-off-by: Alex Zeffertt --- diff --git a/scripts/init.d-xapi b/scripts/init.d-xapi index ccdc0389..a237a739 100755 --- a/scripts/init.d-xapi +++ b/scripts/init.d-xapi @@ -91,6 +91,15 @@ start() { fi fi + # If running on multipath root we need to update + # the multipath info on the Host object + ROOT_PART_MAJOR=$(stat --format=%t /dev/root) + DEVICE_MAPPER_MAJOR=$(sed -ne 's/^\([0-9]\+\) device-mapper$/\1/p' /proc/devices) + DEVICE_MAPPER_MAJOR_HEX=$(printf "%x" ${DEVICE_MAPPER_MAJOR}) + if [ "$ROOT_PART_MAJOR" == "$DEVICE_MAPPER_MAJOR_HEX" ] ; then + /opt/xensource/sm/mpathcount.py + fi + if [ -e ${XAPI_STARTUP_COOKIE} ]; then touch /var/lock/subsys/xapi echo -n $"start-of-day complete."