Skip to contentSkip to conversation

cluster/fence/agents/scsi fence_scsi_test.pl s ...

Cluster-devel [email protected] 1 participant 1 message Feb 6, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rohara at sourceware.org 2008-02-06 17:39:17

Modified files:
fence/agents/scsi: fence_scsi_test.pl scsi_reserve

Log message:
BZ 431002 - Support for LVM stripes, mirrors.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/fence_scsi_test.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.6.3&r2=1.1.6.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/scsi_reserve.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.6.11&r2=1.1.6.12

fence/agents/scsi/fence_scsi_test.pl +4 -2
@@ -98,13 +98,15 @@
 sub get_cluster_devices
 {
     my ($in, $out, $err);
-    my $cmd = "lvs --noheadings --separator : -o vg_attr,devices";
+
+    my $cmd = "vgs --config 'global { locking_type = 0 }'" .
+              "    --noheadings --separator : -o vg_attr,pv_name";
 
     my $pid = open3($in, $out, $err, $cmd) or die "$!\n";
 
     waitpid($pid, 0);
 
-    die "Error: unable to exec lvs command.\n" if WEXITSTATUS($?);
+    die "Error: unable to exec vgs command.\n" if WEXITSTATUS($?);
 
     while (<$out>)
     {
fence/agents/scsi/scsi_reserve +6 -3
@@ -16,9 +16,12 @@
 
 # get scsi devices that are part of clustered volumes
 #
-scsi_devices=$( lvs -o vg_attr,devices --noheadings \
-		| awk --posix ' $1 ~ /[-a-z]{5}c/ { print $2 } ' \
-		| sed -e 's/([0-9]*)//' | sort | uniq )
+
+# get physical volumes (devices) that are part of cluster volumes
+#
+scsi_devices=$( vgs --config 'global { locking_type = 0 }' \
+                    --noheadings -o vg_attr,pv_name 2> /dev/null \
+              | awk ' $1 ~ /.*c$/ { print $2 } ' )
 
 # if no scsi devices were found we can exit now
 #