[ClusterLabs] fence agent and using it with pacemaker

Stanislav Kopp staskopp at gmail.com
Thu Feb 11 05:44:46 EST 2016


Hi Jan,

2016-02-10 16:04 GMT+01:00 Jan Pokorný <jpokorny at redhat.com>:
> On 10/02/16 15:20 +0100, Stanislav Kopp wrote:
>> I have general, clarification question about how fence agents work
>> with pacemaker (crmsh in particular). As far I understood STDIN
>> arguments can be used within pacemaker resources and command line
>> arguments in terminal (for testing and scripting?).
>
> Fencing scripts from fence-agents package support both kinds of input;
> Pacemaker will pass the arguments (de facto attributes/parameters of
> the particular stonith resource as specified in CIB via tools like
> crmsh + some fence-agents API specific parameters like "action", but
> user-provided values always take precedence when configured) by piping
> them into the running script, but there is no reason you could not do
> the same from terminal, e.g.:
>
> # /usr/sbin/fence_pve <<EOF
> action=reboot
> ipaddr=...
> [...]
> EOF
>
> (note the verbatim newlines)

Thanks for clarification, it's much clearer now.

>> I have "fence_pve" [1] agent which works fine with command line
>> arguments, but not with pacemaker, it says some parameters like
>> "passwd" or "login" does not exist,
>
> Can you fully specify "it" in the previous sentence, please?
> Or even better, can you mimic what Pacemaker pumps into the agent
> per the example above?
>
> There may be a bug in interaction between fence_pve implementation
> and the fencing library, which does the heavy lifting behind the scenes.

this is my definition of "stonith" resource

##################################################
primitive stonith-pm2-ha stonith:external/fence_pve \
params ipaddr="192.168.122.7" params login="root at pam" passwd="secret"
port="101" action="off" \
op start interval="0" timeout="60s" \
meta target-role="Started" is-managed="true"

location loc_stonith-pm2-ha stonith-pm2-ha -inf: pm2
##################################################

If I'm trying to save it, it says:

#####################################################
ERROR: stonith-pm2-ha: parameter passwd does not exist
ERROR: stonith-pm2-ha: parameter action does not exist
ERROR: stonith-pm2-ha: parameter login does not exist
ERROR: stonith-pm2-ha: parameter ipaddr does not exist
ERROR: stonith-pm2-ha: parameter port does not exist
Do you want to edit again (y/n)?
######################################################

Like I've said if I run it from terminal - no problem:

root at pm2:# fence_pve --action=status --ip=192.168.122.7
--username=root at pam --password=secret --plug=101
Status: ON

may be it is not compatible with pacemaker? because if I run "stonith
-t external/fence_pve -n" it yields:
#########################################
stonith -t external/fence_pve -n
Failed: You have to enter fence address

Please use '-h' for usage

CRIT: external_get_confignames: 'fence_pve getconfignames' failed with rc 1

##########################################

Best,
Stan

>> although STDIN parameters are supported [2]
>>
>> [1] https://github.com/ClusterLabs/fence-agents/blob/master/fence/agents/pve/fence_pve.py
>> [2] https://www.mankier.com/8/fence_pve#Stdin_Parameters
>
> --
> Jan (Poki)
>
> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
>
> 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 Users mailing list