Description of problem: When using mirrors, the query to grab the devices in lvm volumes doesn't work. I have two volumes, a linear and a mirror: linear taft -wi-a- 10.00G /dev/sdd(0) mirror taft Mwi-ao 10.00G mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0) [mirror_mimage_0] taft iwi-ao 10.00G /dev/sdb(0) [mirror_mimage_1] taft iwi-ao 10.00G /dev/sdc(0) [mirror_mlog] taft lwi-ao 4.00M /dev/sdh(0) here's is what the fence_scsi device query returns: [root@taft-04 ~]# lvs -o vg_attr,devices --noheadings wz--nc /dev/sdd(0) wz--nc mirror_mimage_0(0),mirror_mimage_1(0) It returns the proper device for the linear, but not the stripe. Therefore fence_scsi will not work with mirrors. Version-Release number of selected component (if applicable): 2.6.9-67.ELsmp fence-1.32.50-2.fencescsi.test.patch
With the way lvm reports devices, fence_scsi current will only work for linear volumes, not stripes or mirrors. [root@taft-02 ~]# lvs -a -o +devices LV VG Attr LSize Origin Snap% Move Log Copy% Devices LogVol00 VolGroup00 -wi-ao 66.16G /dev/sda2(0) LogVol01 VolGroup00 -wi-ao 1.94G /dev/sda2(2117) linear taft -wi-a- 200.00G /dev/sdb(0) linear taft -wi-a- 200.00G /dev/sdc(0) stripe taft -wi-a- 10.00G /dev/sdd(0),/dev/sde(0) [root@taft-01 ~]# service scsi_reserve start Registering device: /dev/sdb [ OK ] Registering device: /dev/sdc [ OK ] Registering device: /dev/sdd,/dev/sde(0) [FAILED]
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
I think an easier way to go about this, is just to grab the pvs that are in use and give them reservations, instead of parsing lvs different ways based on if it's a mirror, stripe, or linear. Something like the following should work: #!/bin/bash pvs=$(pvs | grep $vg | awk {'print $1'}) for pv in $pvs do used=$(pvs $pv --noheadings -o pv_used | awk {'print $1'}) if [[ $used != 0 ]] then echo "$pv *DOES* need a reservation because it's being used ($used)" else echo "$pv doesn *NOT* need a reservation because it's not being used" fi done
Talked with Corey this morning and tried out some commands on his cluster. Looks like this is a good idea and should be implemented. Basically, the script(s) will get volume groups with the cluster bit set. Then, for every cluster vg we find we'll use pvs to get the devices. Note that this will also give us devices that are in the volume group but not being used. This seems like a good thing. The result is that all physical volumes found in the volume groups -- even those that are not in use -- will get scsi reservations. As Corey pointed out, this should allow the scripts to work with mirrors and stripes. Will also make the code a little more sane.
This was fixed in RHEL4 branch after customer reported problems with LVM stripes, mirrors. Fixed and marked modified. Marking this bug as a duplicate. *** This bug has been marked as a duplicate of 431002 ***