[ClusterLabs] How to implement a fencing agent

Jan Pokorný jpokorny at redhat.com
Thu Aug 9 17:37:47 EDT 2018


On 09/08/18 14:10 -0500, Ryan Thomas wrote:
> I did some more investigation and was able to answer two of my questions:
> 
> First, why did "pcs stonith list" not show my fence_foo agent? pcs runs the
> meta-data action on the agent to get the description.  Since my fence_foo
> agent wasn't implemented, this would fail, and pcs would not display it.
> If I ran "pcs stonith list --nodesc" then the agent would be shown.

Good work figuring this out.

> Second, how should I import the fencing.py lib?  I noticed that all the
> exiting fence_agents did explicitly add the path the the fencing lib, by
> sys.path.append(PATH).
> 
> My only remaining question:  Is "yum install fence-agents-common.x86_64"
> the appropriate way to install the fencing.py library?

That really depends on which system/distribution you are targeting.
If for instance it's for Enterprise Linux incl. CentOS family or
Fedora + derivatives, then the proper answer is:

  "fence-agents-common" is relatively stable implementation detail
  but watch for any sort of rename (and/or file move since you can
  also "yum install /usr/share/fence/fencing.py")

And you've actually revealed a pitiful packaging deficiencies
-- please omit the architecture specifier (.x86_64) when referring
to that package as it will eventually become "noarch" and your
fully qualified identification will have stopped working then:
https://src.fedoraproject.org/rpms/fence-agents/pull-request/4

> I suspect there may not be any best practice in this area.

I think you are first to explore this path (at least so openly)
since the common practice used to be that even 3rd party contributed,
shared agents ended up as a direct part of fence-agents project in
the past.  Which of course stipulates you would be OK with opensourcing
your final work and licensing that under the same terms (variations
likely negotiable).

Hope this helps.

-- 
Nazdar,
Jan (Poki)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20180809/1cffb5f4/attachment-0002.sig>


More information about the Users mailing list