[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/rgmanager/src/resources lvm.sh

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	jbrassow sourceware org	2007-07-02 21:59:04

Modified files:
	rgmanager/src/resources: lvm.sh 

Log message:
	<Previous check-in>
	Require vg_name to be unique.  Allowing multiple LVs from the same VG
	on different machines can lead to races when updating metadata during
	device failures.
	</Previous check-in>
	We can do better.  This patch puts the validation in lvm.sh so that
	it can print out a understandable error message.


--- cluster/rgmanager/src/resources/lvm.sh	2007/05/29 14:37:00
+++ cluster/rgmanager/src/resources/lvm.sh	2007/07/02 21:59:04
@@ -71,7 +71,7 @@
 	    <content type="string"/>
-        <parameter name="vg_name" required="1" unique="1">
+        <parameter name="vg_name" required="1">
             <longdesc lang="en">
                 If you can see this, your GUI is broken.
@@ -465,6 +465,17 @@
 		exit 0
+	if ! lvs $OCF_RESKEY_vg_name >& /dev/null; then
+		lv_count=0
+	else
+		lv_count=`lvs --noheadings -o name $OCF_RESKEY_vg_name | grep -v _mlog | grep -v _mimage | grep -v nconsistent | wc -l`
+	fi
+	if [ $lv_count -gt 1 ]; then
+		ocf_log err "HA LVM requires Only one logical volume per volume group."
+		ocf_log err "There are currently $lv_count logical volumes in $OCF_RESKEY_vg_name"
+		ocf_log err "Failing HA LVM start of $OCF_RESKEY_vg_name/$OCF_RESKEY_lv_name"
+	fi
 	ha_lvm_proper_setup_check || exit 1
 	if [ -z $OCF_RESKEY_lv_name ]; then

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]