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

jbrassow at sourceware.org jbrassow at sourceware.org
Wed May 9 18:00:45 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	jbrassow at sourceware.org	2007-05-09 18:00:45

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

Log message:
	People seem to think that they have to setup lvm in rgmanager even though they
	are using clvm.  This causes the two to collide during use.
	
	The HA LVM resource script should detect if a volume is clustered and ignore it.

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

--- cluster/rgmanager/src/resources/lvm.sh	2007/04/18 18:14:56	1.5
+++ cluster/rgmanager/src/resources/lvm.sh	2007/05/09 18:00:44	1.6
@@ -236,7 +236,12 @@
 	# Check if device is active
 	#
 	if [[ ! $(lvs -o attr --noheadings $lv_path) =~ ....a. ]]; then
-	    return $OCF_ERR_GENERIC
+		return $OCF_ERR_GENERIC
+	fi
+
+	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
+		ocf_log notice "$OCF_RESKEY_vg_name is a cluster volume.  Ignoring..."
+		return $OCF_SUCCESS
 	fi
 
 	#
@@ -429,6 +434,11 @@
 
 case $1 in
 start)
+	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
+		ocf_log notice "$OCF_RESKEY_vg_name is a cluster volume.  Ignoring..."
+		exit 0
+	fi
+
 	if [ -z $OCF_RESKEY_lv_name ]; then
 		vg_activate start || exit 1
 	else
@@ -447,6 +457,11 @@
 	;;
 		    
 stop)
+	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
+		ocf_log notice "$OCF_RESKEY_vg_name is a cluster volume.  Ignoring..."
+		exit 0
+	fi
+
 	if [ -z $OCF_RESKEY_lv_name ]; then
 		vg_activate stop || exit 1
 	else
@@ -467,6 +482,11 @@
 	;;
 
 validate-all)
+	if [[ $(vgs -o attr --noheadings $OCF_RESKEY_vg_name) =~ .....c ]]; then
+		ocf_log notice "$OCF_RESKEY_vg_name is a cluster volume.  Ignoring..."
+		exit 0
+	fi
+
 	verify_all
 	rv=$?
 	;;




More information about the Cluster-devel mailing list