|
|
9cf66a |
From 4ee9a7026d7ed15b0b5cd26f06a21d04fc05d14e Mon Sep 17 00:00:00 2001
|
|
|
9cf66a |
From: Roger Zhou <zzhou@suse.com>
|
|
|
9cf66a |
Date: Mon, 1 Apr 2019 22:57:26 +0800
|
|
|
9cf66a |
Subject: [PATCH 1/2] LVM-activate: return OCF_NOT_RUNNING on initial probe
|
|
|
9cf66a |
|
|
|
9cf66a |
In the use case of lvm on top of cluster md/raid. When the fenced node
|
|
|
9cf66a |
rejoins to the cluster, Pacemaker will run the monitor action for the
|
|
|
9cf66a |
probe operation. At that time, LVM PV and VG won't exist before cluster
|
|
|
9cf66a |
md/raid get assembled, and the probe should return $OCF_NOT_RUNNING
|
|
|
9cf66a |
instead of $OCF_ERR_CONFIGURED.
|
|
|
9cf66a |
|
|
|
9cf66a |
Signed-off-by: Roger Zhou <zzhou@suse.com>
|
|
|
9cf66a |
---
|
|
|
9cf66a |
heartbeat/LVM-activate | 6 ++++++
|
|
|
9cf66a |
1 file changed, 6 insertions(+)
|
|
|
9cf66a |
|
|
|
9cf66a |
diff --git a/heartbeat/LVM-activate b/heartbeat/LVM-activate
|
|
|
9cf66a |
index 3c462c75c..91ac05c34 100755
|
|
|
9cf66a |
--- a/heartbeat/LVM-activate
|
|
|
9cf66a |
+++ b/heartbeat/LVM-activate
|
|
|
9cf66a |
@@ -329,6 +329,7 @@ lvmlockd_check()
|
|
|
9cf66a |
# Good: lvmlockd is running, and clvmd is not running
|
|
|
9cf66a |
if ! pgrep lvmlockd >/dev/null 2>&1 ; then
|
|
|
9cf66a |
if ocf_is_probe; then
|
|
|
9cf66a |
+ ocf_log info "initial probe: lvmlockd is not running yet."
|
|
|
9cf66a |
exit $OCF_NOT_RUNNING
|
|
|
9cf66a |
fi
|
|
|
9cf66a |
|
|
|
9cf66a |
@@ -481,6 +482,11 @@ lvm_validate() {
|
|
|
9cf66a |
exit $OCF_SUCCESS
|
|
|
9cf66a |
fi
|
|
|
9cf66a |
|
|
|
9cf66a |
+ if ocf_is_probe; then
|
|
|
9cf66a |
+ ocf_log info "initial probe: VG [${VG}] is not found on any block device yet."
|
|
|
9cf66a |
+ exit $OCF_NOT_RUNNING
|
|
|
9cf66a |
+ fi
|
|
|
9cf66a |
+
|
|
|
9cf66a |
ocf_exit_reason "Volume group[${VG}] doesn't exist, or not visible on this node!"
|
|
|
9cf66a |
exit $OCF_ERR_CONFIGURED
|
|
|
9cf66a |
fi
|
|
|
9cf66a |
|
|
|
9cf66a |
From df2f58c400b1f6f239f9e1c1fdf6ce0875639b43 Mon Sep 17 00:00:00 2001
|
|
|
9cf66a |
From: Roger Zhou <zzhou@suse.com>
|
|
|
9cf66a |
Date: Mon, 1 Apr 2019 23:02:54 +0800
|
|
|
9cf66a |
Subject: [PATCH 2/2] LVM-activate: align dmsetup report command to standard
|
|
|
9cf66a |
|
|
|
9cf66a |
Namely to change 'vgname/lvname' to 'vg_name/lv_name'. The dmsetup
|
|
|
9cf66a |
report command follows lvm2 selection criteria field name standard.
|
|
|
9cf66a |
- dmsetup v1.02.86 (lvm2 v2_02_107) - 23rd June 2014
|
|
|
9cf66a |
"Add dmsetup -S/--select to define selection criteria"
|
|
|
9cf66a |
- dmsetup info -c -S help
|
|
|
9cf66a |
|
|
|
9cf66a |
Signed-off-by: Roger Zhou <zzhou@suse.com>
|
|
|
9cf66a |
---
|
|
|
9cf66a |
heartbeat/LVM-activate | 6 +++---
|
|
|
9cf66a |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
9cf66a |
|
|
|
9cf66a |
diff --git a/heartbeat/LVM-activate b/heartbeat/LVM-activate
|
|
|
9cf66a |
index 91ac05c34..730d9a09d 100755
|
|
|
9cf66a |
--- a/heartbeat/LVM-activate
|
|
|
9cf66a |
+++ b/heartbeat/LVM-activate
|
|
|
9cf66a |
@@ -707,7 +707,7 @@ tagging_deactivate() {
|
|
|
9cf66a |
# method:
|
|
|
9cf66a |
#
|
|
|
9cf66a |
# lv_count=$(vgs --foreign -o lv_count --noheadings ${VG} 2>/dev/null | tr -d '[:blank:]')
|
|
|
9cf66a |
-# dm_count=$(dmsetup --noheadings info -c -S "vgname=${VG}" 2>/dev/null | grep -c "${VG}-")
|
|
|
9cf66a |
+# dm_count=$(dmsetup --noheadings info -c -S "vg_name=${VG}" 2>/dev/null | grep -c "${VG}-")
|
|
|
9cf66a |
# test $lv_count -eq $dm_count
|
|
|
9cf66a |
#
|
|
|
9cf66a |
# It works, but we cannot afford to use LVM command in lvm_status. LVM command is expensive
|
|
|
9cf66a |
@@ -730,9 +730,9 @@ lvm_status() {
|
|
|
9cf66a |
if [ -n "${LV}" ]; then
|
|
|
9cf66a |
# dmsetup ls? It cannot accept device name. It's
|
|
|
9cf66a |
# too heavy to list all DM devices.
|
|
|
9cf66a |
- dm_count=$(dmsetup info --noheadings --noflush -c -S "vgname=${VG} && lvname=${LV}" | grep -c -v '^No devices found')
|
|
|
9cf66a |
+ dm_count=$(dmsetup info --noheadings --noflush -c -S "vg_name=${VG} && lv_name=${LV}" | grep -c -v '^No devices found')
|
|
|
9cf66a |
else
|
|
|
9cf66a |
- dm_count=$(dmsetup info --noheadings --noflush -c -S "vgname=${VG}" | grep -c -v '^No devices found')
|
|
|
9cf66a |
+ dm_count=$(dmsetup info --noheadings --noflush -c -S "vg_name=${VG}" | grep -c -v '^No devices found')
|
|
|
9cf66a |
fi
|
|
|
9cf66a |
|
|
|
9cf66a |
if [ $dm_count -eq 0 ]; then
|