Blame SOURCES/LVM-volume_group_check_only.patch

b4b3ce
From c414259728610f95243d9e34289fefd596b0ac8b Mon Sep 17 00:00:00 2001
b4b3ce
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
b4b3ce
Date: Fri, 22 Jun 2018 15:37:36 +0200
b4b3ce
Subject: [PATCH] LVM: add "volume_group_check_only" parameter to avoid
b4b3ce
 timeouts in some cases
b4b3ce
b4b3ce
---
b4b3ce
 heartbeat/LVM        | 10 ++++++++++
b4b3ce
 heartbeat/lvm-tag.sh | 24 +++++++++++++-----------
b4b3ce
 2 files changed, 23 insertions(+), 11 deletions(-)
b4b3ce
b4b3ce
diff --git a/heartbeat/LVM b/heartbeat/LVM
b4b3ce
index d3cd1a14..10f7186d 100755
b4b3ce
--- a/heartbeat/LVM
b4b3ce
+++ b/heartbeat/LVM
b4b3ce
@@ -103,6 +103,16 @@ logical volumes.
b4b3ce
 <content type="string" default="false" />
b4b3ce
 </parameter>
b4b3ce
 
b4b3ce
+<parameter name="volume_group_check_only" unique="0" required="0">
b4b3ce
+<longdesc lang="en">
b4b3ce
+If set, only the volume group will be checked during monitoring.
b4b3ce
+
b4b3ce
+WARNING: ONLY USE IF YOU HAVE ISSUES WITH TIMEOUTS!
b4b3ce
+</longdesc>
b4b3ce
+<shortdesc lang="en">Only check volume group during monitoring</shortdesc>
b4b3ce
+<content type="string" default="false" />
b4b3ce
+</parameter>
b4b3ce
+
b4b3ce
 </parameters>
b4b3ce
 
b4b3ce
 <actions>
b4b3ce
diff --git a/heartbeat/lvm-tag.sh b/heartbeat/lvm-tag.sh
b4b3ce
index 71f53b20..170426e8 100644
b4b3ce
--- a/heartbeat/lvm-tag.sh
b4b3ce
+++ b/heartbeat/lvm-tag.sh
b4b3ce
@@ -160,19 +160,21 @@ lvm_validate_all() {
b4b3ce
 lvm_status() {
b4b3ce
 	local rc=0
b4b3ce
 
b4b3ce
-	# If vg is running, make sure the correct tag is present. Otherwise we
b4b3ce
-	# can not guarantee exclusive activation.
b4b3ce
-	if ! check_tags; then
b4b3ce
-		ocf_exit_reason "WARNING: $OCF_RESKEY_volgrpname is active without the cluster tag, \"$OUR_TAG\""
b4b3ce
-		rc=$OCF_ERR_GENERIC
b4b3ce
-	fi
b4b3ce
+	if ! ocf_is_true "$OCF_RESKEY_volume_group_check_only"; then
b4b3ce
+		# If vg is running, make sure the correct tag is present. Otherwise we
b4b3ce
+		# can not guarantee exclusive activation.
b4b3ce
+		if ! check_tags; then
b4b3ce
+			ocf_exit_reason "WARNING: $OCF_RESKEY_volgrpname is active without the cluster tag, \"$OUR_TAG\""
b4b3ce
+			rc=$OCF_ERR_GENERIC
b4b3ce
+		fi
b4b3ce
 
b4b3ce
-	# make sure the environment for tags activation is still valid
b4b3ce
-	if ! verify_tags_environment; then
b4b3ce
-		rc=$OCF_ERR_GENERIC
b4b3ce
+		# make sure the environment for tags activation is still valid
b4b3ce
+		if ! verify_tags_environment; then
b4b3ce
+			rc=$OCF_ERR_GENERIC
b4b3ce
+		fi
b4b3ce
+		# let the user know if their initrd is older than lvm.conf.
b4b3ce
+		check_initrd_warning
b4b3ce
 	fi
b4b3ce
-	# let the user know if their initrd is older than lvm.conf.
b4b3ce
-	check_initrd_warning
b4b3ce
 
b4b3ce
 	return $rc
b4b3ce
 }
b4b3ce
-- 
b4b3ce
2.17.1
b4b3ce