Copyright © 2010, 2011 LINBIT HA-Solutions GmbH
Copyright © 2011 Novell, Inc.
Copyright © 2011 SUSE Linux GmbH
Copyright © 2011 hastexo Professional Services GmbH
The text of and illustrations in this document are licensed under a Creative Commons Attribution–Share Alike 3.0 Unported license (“CC-BY-SA”).
- A summary of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/.
- The full license text is available at http://creativecommons.org/licenses/by-sa/3.0/legalcode.
- In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
|Revision 1.0.3||July 26, 2012||FGH|
|Revision 1.0.2||November 18, 2011||FGH|
|Revision 1.0.1||January 3, 2011||FGH|
|Revision 1.0.0||December 13, 2010||FGH|
Table of Contents
- 1. Introduction
- 2. API definitions
- 3. Return codes
- 4. Resource agent structure
- 5. Resource agent actions
- 6. Script variables
- 7. Convenience functions
- 7.1. Logging:
- 7.2. Testing for binaries:
- 7.3. Executing commands and capturing their output:
- 7.4. Locks:
- 7.5. Testing for numerical values:
- 7.6. Testing for boolean values:
- 7.7. Pseudo resources:
- 7.1. Logging:
- 8. Conventions
- 9. Special considerations
- 10. Testing resource agents
- 11. Installing and packaging resource agents
This document is to serve as a guide and reference for all developers, maintainers, and contributors working on OCF (Open Cluster Framework) compliant cluster resource agents. It explains the anatomy and general functionality of a resource agent, illustrates the resource agent API, and provides valuable hints and tips to resource agent authors.
A resource agent is an executable that manages a cluster resource. No formal definition of a cluster resource exists, other than “anything a cluster manages is a resource.” Cluster resources can be as diverse as IP addresses, file systems, database services, and entire virtual machines — to name just a few examples.
Any Open Cluster Framework (OCF) compliant cluster management application is capable of managing resources using the resource agents described in this document. At the time of writing, two OCF compliant cluster management applications exist for the Linux platform:
- Pacemaker, a cluster manager supporting both the Corosync and Heartbeat cluster messaging frameworks. Pacemaker evolved out of the Linux-HA project.
- RGmanager, the cluster manager bundled in Red Hat Cluster Suite. It supports the Corosync cluster messaging framework exclusively.
An OCF compliant resource agent can be implemented in any programming language. The API is not language specific. However, most resource agents are implemented as shell scripts, which is why this guide primarily uses example code written in shell language.