[ClusterLabs] Is there a python package for pacemaker ?

Ken Gaillot kgaillot at redhat.com
Wed Feb 2 13:06:27 EST 2022

On Wed, 2022-02-02 at 18:46 +0100, Lentes, Bernd wrote:
> Hi,
> i need to write some scripts for our cluster. Until now i wrote bash
> scripts.
> But i like to learn python. Is there a package for pacemaker ?
> What i found is: https://pypi.org/project/pacemaker/ and i'm not sure
> what that is.
> Thanks.
> Bernd

Not currently (that's an unrelated project I wasn't aware of). It is a
goal to make one, but time hasn't been available.

We're taking a big step towards it by creating a high-level C API for
Pacemaker that's essentially equivalent to how the command-line tools
work. It will be much easier to wrap this API in Python. There are
already high-level API equivalents of crmadmin and crm_simulate, and
the crm_mon equivalent is expected in the next release.

In the meantime, the easiest approach is probably just to use the
subprocess module to execute the Pacemaker command-line tools to do
what you want.
Ken Gaillot <kgaillot at redhat.com>

More information about the Users mailing list