Resource Agents

A resource agent is a standardized interface for a cluster resource. In translates a standard set of operations into steps specific to the resource or application, and interprets their results as success or failure.

Resource Agents have been managed as a separate Linux-HA sub-project since their 1.0 release, which coincided with the Heartbeat 2.99 release. Previously, they were a part of the then-monolithic Heartbeat project, and had no collective name. Later, the Linux-HA Resource Agents and the RHCS Resource Agents sub-projects have been merged. The joint upstream repository is now https://github.com/ClusterLabs/resource-agents

Pacemaker supports three types of Resource Agents,
 * LSB Resource Agents,
 * OCF Resource Agents,
 * legacy Heartbeat Resource Agents

This page is about OCF Resource Agents bundled in the resource-agents package (aka cluster-agents, on Debian based distros), which you should install together with Heartbeat (or Corosync) and Pacemaker.

Supported Operations
Operations which a resource agent my perform on a resource instance include:


 * start: enable or start the given resource
 * stop: disable or stop the given resource
 * monitor: check whether the given resource is running (and/or doing useful work), return status as running or not running
 * validate-all: validate the resource's configuration
 * meta-data: return information about the resource agent itself (used by GUIs and other management utilities, and documentation tools)
 * some more, see OCF Resource Agents and the Pacemaker documentation for details.

Implementation
Most resource agents are coded as shell scripts. This, however, is by no means a necessity – the defined interface is language agnostic.

They are synchronous in nature. That is, you start them, and they complete some time later, and you are expected to wait for them to complete. Certain operations (notably start, stop and monitor) may take considerable time to complete. Considerable time means seconds to many minutes in some cases.

Source Code Repository
Source code for Resource Agents is being maintained in the https://github.com/ClusterLabs/resource-agents Git Repository.