From 0d8da431aca3b9199edd460455cc36b937439fb3 Mon Sep 17 00:00:00 2001 From: Alex Zeffertt Date: Wed, 26 Jan 2011 17:39:04 +0000 Subject: [PATCH] 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 --- scripts/init.d-xapi | 9 +++++++++ 1 file changed, 9 insertions(+) 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." -- 2.39.5