1
<chapter id="ch-advanced-resources"><title>Advanced Resource Types</title>
2
<section id="group-resources">
3
<title><indexterm significance="preferred"><primary>Group Resources</primary></indexterm>
4
<indexterm><primary>Resources</primary><secondary>Groups</secondary></indexterm>
5
Groups - A Syntactic Shortcut</title>
7
One of the most common elements of a cluster is a set of resources that need to be located together, start sequentially, and stop in the reverse order.
8
To simplify this configuration we support the concept of groups.
11
<title>An example group</title>
12
<programlisting><![CDATA[ <group id="shortcut">
13
<primitive id="Public-IP" class="ocf" type="IPaddr" provider="heartbeat">
14
<instance_attributes id="params-public-ip">
15
<nvpair id="public-ip-addr" name="ip" value="1.2.3.4"/>
16
</instance_attributes>
18
<primitive id="Email" class="lsb" type="exim"/>
19
</group> ]]> </programlisting>
22
Although the example above contains only two resources, there is no limit to the number of resources a group can contain.
23
The example is also sufficient to explain the fundamental properties of a group:
25
<itemizedlist spacing="compact">
26
<listitem><para>Resources are started in the order they appear in (<literal>Public-IP</literal> first, then <literal>Email</literal>)</para></listitem>
27
<listitem><para>Resources are stopped in the reverse order to which they appear in (<literal>Email</literal> first, then <literal>Public-IP</literal>)</para></listitem>
29
<para>If a resource in the group can't run anywhere, then nothing after that is allowed to run, too.
30
<itemizedlist spacing="compact">
31
<listitem><para>If <literal>Public-IP</literal> can't run anywhere, neither can <literal>Email</literal>;</para></listitem>
32
<listitem><para>but if <literal>Email</literal> can't run anywhere, this does not affect <literal>Public-IP</literal> in any way</para></listitem>
37
<para>The group above is logically equivalent to writing:</para>
39
<title>How the cluster sees a group resource</title>
40
<programlisting><![CDATA[ <configuration>
42
<primitive id="Public-IP" class="ocf" type="IPaddr" provider="heartbeat">
43
<instance_attributes id="params-public-ip">
44
<nvpair id="public-ip-addr" name="ip" value="1.2.3.4"/>
45
</instance_attributes>
47
<primitive id="Email" class="lsb" type="exim"/>
50
<rsc_colocation id="xxx" rsc="Email" with-rsc="Public-IP" score="INFINITY"/>
51
<rsc_order id="yyy" first="Public-IP" then="Email"/>
53
</configuration> ]]> </programlisting>
55
<para>Obviously as the group grows bigger, the reduced configuration effort can become significant.</para>
56
<para>Another (typical) example of a group is a DRBD volume, the filesystem mount, an IP address, and an application that uses them.</para>
58
<title>Properties</title>
60
<title>Properties of a Group Resource</title>
62
<colspec colwidth="1*"/>
63
<colspec colwidth="4*"/>
67
<entry>Description</entry>
72
<entry><indexterm significance="preferred"><primary>id</primary><secondary>Group Resource Property</secondary></indexterm>
73
<indexterm><primary>Group Resource Properties</primary><secondary>id</secondary></indexterm>
74
<indexterm><primary>Resource</primary><secondary>Group Property</secondary><tertiary>id</tertiary></indexterm>
76
<entry>Your name for the group</entry>
83
<title>Options</title>
84
<para>Options inherited from <link linkend="s-resource-options">simple resources</link>: <literal>priority, target-role, is-managed</literal></para>
87
<title>Instance Attributes</title>
88
<para>Groups have no instance attributes, however any that are set here will be inherited by the group's children.</para>
91
<title>Contents</title>
93
Groups may only contain a collection of <link linkend="s-resource-supported">primitive</link> cluster resources.
94
To refer to the child of a group resource, just use the child's id instead of the group's.
98
<title>Constraints</title>
99
<para>Although it is possible to reference the group's children in constraints, it is usually preferable to use the group's name instead.</para>
101
<title>Example constraints involving groups</title>
102
<programlisting><![CDATA[ <constraints>
103
<rsc_location id="group-prefers-node1" rsc="shortcut" node="node1" score="500"/>
104
<rsc_colocation id="webserver-with-group" rsc="Webserver" with-rsc="shortcut"/>
105
<rsc_order id="start-group-then-webserver" first="Webserver" then="shortcut"/>
106
</constraints> ]]> </programlisting>
110
<title><indexterm><primary>resource-stickiness</primary><secondary>of a Group Resource</secondary></indexterm>
112
<para>Stickiness, the measure of how much a resource wants to stay where it is, is additive in groups.
113
Every active resource of the group will contribute its stickiness value to the group's total.
114
So if the default <literal>resource-stickiness</literal> is 100, and a group has seven members, five of which are active, then the group as a whole will prefer its current location with a score of 500.</para>
117
<section id="s-resource-clone">
118
<title><indexterm significance="preferred"><primary>Clone Resources</primary></indexterm>
119
<indexterm><primary>Resources</primary><secondary>Clones</secondary></indexterm>
120
Clones - Resources That Get Active on Multiple Hosts</title>
122
Clones were initially conceived as a convenient way to start N instances of an IP resource and have them distributed throughout the cluster for load balancing.
123
They have turned out to quite useful for a number of purposes including integrating with Red Hat's DLM, the fencing subsystem, and OCFS2.
125
<para>You can clone any resource, provided the resource agent supports it.</para>
126
<para>Three types of cloned resources exist:
127
<itemizedlist spacing="compact">
128
<listitem><para>Anonymous</para></listitem>
129
<listitem><para>Globally Unique</para></listitem>
130
<listitem><para>Stateful</para></listitem>
131
</itemizedlist></para>
133
Anonymous clones are the simplest type.
134
These resources behave completely identically everywhere they are running.
135
Because of this, there can only be one copy of an anonymous clone active per machine.
138
Globally unique clones are distinct entities.
139
A copy of the clone running on one machine is not equivalent to another instance on another node.
140
Nor would any two copies on the same node be equivalent.
142
<para>Stateful clones are covered later in <xref linkend="s-resource-multistate"/>.</para>
144
<title>An example clone</title>
145
<programlisting><![CDATA[ <clone id="apache-clone">
146
<meta_attributes id="apache-clone-meta">
147
<nvpair id="apache-unique" name="globally-unique" value="false"/>
149
<primitive id="apache" class="lsb" type="apache"/>
150
</clone> ]]> </programlisting>
153
<title>Properties</title>
155
<title>Properties of a Clone Resource</title>
157
<colspec colwidth="2*"/>
158
<colspec colwidth="7*"/>
162
<entry>Description</entry>
165
<entry><indexterm significance="preferred"><primary>id</primary><secondary>Clone Resource Property</secondary></indexterm>
166
<indexterm><primary>Clone Resource Properties</primary><secondary>id</secondary></indexterm>
167
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>id</tertiary></indexterm>
169
<entry>Your name for the clone</entry>
176
<title>Options</title>
177
<para>Options inherited from <link linkend="s-resource-supported">simple resources</link>: <literal>priority, target-role, is-managed</literal></para>
179
<title>Clone specific configuration options</title>
181
<colspec colwidth="2*"/>
182
<colspec colwidth="7*"/>
186
<entry>Description</entry>
191
<entry><indexterm significance="preferred"><primary>clone-max Clone Resource Property</primary></indexterm>
192
<indexterm><primary>Clone Resource Properties</primary><secondary>clone-max</secondary></indexterm>
193
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>clone-max</tertiary></indexterm>
195
<entry>How many copies of the resource to start. Defaults to the number of nodes in the cluster.</entry>
198
<entry><indexterm significance="preferred"><primary>clone-node-max Clone Resource Property</primary></indexterm>
199
<indexterm><primary>Clone Resource Properties</primary><secondary>clone-node-max</secondary></indexterm>
200
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>clone-node-max</tertiary></indexterm>
201
clone-node-max</entry>
202
<entry>How many copies of the resource can be started on a single node; default <emphasis>1</emphasis>.</entry>
205
<entry><indexterm significance="preferred"><primary>notify Clone Resource Property</primary></indexterm>
206
<indexterm><primary>Clone Resource Properties</primary><secondary>notify</secondary></indexterm>
207
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>notify</tertiary></indexterm>
209
<entry>When stopping or starting a copy of the clone, tell all the other copies beforehand and when the action was successful. Allowed values: <emphasis>false</emphasis>, <literal>true</literal>
213
<entry><indexterm significance="preferred"><primary>globally-unique Clone Resource Property</primary></indexterm>
214
<indexterm><primary>Clone Resource Properties</primary><secondary>globally-unique</secondary></indexterm>
215
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>globally-unique</tertiary></indexterm>
216
globally-unique</entry>
217
<entry>Does each copy of the clone perform a different function? Allowed values: <emphasis>false</emphasis>, <literal>true</literal></entry>
220
<entry><indexterm significance="preferred"><primary>ordered Clone Resource Property</primary></indexterm>
221
<indexterm><primary>Clone Resource Properties</primary><secondary>ordered</secondary></indexterm>
222
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>ordered</tertiary></indexterm>
224
<entry>Should the copies be started in series (instead of in parallel). Allowed values: <emphasis>false</emphasis>, <literal>true</literal>
228
<entry><indexterm significance="preferred"><primary>interleave Clone Resource Property</primary></indexterm>
229
<indexterm><primary>Clone Resource Properties</primary><secondary>interleave</secondary></indexterm>
230
<indexterm><primary>Resource</primary><secondary>Clone Property</secondary><tertiary>interleave</tertiary></indexterm>
232
<entry>Changes the behavior of ordering constraints (between clones/masters) so that instances can start/stop as soon as their peer instance has (rather than waiting for every instance of the other clone has). Allowed values: <emphasis>false</emphasis>, <literal>true</literal>
240
<title>Instance Attributes</title>
241
<para>Clones have no instance attributes; however, any that are set here will be inherited by the clone's children.</para>
244
<title>Contents</title>
245
<para>Clones must contain exactly one group or one regular resource.</para>
248
You should never reference the name of a clone's child.
249
If you think you need to do this, you probably need to re-evaluate your design.
251
<para><!-- ws --> </para>
255
<title>Constraints</title>
257
In most cases, a clone will have a single copy on each active cluster node.
258
If this is not the case, you can indicate which nodes the cluster should preferentially assign copies to with resource location constraints.
259
These constraints are written no differently to those for regular resources except that the clone's id is used.
262
Ordering constraints behave slightly differently for clones.
263
In the example below, <literal>apache-stats</literal> will wait until all copies of the clone that need to be started have done so before being started itself.
264
Only if <emphasis>no</emphasis> copies can be started <literal>apache-stats</literal> will be prevented from being active.
265
Additionally, the clone will wait for <literal>apache-stats</literal> to be stopped before stopping the clone.
268
Colocation of a regular (or group) resource with a clone means that the resource can run on any machine with an active copy of the clone.
269
The cluster will choose a copy based on where the clone is running and the resource's own location preferences.
272
Colocation between clones is also possible.
273
In such cases, the set of allowed locations for the clone is limited to nodes on which the clone is (or will be) active.
274
Allocation is then performed as normally.
277
<title>Example constraints involving clones</title>
278
<programlisting><![CDATA[ <constraints>
279
<rsc_location id="clone-prefers-node1" rsc="apache-clone" node="node1" score="500"/>
280
<rsc_colocation id="stats-with-clone" rsc="apache-stats" with="apache-clone"/>
281
<rsc_order id="start-clone-then-stats" first="apache-clone" then="apache-stats"/>
282
</constraints> ]]> </programlisting>
286
<title>Stickiness</title>
288
<indexterm><primary>resource-stickiness</primary><secondary>of a Clone Resource</secondary></indexterm>
289
To achieve a stable allocation pattern, clones are slightly sticky by default.
290
If no value for <literal>resource-stickiness</literal> is provided, the clone will use a value of 1.
291
Being a small value, it causes minimal disturbance to the score calculations of other resources but is enough to prevent Pacemaker from needlessly moving copies around the cluster.
295
<title>Resource Agent Requirements</title>
297
Any resource can be used as an anonymous clone, as it requires no additional support from the resource agent.
298
Whether it makes sense to do so depends on your resource and its resource agent.
301
Globally unique clones do require some additional support in the resource agent.
302
In particular, it must only respond with <envar>${OCF_SUCCESS}</envar> if the node has that exact instance active.
303
All other probes for instances of the clone should result in <envar>${OCF_NOT_RUNNING}</envar>.
304
Unless of course they are failed, in which case they should return one of the other OCF error codes.
306
<para>Copies of a clone are identified by appending a colon and a numerical offset, eg. <literal>apache:2</literal>.</para>
307
<para>Resource agents can find out how many copies there are by examining the <envar>OCF_RESKEY_CRM_meta_clone_max</envar> environment variable and which copy it is by examining <envar>OCF_RESKEY_CRM_meta_clone</envar>.</para>
309
You should not make any assumptions (based on <envar>OCF_RESKEY_CRM_meta_clone</envar>) about which copies are active.
310
In particular, the list of active copies will not always be an unbroken sequence, nor always start at 0.
314
<title>Notifications</title>
316
Supporting notifications requires the <literal>notify</literal> action to be implemented.
317
Once supported, the notify action will be passed a number of extra variables which, when combined with additional context, can be used to calculate the current state of the cluster and what is about to happen to it.
320
<title>Environment variables supplied with Clone notify actions</title>
322
<colspec colwidth="5*"/>
323
<colspec colwidth="4*"/>
326
<entry>Variable</entry>
327
<entry>Description</entry>
332
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_type</tertiary></indexterm>
333
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_type</secondary></indexterm>
334
OCF_RESKEY_CRM_meta_notify_type</entry>
335
<entry>Allowed values: <literal>pre</literal>, <literal>post</literal></entry>
338
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_operation</tertiary></indexterm>
339
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_operation</secondary></indexterm>
340
OCF_RESKEY_CRM_meta_notify_operation</entry>
341
<entry>Allowed values: <literal>start</literal>, <literal>stop</literal></entry>
344
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_start_resource</tertiary></indexterm>
345
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_start_resource</secondary></indexterm>
346
OCF_RESKEY_CRM_meta_notify_start_resource</entry>
347
<entry>Resources to be started</entry>
350
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_stop_resource</tertiary></indexterm>
351
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_stop_resource</secondary></indexterm>
352
OCF_RESKEY_CRM_meta_notify_stop_resource</entry>
353
<entry>Resources to be stopped</entry>
356
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_active_resource</tertiary></indexterm>
357
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_active_resource</secondary></indexterm>
358
OCF_RESKEY_CRM_meta_notify_active_resource</entry>
359
<entry>Resources that are running</entry>
362
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_inactive_resource</tertiary></indexterm>
363
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_inactive_resource</secondary></indexterm>
364
OCF_RESKEY_CRM_meta_notify_inactive_resource</entry>
365
<entry>Resources that are not running</entry>
368
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_start_uname</tertiary></indexterm>
369
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_start_uname</secondary></indexterm>
370
OCF_RESKEY_CRM_meta_notify_start_uname</entry>
371
<entry>Nodes on which resources will be started</entry>
374
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_stop_uname</tertiary></indexterm>
375
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_stop_uname</secondary></indexterm>
376
OCF_RESKEY_CRM_meta_notify_stop_uname</entry>
377
<entry>Nodes on which resources will be stopped</entry>
380
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_active_uname</tertiary></indexterm>
381
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_active_uname</secondary></indexterm>
382
OCF_RESKEY_CRM_meta_notify_active_uname</entry>
383
<entry>Nodes on which resources are running</entry>
386
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>meta_notify_inactive_uname</tertiary></indexterm>
387
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_inactive_uname</secondary></indexterm>
388
OCF_RESKEY_CRM_meta_notify_inactive_uname</entry>
389
<entry>Nodes on which resources are not running</entry>
394
<para>The variables come in pairs, such as <envar>OCF_RESKEY_CRM_meta_notify_start_resource</envar> and <envar>OCF_RESKEY_CRM_meta_notify_start_uname</envar> and should be treated as an array of whitespace separated elements.</para>
395
<para>Thus in order to indicate that <literal>clone:0</literal> will be started on <literal>sles-1</literal>, <literal>clone:2</literal> will be started on <literal>sles-3</literal>, and <literal>clone:3</literal> will be started on <literal>sles-2</literal>, the cluster would set</para>
397
<title>Example notification variables</title>
398
<programlisting><envar>
399
OCF_RESKEY_CRM_meta_notify_start_resource</envar>="clone:0 clone:2 clone:3" <envar>
400
OCF_RESKEY_CRM_meta_notify_start_uname</envar>="sles-1 sles-3 sles-2"
405
<title>Proper Interpretation of Notification Environment Variables</title>
406
<para>Pre-notification (stop):
407
<itemizedlist spacing="compact">
409
<para>Active resources: <envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para>
412
<para>Inactive resources: <envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para>
415
<para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para>
418
<para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para>
420
</itemizedlist></para>
421
<para>Post-notification (stop) / Pre-notification (start):
422
<itemizedlist spacing="compact">
424
<para>Active resources
425
<itemizedlist spacing="compact" mark="none">
426
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
427
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
432
<para>Inactive resources
433
<itemizedlist spacing="compact" mark="none">
434
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
435
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar> </para></listitem>
440
<para>Resources that were started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para>
443
<para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para>
445
</itemizedlist></para>
446
<para>Post-notification (start):
447
<itemizedlist spacing="compact">
449
<para>Active resources:
450
<itemizedlist spacing="compact" mark="none">
451
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
452
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
453
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
458
<para>Inactive resources:
459
<itemizedlist spacing="compact" mark="none">
460
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
461
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
462
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
467
<para>Resources that were started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para>
470
<para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para>
472
</itemizedlist></para>
475
<section id="s-resource-multistate">
476
<title><indexterm significance="preferred"><primary>Multi-state Resources</primary></indexterm>
477
<indexterm significance="preferred"><primary>Resources</primary><secondary>Multi-state</secondary></indexterm>
478
Multi-state - Resources That Have Multiple Modes</title>
480
Multi-state resources are a specialization of Clone resources; please ensure you understand the section on clones before continuing! They allow the instances to be in one of two operating modes;
481
these are called <literal>Master</literal> and <literal>Slave</literal>, but can mean whatever you wish them to mean.
482
The only limitation is that when an instance is started, it must come up in the <literal>Slave</literal> state.
485
<title>Properties</title>
487
<title>Properties of a Multi-State Resource</title>
489
<colspec colwidth="1*"/>
490
<colspec colwidth="4*"/>
494
<entry>Description</entry>
497
<entry><indexterm significance="preferred"><primary>id</primary><secondary>Multi-State Resource Property</secondary></indexterm>
498
<indexterm><primary>Multi-State Resource Properties</primary><secondary>id</secondary></indexterm>
499
<indexterm><primary>Resource</primary><secondary>Multi-State Property</secondary><tertiary>id</tertiary></indexterm>
501
<entry>Your name for the multi-state resource</entry>
508
<title>Options</title>
509
<para>Options inherited from <link linkend="s-resource-supported">simple resources</link>: <literal>priority</literal>, <literal>target-role</literal>, <literal>is-managed</literal></para>
510
<para>Options inherited from <link linkend="s-resource-clone">clone resources</link>: <literal>clone-max</literal>, <literal>clone-node-max</literal>, <literal>notify</literal>, <literal>globally-unique</literal>, <literal>ordered</literal>, <literal>interleave</literal></para>
512
<title>Multi-state specific resource configuration options</title>
514
<colspec colwidth="1*"/>
515
<colspec colwidth="4*"/>
519
<entry>Description</entry>
522
<entry><indexterm significance="preferred"><primary>master-max Multi-State Resource Property</primary></indexterm>
523
<indexterm><primary>Multi-State Resource Properties</primary><secondary>master-max</secondary></indexterm>
524
<indexterm><primary>Resource</primary><secondary>Multi-State Property</secondary><tertiary>master-max</tertiary></indexterm>
526
<entry>How many copies of the resource can be promoted to <literal>master</literal> status; default 1.</entry>
529
<entry><indexterm significance="preferred"><primary>master-node-max Multi-State Resource Property</primary></indexterm>
530
<indexterm><primary>Multi-State Resource Properties</primary><secondary>master-node-max</secondary></indexterm>
531
<indexterm><primary>Resource</primary><secondary>Multi-State Property</secondary><tertiary>master-node-max</tertiary></indexterm>
532
master-node-max</entry>
533
<entry>How many copies of the resource can be promoted to <literal>master</literal> status on a single node; default 1.</entry>
534
</row></tbody></tgroup>
538
<title>Instance Attributes</title>
539
<para>Multi-state resources have no instance attributes; however, any that are set here will be inherited by master's children.</para>
542
<title>Contents</title>
543
<para>Masters must contain exactly one group or one regular resource.</para>
546
You should never reference the name of a master's child.
547
If you think you need to do this, you probably need to re-evaluate your design.
550
<para> <!-- ws --> </para>
553
<title>Monitoring Multi-State Resources</title>
555
The normal type of monitor actions are not sufficient to monitor a multi-state resource in the <literal>Master</literal> state.
556
To detect failures of the <literal>Master</literal> instance, you need to define an additional monitor action with <literal>role="Master"</literal>.
558
<important><para>It is crucial that <emphasis>every</emphasis> monitor operation has a different interval!</para>
559
<para>This is because Pacemaker currently differentiates between operations only by resource and interval; so if eg. a master/slave resource has the same monitor interval for both roles, Pacemaker would ignore the role when checking the status - which would cause unexpected return codes, and therefore unnecessary complications.</para></important>
561
<title>Monitoring both states of a multi-state resource</title>
562
<programlisting><![CDATA[ <master id="myMasterRsc">
563
<primitive id="myRsc" class="ocf" type="myApp" provider="myCorp">
565
<op id="public-ip-slave-check" name="monitor" interval="60"/>
566
<op id="public-ip-master-check" name="monitor" interval="61" role="Master"/>
569
</master> ]]> </programlisting>
573
<title>Constraints</title>
575
In most cases, a multi-state resources will have a single copy on each active cluster node.
576
If this is not the case, you can indicate which nodes the cluster should preferentially assign copies to with resource location constraints.
577
These constraints are written no differently to those for regular resources except that the master's id is used.
580
When considering multi-state resources in constraints, for most purposes it is sufficient to treat them as clones.
581
The exception is when the <literal>rsc-role</literal> and/or <literal>with-rsc-role</literal> fields (for colocation constraints) and <literal>first-action</literal> and/or <literal>then-action</literal> fields (for ordering constraints) are used.
584
<title>Additional constraint options relevant to multi-state resources</title>
586
<colspec colwidth="1*"/>
587
<colspec colwidth="4*"/>
591
<entry>Description</entry>
594
<entry><indexterm significance="preferred"><primary>rsc-role Multi-State Resource Constraints</primary></indexterm>
595
<indexterm><primary>Multi-State Resource Constraints</primary><secondary>rsc-role</secondary></indexterm>
596
<indexterm><primary>Resource</primary><secondary>Multi-State Constraints</secondary><tertiary>rsc-role</tertiary></indexterm>
599
<para>An additional attribute of colocation constraints that specifies the role that <literal>rsc</literal> must be in.
600
Allowed values: <emphasis>Started</emphasis>, <literal>Master</literal>, <literal>Slave</literal>.</para>
604
<entry><indexterm significance="preferred"><primary>with-rsc-role Multi-State Resource Constraints</primary></indexterm>
605
<indexterm><primary>Multi-State Resource Constraints</primary><secondary>with-rsc-role</secondary></indexterm>
606
<indexterm><primary>Resource</primary><secondary>Multi-State Constraints</secondary><tertiary>with-rsc-role</tertiary></indexterm>
607
with-rsc-role</entry>
609
<para>An additional attribute of colocation constraints that specifies the role that <literal>with-rsc</literal> must be in.
610
Allowed values: <emphasis>Started</emphasis>, <literal>Master</literal>, <literal>Slave</literal>.</para>
614
<entry><indexterm significance="preferred"><primary>first-action Multi-State Resource Constraints</primary></indexterm>
615
<indexterm><primary>Multi-State Resource Constraints</primary><secondary>first-action</secondary></indexterm>
616
<indexterm><primary>Resource</primary><secondary>Multi-State Constraints</secondary><tertiary>first-action</tertiary></indexterm>
619
<para>An additional attribute of ordering constraints that specifies the action that the <literal>first</literal> resource must complete before executing the specified action for the <literal>then</literal> resource.
620
Allowed values: <emphasis>start</emphasis>, <literal>stop</literal>, <literal>promote</literal>, <literal>demote</literal>.</para>
624
<entry><indexterm significance="preferred"><primary>then-action Multi-State Resource Constraints</primary></indexterm>
625
<indexterm><primary>Multi-State Resource Constraints</primary><secondary>then-action</secondary></indexterm>
626
<indexterm><primary>Resource</primary><secondary>Multi-State Constraints</secondary><tertiary>then-action</tertiary></indexterm>
629
<para>An additional attribute of ordering constraints that specifies the action that the <literal>then</literal> resource can only execute after the <literal>first-action</literal> on the <literal>first</literal> resource has completed.
630
Allowed values: <literal>start</literal>, <literal>stop</literal>, <literal>promote</literal>, <literal>demote</literal>. Defaults to the value (specified or implied) of <literal>first-action</literal>.</para>
637
In the example below, <literal>myApp</literal> will wait until one of the database copies has been started and promoted to master before being started itself.
638
Only if no copies can be promoted will <literal>apache-stats</literal> be prevented from being active.
639
Additionally, the database will wait for <literal>myApp</literal> to be stopped before it is demoted.
642
<title>Example constraints involving multi-state resources</title>
643
<programlisting><![CDATA[ <constraints>
644
<rsc_location id="db-prefers-node1" rsc="database" node="node1" score="500"/>
645
<rsc_colocation id="backup-with-db-slave" rsc="backup"
646
with-rsc="database" with-rsc-role="Slave"/>
647
<rsc_colocation id="myapp-with-db-master" rsc="myApp"
648
with-rsc="database" with-rsc-role="Master"/>
649
<rsc_order id="start-db-before-backup" first="database" then="backup"/>
650
<rsc_order id="promote-db-then-app" first="database" first-action="promote"
651
then="myApp" then-action="start"/>
652
</constraints> ]]> </programlisting>
655
Colocation of a regular (or group) resource with a multi-state resource means that it can run on any machine with an active copy of the multi-state resource that is in the specified state (<literal>Master</literal> or <literal>Slave</literal>).
656
In the example, the cluster will choose a location based on where database is running as a <literal>Master</literal>, and if there are multiple <literal>Master</literal> instances it will also factor in <literal>myApp</literal>'s own location preferences when deciding which location to choose.
659
Colocation with regular clones and other multi-state resources is also possible.
660
In such cases, the set of allowed locations for the <literal>rsc</literal> clone is (after role filtering) limited to nodes on which the <literal>with-rsc</literal> multi-state resource is (or will be) in the specified role.
661
Allocation is then performed as-per-normal.
665
<title>Stickiness</title>
667
<indexterm><primary>resource-stickiness</primary><secondary>of a Multi-State Resource</secondary></indexterm>
668
To achieve a stable allocation pattern, multi-state resources are slightly sticky by default.
669
If no value for <literal>resource-stickiness</literal> is provided, the multi-state resource will use a value of 1.
670
Being a small value, it causes minimal disturbance to the score calculations of other resources but is enough to prevent Pacemaker from needlessly moving copies around the cluster.
674
<title>Which Resource Instance is Promoted</title>
676
During the start operation, most Resource Agent scripts should call the <command>crm_master</command> utility.
677
This tool automatically detects both the resource and host and should be used to set a preference for being promoted.
678
Based on this, <literal>master-max</literal>, and <literal>master-node-max</literal>, the instance(s) with the highest preference will be promoted.
680
<para>The other alternative is to create a location constraint that indicates which nodes are most preferred as masters.</para>
682
<title>Manually specifying which node should be promoted</title>
683
<programlisting><![CDATA[ <rsc_location id="master-location" rsc="myMasterRsc">
684
<rule id="master-rule" score="100" role="Master">
685
<expression id="master-exp" attribute="#uname" operation="eq" value="node1"/>
687
</rsc_location> ]]> </programlisting>
691
<title>Resource Agent Requirements</title>
693
Since multi-state resources are an extension of cloned resources, all the requirements of Clones are also requirements of multi-state resources.
694
Additionally, multi-state resources require two extra actions: <literal>demote</literal> and <literal>promote</literal>;
695
these actions are responsible for changing the state of the resource.
696
Like <literal>start</literal> and <literal>stop</literal>, they should return <envar>OCF_SUCCESS</envar> if they completed successfully or a relevant error code if they did not.
699
The states can mean whatever you wish, but when the resource is started, it must come up in the mode called <literal>Slave</literal>.
700
From there the cluster will then decide which instances to promote to <literal>Master</literal>.
703
In addition to the Clone requirements for monitor actions, agents must also <emphasis>accurately</emphasis> report which state they are in.
704
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.
707
<title>Role implications of OCF return codes</title>
709
<colspec colwidth="1*"/>
710
<colspec colwidth="2*"/>
713
<entry>Monitor Return Code</entry>
714
<entry>Description</entry>
717
<entry><indexterm><primary>return code</primary><secondary>OCF_NOT_RUNNING</secondary></indexterm>
718
<indexterm><primary>Environment Variable</primary><secondary>OCF_NOT_RUNNING</secondary></indexterm>
719
<indexterm><primary>OCF_NOT_RUNNING</primary></indexterm>
720
OCF_NOT_RUNNING</entry>
721
<entry>Stopped</entry>
724
<entry><indexterm><primary>return code</primary><secondary>OCF_SUCCESS</secondary></indexterm>
725
<indexterm><primary>Environment Variable</primary><secondary>OCF_SUCCESS</secondary></indexterm>
726
<indexterm><primary>OCF_SUCCESS</primary></indexterm>
728
<entry>Running (Slave)</entry>
731
<entry><indexterm><primary>return code</primary><secondary>OCF_RUNNING_MASTER</secondary></indexterm>
732
<indexterm><primary>Environment Variable</primary><secondary>OCF_RUNNING_MASTER</secondary></indexterm>
733
<indexterm><primary>OCF_RUNNING_MASTER</primary></indexterm>
734
OCF_RUNNING_MASTER</entry>
735
<entry>Running (Master)</entry>
738
<entry><indexterm><primary>return code</primary><secondary>OCF_FAILED_MASTER</secondary></indexterm>
739
<indexterm><primary>Environment Variable</primary><secondary>OCF_FAILED_MASTER</secondary></indexterm>
740
<indexterm><primary>OCF_FAILED_MASTER</primary></indexterm>
741
OCF_FAILED_MASTER</entry>
742
<entry>Failed (Master)</entry>
746
<entry>Failed (Slave)</entry>
747
</row></tbody></tgroup>
751
<title>Notifications</title>
753
Like clones, supporting notifications requires the <literal>notify</literal> action to be implemented.
754
Once supported the notify action will be passed a number of extra variables which, when combined with additional context, can be used to calculate the current state of the cluster and what is about to happen to it.
757
<title>Environment variables supplied with <literal>Master</literal> notify actions<footnote><para>Emphasized variables are specific to <literal>Master</literal> resources and all behave in the same manner as described for Clone resources.</para></footnote>
760
<colspec colwidth="5*"/>
761
<colspec colwidth="3*"/>
764
<entry>Variable</entry>
765
<entry>Description</entry>
768
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_type</tertiary></indexterm>
769
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_type</secondary></indexterm>
770
<envar>OCF_RESKEY_CRM_meta_notify_type</envar></entry>
771
<entry>Allowed values: <literal>pre</literal>, <literal>post</literal></entry>
774
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_operation</tertiary></indexterm>
775
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_operation</secondary></indexterm><envar>OCF_RESKEY_CRM_meta_notify_operation</envar></entry>
776
<entry>Allowed values: <literal>start</literal>, <literal>stop</literal></entry>
779
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_active_resource</tertiary></indexterm>
780
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_active_resource</secondary></indexterm>
781
<envar>OCF_RESKEY_CRM_meta_notify_active_resource</envar></entry>
782
<entry>Resources the that are running</entry>
785
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_inactive_resource</tertiary></indexterm>
786
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_inactive_resource</secondary></indexterm>
787
<envar>OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></entry>
788
<entry>Resources the that are not running</entry>
791
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_master_resource</tertiary></indexterm>
792
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_master_resource</secondary></indexterm>
793
<envar>OCF_RESKEY_CRM_meta_notify_master_resource</envar></emphasis></entry>
794
<entry>Resources that are running in <literal>Master</literal> mode</entry>
797
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_slave_resource</tertiary></indexterm>
798
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_slave_resource</secondary></indexterm>
799
<envar>OCF_RESKEY_CRM_meta_notify_slave_resource</envar></emphasis></entry>
800
<entry>Resources that are running in <literal>Slave</literal> mode</entry>
803
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_start_resource</tertiary></indexterm>
804
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_start_resource</secondary></indexterm>
805
<envar>OCF_RESKEY_CRM_meta_notify_start_resource</envar></entry>
806
<entry>Resources to be started</entry>
809
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_stop_resource</tertiary></indexterm>
810
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_stop_resource</secondary></indexterm>
811
<envar>OCF_RESKEY_CRM_meta_notify_stop_resource</envar></entry>
812
<entry>Resources to be stopped</entry>
815
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_promote_resource</tertiary></indexterm>
816
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_promote_resource</secondary></indexterm>
817
<envar>OCF_RESKEY_CRM_meta_notify_promote_resource</envar></emphasis></entry>
818
<entry>Resources to be promoted</entry>
821
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_demote_resource</tertiary></indexterm>
822
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_demote_resource</secondary></indexterm>
823
<envar>OCF_RESKEY_CRM_meta_notify_demote_resource</envar></emphasis></entry>
824
<entry>Resources to be demoted</entry>
827
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_start_uname</tertiary></indexterm>
828
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_start_uname</secondary></indexterm>
829
<envar>OCF_RESKEY_CRM_meta_notify_start_uname</envar></entry>
830
<entry>Nodes on which resources will be started</entry>
833
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_stop_uname</tertiary></indexterm>
834
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_stop_uname</secondary></indexterm>
835
<envar>OCF_RESKEY_CRM_meta_notify_stop_uname</envar></entry>
836
<entry>Nodes on which resources will be stopped</entry>
839
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_promote_uname</tertiary></indexterm>
840
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_promote_uname</secondary></indexterm>
841
<envar>OCF_RESKEY_CRM_meta_notify_promote_uname</envar></emphasis></entry>
842
<entry>Nodes on which resources will be promoted</entry>
845
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_demote_uname</tertiary></indexterm>
846
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_demote_uname</secondary></indexterm>
847
<envar>OCF_RESKEY_CRM_meta_notify_demote_uname</envar></emphasis></entry>
848
<entry>Nodes on which resources will be demoted</entry>
851
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_active_uname</tertiary></indexterm>
852
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_active_uname</secondary></indexterm>
853
<envar>OCF_RESKEY_CRM_meta_notify_active_uname</envar></entry>
854
<entry>Nodes on which resources are running</entry>
857
<entry><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_inactive_uname</tertiary></indexterm>
858
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_inactive_uname</secondary></indexterm>
859
<envar>OCF_RESKEY_CRM_meta_notify_inactive_uname</envar></entry>
860
<entry>Nodes on which resources are not running</entry>
863
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_master_uname</tertiary></indexterm>
864
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_master_uname</secondary></indexterm>
865
<envar>OCF_RESKEY_CRM_meta_notify_master_uname</envar></emphasis></entry>
866
<entry>Nodes on which resources are running in <literal>Master</literal> mode</entry>
869
<entry><emphasis><indexterm><primary>Environment Variable</primary><secondary>OCF_RESKEY_CRM_</secondary><tertiary>_meta_notify_slave_uname</tertiary></indexterm>
870
<indexterm><primary>OCF_RESKEY_CRM_</primary><secondary>meta_notify_slave_uname</secondary></indexterm>
871
<envar>OCF_RESKEY_CRM_meta_notify_slave_uname</envar></emphasis></entry>
872
<entry>Nodes on which resources are running in <literal>Slave</literal> mode</entry>
873
</row></tbody></tgroup>
877
<title>Proper Interpretation of Notification Environment Variables</title>
878
<para>Pre-notification (demote):
879
<itemizedlist spacing="compact">
880
<listitem><para><literal>Active</literal> resources: <envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
881
<listitem><para><literal>Master</literal> resources: <envar>$OCF_RESKEY_CRM_meta_notify_master_resource</envar></para></listitem>
882
<listitem><para><literal>Slave</literal> resources: <envar>$OCF_RESKEY_CRM_meta_notify_slave_resource</envar></para></listitem>
883
<listitem><para>Inactive resources: <envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
884
<listitem><para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
885
<listitem><para>Resources to be promoted: <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar></para></listitem>
886
<listitem><para>Resources to be demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
887
<listitem><para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
890
<para>Post-notification (demote) / Pre-notification (stop):
891
<itemizedlist spacing="compact">
892
<listitem><para><literal>Active</literal> resources: <envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
893
<listitem><para><literal>Master</literal> resources:
894
<itemizedlist spacing="compact" mark="none">
895
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_master_resource</envar></para></listitem>
896
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar> </para></listitem>
900
<listitem><para><literal>Slave</literal> resources: <envar>$OCF_RESKEY_CRM_meta_notify_slave_resource</envar></para></listitem>
901
<listitem><para>Inactive resources: <envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
902
<listitem><para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
903
<listitem><para>Resources to be promoted: <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar></para></listitem>
904
<listitem><para>Resources to be demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
905
<listitem><para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
906
<listitem><para>Resources that were demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
907
</itemizedlist> </para>
909
<para>Post-notification (stop) / Pre-notification (start)
910
<itemizedlist spacing="compact">
911
<listitem><para><literal>Active</literal> resources:
912
<itemizedlist spacing="compact" mark="none">
913
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
914
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar> </para></listitem>
917
<listitem><para><literal>Master</literal> resources:
918
<itemizedlist spacing="compact" mark="none">
919
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_master_resource</envar></para></listitem>
920
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar> </para></listitem>
923
<listitem><para><literal>Slave</literal> resources:
924
<itemizedlist spacing="compact" mark="none">
925
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_slave_resource</envar></para></listitem>
926
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar> </para></listitem>
929
<listitem><para>Inactive resources:
930
<itemizedlist spacing="compact" mark="none">
931
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
932
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar> </para></listitem>
935
<listitem><para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
936
<listitem><para>Resources to be promoted: <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar></para></listitem>
937
<listitem><para>Resources to be demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
938
<listitem><para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
939
<listitem><para>Resources that were demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
940
<listitem><para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
941
</itemizedlist></para>
942
<para>Post-notification (start) / Pre-notification (promote)
943
<itemizedlist spacing="compact">
944
<listitem><para><literal>Active</literal> resources:
945
<itemizedlist spacing="compact" mark="none">
946
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
947
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
948
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar> </para></listitem>
951
<listitem><para><literal>Master</literal> resources:
952
<itemizedlist spacing="compact" mark="none">
953
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_master_resource</envar></para></listitem>
954
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar> </para></listitem>
957
<listitem><para><literal>Slave</literal> resources:
958
<itemizedlist spacing="compact" mark="none">
959
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_slave_resource</envar></para></listitem>
960
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
961
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar> </para></listitem>
964
<listitem><para>Inactive resources:
965
<itemizedlist spacing="compact" mark="none">
966
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
967
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
968
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar> </para></listitem>
971
<listitem><para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
972
<listitem><para>Resources to be promoted: <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar></para></listitem>
973
<listitem><para>Resources to be demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
974
<listitem><para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
975
<listitem><para>Resources that were started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
976
<listitem><para>Resources that were demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
977
<listitem><para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
978
</itemizedlist></para>
980
<para>Post-notification (promote)
981
<itemizedlist spacing="compact">
982
<listitem><para><literal>Active</literal> resources:
983
<itemizedlist spacing="compact" mark="none">
984
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para></listitem>
985
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
986
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar> </para></listitem>
989
<listitem><para><literal>Master</literal> resources:
990
<itemizedlist spacing="compact" mark="none">
991
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_master_resource</envar></para></listitem>
992
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
993
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar> </para></listitem>
996
<listitem><para><literal>Slave</literal> resources:
997
<itemizedlist spacing="compact" mark="none">
998
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_slave_resource</envar></para></listitem>
999
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
1000
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
1001
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar> </para></listitem>
1004
<listitem><para>Inactive resources:
1005
<itemizedlist spacing="compact" mark="none">
1006
<listitem><para><envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para></listitem>
1007
<listitem><para>plus <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
1008
<listitem><para>minus <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar> </para></listitem>
1011
<listitem><para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
1012
<listitem><para>Resources to be promoted: <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar></para></listitem>
1013
<listitem><para>Resources to be demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
1014
<listitem><para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>
1015
<listitem><para>Resources that were started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para></listitem>
1016
<listitem><para>Resources that were promoted: <envar>$OCF_RESKEY_CRM_meta_notify_promote_resource</envar></para></listitem>
1017
<listitem><para>Resources that were demoted: <envar>$OCF_RESKEY_CRM_meta_notify_demote_resource</envar></para></listitem>
1018
<listitem><para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para></listitem>