Blob Blame History Raw
From 42d298191993fd8d851a881a067e09aca2d4a079 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Fri, 27 Jan 2017 10:25:18 +0100
Subject: [PATCH] LVM: fix partial activation

---
 heartbeat/LVM | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/heartbeat/LVM b/heartbeat/LVM
index 79c2791..90a900b 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -548,7 +548,8 @@ LVM_validate_all() {
 		# "unknown device" then another node may have marked a device missing 
 		# where we have access to all of them and can start without issue. 
 		if vgs -o pv_attr --noheadings $OCF_RESKEY_volgrpname 2>/dev/null | grep 'm' > /dev/null 2>&1; then
-			if vgs -o pv_name --noheadings $OCF_RESKEY_volgrpname 2>/dev/null | grep 'unknown device' > /dev/null 2>&1; then
+			case $(vgs -o attr --noheadings $OCF_RESKEY_volgrpname | tr -d ' ') in
+			???p??*)
 				if ! ocf_is_true "$OCF_RESKEY_partial_activation" ; then
 					# We are missing devices and cannot activate partially
 					ocf_exit_reason "Volume group [$VOLUME] has devices missing.  Consider partial_activation=true to attempt to activate partially"
@@ -558,7 +559,8 @@ LVM_validate_all() {
 					# Assume that caused the vgck failure and carry on
 					ocf_log warn "Volume group inconsistency detected with missing device(s) and partial_activation enabled.  Proceeding with requested action."
 				fi
-			fi
+				;;
+			esac
 			# else the vg is partial but all devices are accounted for, so another 
 			# node must have marked the device missing.  Proceed.
 		else