Product SiteDocumentation Site

10.3.9. Multi-state Resource Agent Requirements

Since multi-state resources are an extension of cloned resources, all the requirements of Clones are also requirements of multi-state resources. Additionally, multi-state resources require two extra actions: demote and promote; these actions are responsible for changing the state of the resource. Like start and stop, they should return OCF_SUCCESS if they completed successfully or a relevant error code if they did not.
The states can mean whatever you wish, but when the resource is started, it must come up in the mode called Slave. From there the cluster will then decide which instances to promote to Master.
In addition to the Clone requirements for monitor actions, agents must also accurately report which state they are in. The cluster relies on the agent to report its status (including role) accurately and does not indicate to the agent what role it currently believes it to be in.

Table 10.8. Role implications of OCF return codes

Monitor Return Code Description
OCF_NOT_RUNNING
Stopped
OCF_SUCCESS
Running (Slave)
OCF_RUNNING_MASTER
Running (Master)
OCF_FAILED_MASTER
Failed (Master)
Other
Failed (Slave)