[Pacemaker] Full API description for Fence Agent

Andreas Mock andreas.mock at web.de
Mon Jul 8 03:31:38 EDT 2013


Hi all,

after doing a bigger debugging session and reading the
documentation more than once, I got the fence agent to
work. In this case, the fence agent is a program which
can be used by cman/fenced (RHEL cluster) and by
pacemaker running in this environment as stonith device.

Only for completion:
https://fedorahosted.org/cluster/wiki/FenceAgentAPI

My findings to get it work:
a) Additionally (that was also said somewhere else before)
the agent needs to implement the 'metadata' call which 
prints a xml-document on STDOUT and was adapted from
other scripted fence agents. I couldn't find a spec for
that xml. I let this call also return 0.

b) Contrary to the spec above, stonith_ng seems to
send the parameters 'nodename' and 'port'. As my
stonith agent doesn't need that, I've thrown an exception
scanning these parameters which led to an error in the
logs. => Now these parameters are valid even when not
used.
Someone should clarify how to react on that parameters
correctly when not used. See c)

c) One thing I missed when configuring the stonith
agent in pacemaker was the parameter 'pcmk_host_list'.
Look here
http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Clusters_from_Scratch/_c
onfiguring_stonith.html
to see details. Therefor pacemaker couldn't know
how to fence the node. This was also seen by
issuing the command 'stonith_admin -l <nodename>',
what I was wondering about before solving the problem.

Additions and corrections welcome for all
fence agent programmers.

Best regards
Andreas Mock




-----Ursprüngliche Nachricht-----
Von: Andrew Beekhof [mailto:andrew at beekhof.net] 
Gesendet: Montag, 8. Juli 2013 05:27
An: The Pacemaker cluster resource manager
Betreff: Re: [Pacemaker] Full API description for Fence Agent


On 04/07/2013, at 9:52 PM, Andreas Mock <Andreas.Mock at web.de> wrote:

> Hi Andrew,
> 
> is there some kind of agreement how to tag a message?
> Like (DEBUG/TRACE/ERROR/WARN)?

No.  But pacemaker obeys the general convention of "errors to stderr,
everything else to stdout".

> Is there a way message level filtering is done?

There is no filtering.

> 
> Best regards
> Andreas
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Andrew Beekhof [mailto:andrew at beekhof.net] 
> Gesendet: Donnerstag, 4. Juli 2013 13:41
> An: The Pacemaker cluster resource manager
> Betreff: Re: [Pacemaker] Full API description for Fence Agent
> 
> 
> On 04/07/2013, at 7:24 PM, Andreas Mock <Andreas.Mock at web.de> wrote:
> 
>> Hi digimer,
>> 
>> I would like to take your offer and asking the following:
>> 
>> The API documents says nothing about the correct way
>> of giving messages back to the stonith daemon.
>> So, what is the right way to write error/warn/info messages.
>> 
>> Looking at the scripted agents available I can find a nice
>> mixture of using STDERR and STDOUT.
>> What is the rule here?
>> Can you give insights, whether STDOUT/STDERR is captured by
>> the calling program and logged somewher (and where)?
> 
> In the case of pacemaker, we capture and log both.
> 
>> 
>> By the way: How is it going with merging the stonith/fencing API? ;-)
>> 
>> Best regards
>> Andreas
>> 
>> -----Ursprüngliche Nachricht-----
>> Von: Digimer [mailto:lists at alteeve.ca] 
>> Gesendet: Dienstag, 11. Juni 2013 15:34
>> An: The Pacemaker cluster resource manager
>> Cc: Andreas Mock
>> Betreff: Re: [Pacemaker] Full API description for Fence Agent
>> 
>> Hi Andreas,
>> 
>>  The metadata section of the document has not been added yet, but we 
>> are aware of it missing and are working to add it. The rest of the 
>> document is accurate though. If you build an agent to follow that API, 
>> it will work with red hat's cluster and pacemaker.
>> 
>>  In the meantime, it's not ideal, but if you call any other fence 
>> agent and pass '-o metadata', you will see the output that the cluster 
>> expects. It should be easy to adapt to your new agent.
>> 
>>  If you have any trouble, please don't hesitate to ask here and we 
>> will do our best to help.
>> 
>> digimer
>> 
>> On 06/11/2013 07:04 AM, Andreas Mock wrote:
>>> Hi all,
>>> 
>>> we need to implement a fence_agent (stonith agent) for
>>> cman/corosync/pacemaker (RHEL 6.x). I found the following documentation
>>> https://fedorahosted.org/cluster/wiki/FenceAgentAPI
>>> 
>>> But in this document the required metadata action is not
>>> described. Can anybody point me to a documentation which
>>> is complete?
>>> 
>>> Where is the schema of the xml returned by 'metadata'?
>>> 
>>> What has to be done that a fence_agent can also be used
>>> by pacemaker?
>>> 
>>> What is the right return code of action 'metadata'?
>>> 
>>> Is there some explanation how the stonith/fence parts
>>> play together?
>>> 
>>> Best regards
>>> Andreas Mock
>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>> 
>>> Project Home: http://www.clusterlabs.org
>>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>>> Bugs: http://bugs.clusterlabs.org
>>> 
>> 
>> 
>> -- 
>> Digimer
>> Papers and Projects: https://alteeve.ca/w/
>> What if the cure for cancer is trapped in the mind of a person without 
>> access to education?
>> 
>> 
>> _______________________________________________
>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>> 
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> Bugs: http://bugs.clusterlabs.org
> 
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
> 
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org


_______________________________________________
Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://bugs.clusterlabs.org





More information about the Pacemaker mailing list