[Pacemaker] Pacemaker stop behaviour when underlying resource is unavailable

pavan tc pavan.tc at gmail.com
Fri Dec 14 10:32:50 UTC 2012


Hi,

I have structured my multi-state resource agent as below when the
underlying resource becomes unavailable for some reason:

monitor()
{
    state=get_primitive_resource_state()

    ...
    ...
    if ($state == unavailable)
       return $OCF_NOT_RUNNING

    ...
    ...
}

stop()
{
    monitor()
    ret=$?

    if (ret == $OCF_NOT_RUNNING)
       return $OCF_SUCCESS
}

start()
{
    start_primitive()
    if (start_primitive_failure)
        return OCF_ERR_GENERIC
}

The idea is to make sure that stop does not fail when the underlying
resource goes away.
(Otherwise I see that the resource gets to an unmanaged state)
Also, the expectation is that when the resource comes back, it joins the
cluster without much fuss.

What I see is that pacemaker calls stop twice and if it finds that stop
returns success,
it does not continue with monitor any more. I also do not see an attempt to
start.

Is there a way to keep the monitor going in such circumstances?
Am I using incorrect resource agent return codes?

Thanks,
Pavan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20121214/82850e35/attachment-0003.html>


More information about the Pacemaker mailing list