[ClusterLabs] Coming in Pacemaker 2.1.0: OCF resource agent path

kgaillot at redhat.com kgaillot at redhat.com
Thu May 20 10:24:37 EDT 2021


On Thu, 2021-05-20 at 07:53 +0300, Andrei Borzenkov wrote:
> On 20.05.2021 00:33, kgaillot at redhat.com wrote:
> > Hi all,
> > 
> > We squeezed one more feature into the Pacemaker 2.1.0 release for
> > rc2:
> > the ability to search multiple directories for OCF resource agents.
> > 
> > Previously, the OCF root (typically /usr/lib/ocf) could be
> > specified at
> > build time via ./configure --with-ocfdir, and all resource agents
> > had
> > to be in the resource.d directory below that.
> > 
> > Now, the configure script will have three related options:
> > 
> > * --with-ocfdir: This establishes the OCF_ROOT variable that is
> > passed
> > to resource agents, which is used to find the ocf-shellfuncs
> > include
> > files.
> > 
> > * --with-ocfrainstalldir: This specifies where the ocf:pacemaker
> > resource agents will be installed.
> > 
> > * --with-ocfrapath: This is a colon-separated path of directories
> > that
> > will be searched for OCF resource agents (like PATH for agents).
> > 
> > All default to values provided by the resource-agents package, if
> > available. Otherwise, they default to the current behavior.
> > 
> > Example:
> > 
> > ./configure --with-ocfdir=/usr/libexec/ocf \
> >   --with-
> > ocfrapath=/usr/libexec/ocf/resource.d:/usr/lib/ocf/resource.d:/srv/
> > ocf/resource.d
> > 
> > The above will define the OCF_ROOT as /usr/libexec/ocf instead of
> > the
> > usual /usr/lib/ocf. The ocf:pacemaker agents will be installed in
> > /usr/libexec/ocf/resource.d (via default).
> > 
> > When a resource agent needs to be executed, Pacemaker will search
> > in
> > three locations: first, /usr/libexec/ocf/resource.d, and if not
> > found
> > there, /usr/lib/ocf/resource.d, and if not found in either
> > location,
> > /srv/ocf/resource.d.
> > 
> 
> The agent name must still be unique across all directories?

No, the first one found (with the requested provider and agent name)
will be used. As always, different providers can have the same agent
name with no problem.

> Is it
> possible to explicitly refer to /srv/ocf/resource.d?

No, the directories searched must be specified at build time.

> Will pacemaker print search path on startup or how it possible to
> query
> it at runtime?

Not currently. Logging it is a good idea, I'll add that to the execturo
start-up before final release. It will be in the config.log at build
time.

> Will pacemaker print full path to resource agent in logs?

It's currently logged only on execution errors.

> Because now
> actual agent binary may change from invocation to invocation -
> consider
> path /override/ocf/resoyrce.d:/usr/libexec/ocf/resource.d. If I drop
> binary into /override and restart pacemaker it will use new binaries,
> correct?

Correct.

> 
> When path is searched - on every invocation of agent or once on
> startup?

Every invocation.

> Can I change binary without restarting pacemaker?

Yes, agents are not pre-loaded or cached (other than the OS disk
cache).

> 
> 
> > An example use case might be installing custom agents beneath /srv
> > to
> > keep them separate from OS-provided agents. Or, agents installed in
> > various temporary directories for Continuous Integration (CI)
> > testing.
> > Or, a third-party provider installing agents beneath /opt.
> > 
> > In the 2.1.0 release, the path will be a build-time option, for
> > simplicity. If there is demand, it should be possible to make it a
> > run-
> > time option, but that would have some drawbacks, so we're currently
> > not
> > planning to.
-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list