Product SiteDocumentation Site

5.3. Specifying the Order in which Resources Should Start/Stop

Ordering constraints tell the cluster the order in which certain resource actions should occur.

Important

Ordering constraints affect only the ordering of resource actions; they do not require that the resources be placed on the same node. If you want resources to be started on the same node and in a specific order, you need both an ordering constraint and a colocation constraint (see Section 5.4, “Placing Resources Relative to other Resources”), or alternatively, a group (see Section 10.1, “Groups - A Syntactic Shortcut”).

5.3.1. Ordering Properties

Table 5.2. Attributes of a rsc_order Element

Field Default Description
id
A unique name for the constraint
first
Name of the resource that the then resource depends on
then
Name of the dependent resource
first-action
start
The action that the first resource must complete before then-action can be initiated for the then resource. Allowed values: start, stop, promote, demote.
then-action
value of first-action
The action that the then resource can execute only after the first-action on the first resource has completed. Allowed values: start, stop, promote, demote.
kind
Mandatory
How to enforce the constraint. Allowed values:
  • Mandatory: then-action will never be initiated for the then resource unless and until first-action successfully completes for the first resource.
  • Optional: The constraint applies only if both specified resource actions are scheduled in the same transition (that is, in response to the same cluster state). This means that then-action is allowed on the then resource regardless of the state of the first resource, but if both actions happen to be scheduled at the same time, they will be ordered.
  • Serialize: Ensure that the specified actions are never performed concurrently for the specified resources. First-action and then-action can be executed in either order, but one must complete before the other can be initiated. An example use case is when resource start-up puts a high load on the host.
symmetrical
TRUE for Mandatory and Optional kinds. FALSE for Serialize kind.
If true, the reverse of the constraint applies for the opposite action (for example, if B starts after A starts, then B stops before A stops). Serialize orders cannot be symmetrical.

Promote and demote apply to the master role of promotable resources.