15.4. Configuring Ticket Dependencies
The rsc_ticket
constraint lets you specify the resources depending on a certain ticket. Together with the constraint, you can set a loss-policy
that defines what should happen to the respective resources if the ticket is revoked.
The attribute loss-policy
can have the following values:
- fence
Fence the nodes that are running the relevant resources.
- stop
Stop the relevant resources.
- freeze
Do nothing to the relevant resources.
- demote
Demote relevant resources that are running in master mode to slave mode.
An example to configure a rsc_ticket
constraint:
<rsc_ticket id="rsc1-req-ticketA" rsc="rsc1" ticket="ticketA" loss-policy="fence"/>
This creates a constraint with the ID rsc1-req-ticketA
. It defines that the resource rsc1
depends on ticketA
and that the node running the resource should be fenced in case ticketA
is revoked.
If resource rsc1
was a multi-state resource that can run in master or slave mode, you may want to configure that only rsc1's
master mode depends on ticketA
. With the following configuration, rsc1
will be demoted to slave mode if ticketA
is revoked:
<rsc_ticket id="rsc1-req-ticketA" rsc="rsc1" rsc-role="Master" ticket="ticketA" loss-policy="demote"/>
You can create more rsc_ticket
constraints to let multiple resources depend on the same ticket.
rsc_ticket
also supports resource sets. So one can easily list all the resources in one rsc_ticket
constraint. For example:
<rsc_ticket id="resources-dep-ticketA" ticket="ticketA" loss-policy="fence">
<resource_set id="resources-dep-ticketA-0" role="Started">
<resource_ref id="rsc1"/>
<resource_ref id="group1"/>
<resource_ref id="clone1"/>
</resource_set>
<resource_set id="resources-dep-ticketA-1" role="Master">
<resource_ref id="ms1"/>
</resource_set>
</rsc_ticket>
In the example, there are two resource sets for listing the resources with different roles
in one rsc_ticket
constraint. There’s no dependency between the two resource sets. And there’s no dependency among the resources within a resource set. Each of the resources just depends on ticketA
.
Referencing resource templates in rsc_ticket
constraints, and even referencing them within resource sets, is also supported.
If you want other resources to depend on further tickets, create as many constraints as necessary with rsc_ticket
.