Bug 428726 - fence_scsi is broken with lvm stripes and mirrors
fence_scsi is broken with lvm stripes and mirrors
Status: CLOSED DUPLICATE of bug 431002
Product: Red Hat Cluster Suite
Classification: Red Hat
Component: fence (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Ryan O'Hara
Cluster QE
Depends On:
Blocks: 429033
  Show dependency treegraph
Reported: 2008-01-14 15:53 EST by Corey Marthaler
Modified: 2009-04-16 16:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-02-06 12:41:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Corey Marthaler 2008-01-14 15:53:36 EST
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                                   
  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                                   
  [mirror_mimage_1] taft       iwi-ao 10.00G                                   
  [mirror_mlog]     taft       lwi-ao  4.00M                                   

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):
Comment 1 Corey Marthaler 2008-01-14 16:49:45 EST
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                              

[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]
Comment 2 RHEL Product and Program Management 2008-01-14 16:56:11 EST
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
Comment 3 Corey Marthaler 2008-01-15 16:18:44 EST
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:


pvs=$(pvs | grep $vg | awk {'print $1'})

for pv in $pvs
        used=$(pvs $pv --noheadings -o pv_used | awk {'print $1'})
        if [[ $used != 0 ]]
                echo "$pv *DOES* need a reservation because it's being used ($used)"
                echo "$pv doesn *NOT* need a reservation because it's not being
Comment 4 Ryan O'Hara 2008-01-16 11:55:22 EST
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.

Comment 5 Ryan O'Hara 2008-02-06 12:41:08 EST
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 ***

Note You need to log in before you can comment on or make changes to this bug.