From 27192ecbc85c1d7afc1c585e718ab3f4de75ba49 Mon Sep 17 00:00:00 2001 From: Jeremy Filizetti Date: Fri, 30 Mar 2018 07:28:03 -0400 Subject: [PATCH] LU-10866 pacemaker: Support additional mount options Add support for additional mount options for pacemaker resources. Logging is also added for the output of the mount and umount commands. Signed-off-by: Jeremy Filizetti Change-Id: Ideca8e37b12015b9f455634c85295137e00b97fd Reviewed-on: https://review.whamcloud.com/31836 Reviewed-by: Nathaniel Clark Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Joe Grund Reviewed-by: Oleg Drokin --- lustre/conf/resource/Lustre | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/lustre/conf/resource/Lustre b/lustre/conf/resource/Lustre index cafb07b..fc251fe 100755 --- a/lustre/conf/resource/Lustre +++ b/lustre/conf/resource/Lustre @@ -22,6 +22,7 @@ # OCF parameters are as follows: # OCF_RESKEY_target - the device or ZFS volume to mount/umount # OCF_RESKEY_mountpoint - the mountpoint to use +# OCF_RESKEY_mountoptions - any mount options to use ####################################################################### # Initialization: @@ -76,6 +77,14 @@ The mount point where the Lustre target will be mounted. + + +Any additional mount options for the Lustre target. (eg: "-o skpath=/path/to/keys") + +Mount options for Lustre target + + + @@ -121,11 +130,15 @@ lustre_mount () { if ! lustre_is_mounted; then ocf_log info "Starting to mount $OCF_RESKEY_target" - if mount -t lustre $OCF_RESKEY_target $OCF_RESKEY_mountpoint ; then + output=$(mount -t lustre $OCF_RESKEY_mountoptions $OCF_RESKEY_target $OCF_RESKEY_mountpoint 2>&1) + rc=$? + if [ $rc -eq 0 ]; then ocf_log info "$OCF_RESKEY_target mounted successfully" + [ -n "$output" ] && ocf_log info "$output" return $OCF_SUCCESS fi - ocf_log err "$OCF_RESKEY_volume mount failed" + ocf_log err "$OCF_RESKEY_target mount failed, rc=$rc" + ocf_log err "$output" return $OCF_ERR_GENERIC fi return $OCF_SUCCESS @@ -135,11 +148,15 @@ lustre_umount () { if lustre_is_mounted; then ocf_log info "Starting to unmount $OCF_RESKEY_target" - if umount $OCF_RESKEY_mountpoint; then + output=$(umount $OCF_RESKEY_mountpoint 2>&1) + rc=$? + if [ $rc -eq 0 ]; then ocf_log info "$OCF_RESKEY_target unmounted successfully" + [ -n "$output" ] && ocf_log info "$output" return $OCF_SUCCESS fi - ocf_log err "$OCF_RESKEY_target unmount failed" + ocf_log err "$OCF_RESKEY_target unmount failed, rc=$rc" + ocf_log err "$output" return $OCF_ERR_GENERIC fi return $OCF_SUCCESS -- 1.8.3.1