Bug 428726
| Summary: | fence_scsi is broken with lvm stripes and mirrors | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Cluster Suite | Reporter: | Corey Marthaler <cmarthal> |
| Component: | fence | Assignee: | Ryan O'Hara <rohara> |
| Status: | CLOSED DUPLICATE | QA Contact: | Cluster QE <mspqa-list> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 4 | CC: | cluster-maint |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2008-02-06 17:41:08 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 429033 | ||
|
Description
Corey Marthaler
2008-01-14 20:53:36 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] 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. |