[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: 	RHEL4
Changes by:	jbrassow sourceware org	2007-07-02 21:59:34

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.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/lvm.sh.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.6&r2=1.1.2.7

--- cluster/rgmanager/src/resources/lvm.sh	2007/05/29 14:35:19	1.1.2.6
+++ cluster/rgmanager/src/resources/lvm.sh	2007/07/02 21:59:34	1.1.2.7
@@ -71,7 +71,7 @@
 	    <content type="string"/>
         </parameter>
 
-        <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.
             </longdesc>
@@ -465,6 +465,17 @@
 		exit 0
 	fi
 
+	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"
+		exit $OCF_ERR_GENERIC
+	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]