ocf:lvm2:VolumeGroup RA Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm using the "VolumeGroup" RA that comes with LVM2. On the machines
I'm testing with, we are currently using version 2_02_129 of LVM2.

My question is regarding this function in the VolumeGroup RA:

--snip--
VolumeGroup_status() {

    VGOUT=`vgdisplay -v $OCF_RESKEY_volgrpname 2>&1` || exit $OCF_ERR_GENERIC
    echo "$VGOUT" | grep -i 'Status[ \t]*available' >/dev/null
    rc=$?

    if [ $rc -eq 0 ]; then
    ocf_log debug "LVM Volume Group $OCF_RESKEY_volgrpname is
available (started)"
    else
    ocf_log debug "LVM Volume Group $OCF_RESKEY_volgrpname is not
available (stopped)"
    return $OCF_NOT_RUNNING
    fi

    if echo "$VGOUT" | grep -i 'Access.*read/write' >/dev/null; then
    ocf_log debug "Volume $OCF_RESKEY_volgrpname is available
read/write (running)"
    else
    ocf_log debug "Volume $OCF_RESKEY_volgrpname is available
read-only (running)"
    fi

    return $OCF_SUCCESS
}
--snip--

And what prompted me to question this function, is I noticed that
unless an LV is created on my VG, this function doesn't return
OCF_SUCCESS.

When looking at the vgdisplay output in the first few lines of the
function, there are several different output lines that contains the
string "Status" (assuming the command exists successfully):

# vgdisplay -v vmdk5 2>&1 | grep Status
  VG Status             resizable
  LV Status              available
  PV Status             allocatable

In the next line of the function where we grep for "Status" we don't
specify a specific line (eg, "VG Status", "LV Status", or "PV
Status").

My question is this: Is the intention that we only return OCF_SUCCESS
if a LV is available? In my setup, I'd like the resource to start/run
properly without having any LV created. Any harm in updating the RA to
look for "VG Status" and return success if it finds "resizable" -- I'm
not sure what the other status strings might be? Is "available" valid
for that line as well?


Thanks for your time.


--Marc

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/



[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux