A resource agent is an encapsulation of information about a particular kind of cluster resource. It knows how to do several kinds of things for its ResourceAgentType, and for a ResourceInstance of its own type. All the types of resource agents we support resemble standard LSB init scripts a great deal.
There are three types of agents supported by v2 of Heartbeat when used with the CRM. In order of encouraged usage they are:
When crm yes is not present in ha.cf, or version 1.x is used, OCFResourceAgents are not supported.
Operations which Heartbeat can perform on a ResourceInstance include:
start - enable or start the given resource
stop - disable or stop the given resource
status - return the status of the given resource
NOTE: In the OCF spec, the status operation has been replaced with monitor.
Additionally, OCF agents must support:
metadata - return the (XML) metadata describing the given ResourceAgentType
Resource agents are typically (but not necessarily) coded as shell scripts. 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.
NOTE: Heartbeat cluster resources should only be started/stopped by Heartbeat itself -- e.g., shared filesystems managed by Heartbeat should not be automounted by the operating system.
HeartbeatResourceAgent, OCFResourceAgent, and LSBResourceAgent