[linux-lvm] ocf:lvm2:VolumeGroup RA Question

Marc Smith marc.smith at mcc.edu
Sun Sep 25 16:10:36 UTC 2016


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:

VolumeGroup_status() {

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

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

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

    return $OCF_SUCCESS

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

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

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.


More information about the linux-lvm mailing list