linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] ocf:lvm2:VolumeGroup RA Question
@ 2016-09-25 16:10 Marc Smith
  2016-11-08 14:23 ` Marc Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Smith @ 2016-09-25 16:10 UTC (permalink / raw)
  To: linux-lvm

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] ocf:lvm2:VolumeGroup RA Question
  2016-09-25 16:10 [linux-lvm] ocf:lvm2:VolumeGroup RA Question Marc Smith
@ 2016-11-08 14:23 ` Marc Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Smith @ 2016-11-08 14:23 UTC (permalink / raw)
  To: linux-lvm

Okay, after testing, I realize we check for the status of an LV so we
can deactivate that when stopping the resource, and its used as the
state for the RA. I'm fine with making a "dummy" LV upon VG creation
in my setup, so I'm all good, disregard.


Thanks,

Marc



On Sun, Sep 25, 2016 at 12:10 PM, Marc Smith <marc.smith@mcc.edu> wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-08 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-25 16:10 [linux-lvm] ocf:lvm2:VolumeGroup RA Question Marc Smith
2016-11-08 14:23 ` Marc Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).