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 <jeremy.filizetti@gmail.com>
Change-Id: Ideca8e37b12015b9f455634c85295137e00b97fd
Reviewed-on: https://review.whamcloud.com/31836
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Joe Grund <jgrund@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
# OCF parameters are as follows:
# OCF_RESKEY_target - the device or ZFS volume to mount/umount
# OCF_RESKEY_mountpoint - the mountpoint to use
# 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:
#######################################################################
# Initialization:
<content type="string" default="" />
</parameter>
<content type="string" default="" />
</parameter>
+<parameter name="mountoptions" unique="1" required="0">
+<longdesc lang="en">
+Any additional mount options for the Lustre target. (eg: "-o skpath=/path/to/keys")
+</longdesc>
+<shortdesc lang="en">Mount options for Lustre target</shortdesc>
+<content type="string" default="" />
+</parameter>
+
if ! lustre_is_mounted; then
ocf_log info "Starting to mount $OCF_RESKEY_target"
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"
ocf_log info "$OCF_RESKEY_target mounted successfully"
+ [ -n "$output" ] && ocf_log info "$output"
- 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
return $OCF_ERR_GENERIC
fi
return $OCF_SUCCESS
if lustre_is_mounted; then
ocf_log info "Starting to unmount $OCF_RESKEY_target"
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"
ocf_log info "$OCF_RESKEY_target unmounted successfully"
+ [ -n "$output" ] && ocf_log info "$output"
- 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
return $OCF_ERR_GENERIC
fi
return $OCF_SUCCESS