Bug 428726 - fence_scsi is broken with lvm stripes and mirrors
Summary: fence_scsi is broken with lvm stripes and mirrors
Keywords:
Status: CLOSED DUPLICATE of bug 431002
Alias: None
Product: Red Hat Cluster Suite
Classification: Retired
Component: fence
Version: 4
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Ryan O'Hara
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 429033
TreeView+ depends on / blocked
 
Reported: 2008-01-14 20:53 UTC by Corey Marthaler
Modified: 2009-04-16 20:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-06 17:41:08 UTC
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2008-01-14 20:53:36 UTC
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

Comment 1 Corey Marthaler 2008-01-14 21:49:45 UTC
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]


Comment 2 RHEL Program Management 2008-01-14 21:56:11 UTC
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.

Comment 3 Corey Marthaler 2008-01-15 21:18:44 UTC
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

Comment 4 Ryan O'Hara 2008-01-16 16:55:22 UTC
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 17:41:08 UTC
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.