~ubuntu-branches/ubuntu/utopic/pacemaker/utopic-proposed

« back to all changes in this revision

Viewing changes to doc/Pacemaker_Explained/en-US/Ch-Advanced-Resources.xml

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2013-07-16 16:40:24 UTC
  • mfrom: (1.1.11) (2.2.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130716164024-lvwrf4xivk1wdr3c
Tags: 1.1.9+git20130321-1ubuntu1
* Resync from debian expiremental.
* debian/control:
  - Use lower version for Build-Depends on libcorosync-dev
    and libqb-dev.
  - Build-Depends on libcfg-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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>
6
 
      <para>
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.
9
 
      </para>
10
 
      <example>
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>
17
 
   </primitive>
18
 
   <primitive id="Email" class="lsb" type="exim"/>
19
 
  </group> ]]> </programlisting>
20
 
      </example>
21
 
      <para>
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:
24
 
      </para>
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>
28
 
        <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>
33
 
            </itemizedlist>
34
 
          </para>
35
 
        </listitem>
36
 
      </itemizedlist>
37
 
      <para>The group above is logically equivalent to writing:</para>
38
 
      <example>
39
 
        <title>How the cluster sees a group resource</title>
40
 
        <programlisting><![CDATA[ <configuration>
41
 
   <resources>
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>
46
 
    </primitive>
47
 
    <primitive id="Email" class="lsb" type="exim"/>
48
 
   </resources>
49
 
   <constraints>
50
 
      <rsc_colocation id="xxx" rsc="Email" with-rsc="Public-IP" score="INFINITY"/>
51
 
      <rsc_order id="yyy" first="Public-IP" then="Email"/>
52
 
   </constraints>
53
 
  </configuration> ]]> </programlisting>
54
 
      </example>
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>
57
 
      <section>
58
 
        <title>Properties</title>
59
 
        <table frame="all">
60
 
          <title>Properties of a Group Resource</title>
61
 
          <tgroup cols="2">
62
 
            <colspec colwidth="1*"/>
63
 
            <colspec colwidth="4*"/>
64
 
            <thead>
65
 
              <row>
66
 
                <entry>Field</entry>
67
 
                <entry>Description</entry>
68
 
              </row>
69
 
            </thead>
70
 
            <tbody>
71
 
              <row>
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>
75
 
                  id</entry>
76
 
                <entry>Your name for the group</entry>
77
 
              </row>
78
 
            </tbody>
79
 
          </tgroup>
80
 
        </table>
81
 
      </section>
82
 
      <section>
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>
85
 
      </section>
86
 
        <section>
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>
89
 
        </section>
90
 
        <section>
91
 
          <title>Contents</title>
92
 
          <para>
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.
95
 
          </para>
96
 
        </section>
97
 
        <section>
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>
100
 
          <example>
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>
107
 
          </example>
108
 
        </section>
109
 
        <section>
110
 
          <title><indexterm><primary>resource-stickiness</primary><secondary>of a Group Resource</secondary></indexterm>
111
 
            Stickiness</title>
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>
115
 
        </section>
116
 
    </section>
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>
121
 
      <para>
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.
124
 
      </para>
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>
132
 
      <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.
136
 
      </para>
137
 
      <para>
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.
141
 
      </para>
142
 
      <para>Stateful clones are covered later in <xref linkend="s-resource-multistate"/>.</para>
143
 
      <example>
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"/>
148
 
    </meta_attributes>
149
 
    <primitive id="apache" class="lsb" type="apache"/>
150
 
  </clone> ]]> </programlisting>
151
 
      </example>
152
 
      <section>
153
 
        <title>Properties</title>
154
 
        <table frame="all">
155
 
          <title>Properties of a Clone Resource</title>
156
 
          <tgroup cols="2">
157
 
            <colspec colwidth="2*"/>
158
 
            <colspec colwidth="7*"/>
159
 
            <thead>
160
 
              <row>
161
 
                <entry>Field</entry>
162
 
                <entry>Description</entry>
163
 
              </row>
164
 
            </thead><tbody><row>
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>
168
 
                  id</entry>
169
 
                <entry>Your name for the clone</entry>
170
 
              </row>
171
 
            </tbody>
172
 
          </tgroup>
173
 
        </table>
174
 
      </section>
175
 
      <section>
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>
178
 
        <table frame="all">
179
 
          <title>Clone specific configuration options</title>
180
 
          <tgroup cols="2">
181
 
            <colspec colwidth="2*"/>
182
 
            <colspec colwidth="7*"/>
183
 
            <thead>
184
 
              <row>
185
 
                <entry>Field</entry>
186
 
                <entry>Description</entry>
187
 
              </row>
188
 
            </thead>
189
 
            <tbody>
190
 
              <row>
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>
194
 
                  clone-max</entry>
195
 
                <entry>How many copies of the resource to start. Defaults to the number of nodes in the cluster.</entry>
196
 
              </row>
197
 
              <row>
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>
203
 
              </row>
204
 
              <row>
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>
208
 
                  notify</entry>
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>
210
 
                  </entry>
211
 
              </row>
212
 
              <row>
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>
218
 
              </row>
219
 
              <row>
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>
223
 
                  ordered</entry>
224
 
                <entry>Should the copies be started in series (instead of in parallel). Allowed values: <emphasis>false</emphasis>, <literal>true</literal>
225
 
                  </entry>
226
 
              </row>
227
 
              <row>
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>
231
 
                  interleave</entry>
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>
233
 
                  </entry>
234
 
              </row>
235
 
            </tbody>
236
 
          </tgroup>
237
 
        </table>
238
 
      </section>
239
 
        <section>
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>
242
 
        </section>
243
 
        <section>
244
 
          <title>Contents</title>
245
 
          <para>Clones must contain exactly one group or one regular resource.</para>
246
 
          <warning>
247
 
            <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.
250
 
            </para>
251
 
            <para><!-- ws --> </para>
252
 
          </warning>
253
 
        </section>
254
 
        <section>
255
 
          <title>Constraints</title>
256
 
          <para>
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.
260
 
          </para>
261
 
          <para>
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.
266
 
          </para>
267
 
          <para>
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.
270
 
          </para>
271
 
          <para>
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.
275
 
          </para>
276
 
          <example>
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>
283
 
          </example>
284
 
        </section>
285
 
        <section>
286
 
          <title>Stickiness</title>
287
 
          <para>
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.
292
 
          </para>
293
 
        </section>
294
 
        <section>
295
 
          <title>Resource Agent Requirements</title>
296
 
          <para>
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.
299
 
          </para>
300
 
          <para>
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.
305
 
          </para>
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>
308
 
          <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.
311
 
          </para>
312
 
        </section>
313
 
        <section>
314
 
          <title>Notifications</title>
315
 
          <para>
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.
318
 
          </para>
319
 
          <table frame="all">
320
 
            <title>Environment variables supplied with Clone notify actions</title>
321
 
            <tgroup cols="2">
322
 
              <colspec colwidth="5*"/>
323
 
              <colspec colwidth="4*"/>
324
 
              <thead>
325
 
                <row>
326
 
                  <entry>Variable</entry>
327
 
                  <entry>Description</entry>
328
 
                </row>
329
 
              </thead>
330
 
              <tbody>
331
 
                <row>
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>
336
 
                </row>
337
 
                <row>
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>
342
 
                </row>
343
 
                <row>
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>
348
 
                </row>
349
 
                <row>
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>
354
 
                </row>
355
 
                <row>
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>
360
 
                </row>
361
 
                <row>
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>
366
 
                </row>
367
 
                <row>
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>
372
 
                </row>
373
 
                <row>
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>
378
 
                </row>
379
 
                <row>
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>
384
 
                </row>
385
 
                <row>
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>
390
 
                </row>
391
 
              </tbody>
392
 
            </tgroup>
393
 
          </table>
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>
396
 
          <example>
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"
401
 
            </programlisting>
402
 
          </example>
403
 
        </section>
404
 
        <section>
405
 
          <title>Proper Interpretation of Notification Environment Variables</title>
406
 
          <para>Pre-notification (stop):
407
 
          <itemizedlist spacing="compact">
408
 
            <listitem>
409
 
              <para>Active resources: <envar>$OCF_RESKEY_CRM_meta_notify_active_resource</envar></para>
410
 
            </listitem>
411
 
            <listitem>
412
 
              <para>Inactive resources: <envar>$OCF_RESKEY_CRM_meta_notify_inactive_resource</envar></para>
413
 
            </listitem>
414
 
            <listitem>
415
 
              <para>Resources to be started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para>
416
 
            </listitem>
417
 
            <listitem>
418
 
              <para>Resources to be stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para>
419
 
            </listitem>
420
 
          </itemizedlist></para>
421
 
          <para>Post-notification (stop) / Pre-notification (start):
422
 
            <itemizedlist spacing="compact">
423
 
              <listitem>
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>
428
 
                </itemizedlist>
429
 
              </para>
430
 
              </listitem>
431
 
              <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>
436
 
                </itemizedlist>
437
 
              </para>
438
 
              </listitem>
439
 
              <listitem>
440
 
                <para>Resources that were started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para>
441
 
              </listitem>
442
 
              <listitem>
443
 
                <para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para>
444
 
              </listitem>
445
 
          </itemizedlist></para>
446
 
          <para>Post-notification (start):
447
 
            <itemizedlist spacing="compact">
448
 
              <listitem>
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>
454
 
                  </itemizedlist>
455
 
                </para>
456
 
              </listitem>
457
 
              <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>
463
 
                  </itemizedlist> 
464
 
                </para>
465
 
              </listitem>
466
 
              <listitem>
467
 
                <para>Resources that were started: <envar>$OCF_RESKEY_CRM_meta_notify_start_resource</envar></para>
468
 
              </listitem>
469
 
              <listitem>
470
 
                <para>Resources that were stopped: <envar>$OCF_RESKEY_CRM_meta_notify_stop_resource</envar></para>
471
 
              </listitem>
472
 
          </itemizedlist></para>
473
 
        </section>
474
 
    </section>
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>
479
 
      <para>
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.
483
 
      </para>
484
 
      <section>
485
 
        <title>Properties</title>
486
 
        <table frame="all">
487
 
          <title>Properties of a Multi-State Resource</title>
488
 
          <tgroup cols="2">
489
 
            <colspec colwidth="1*"/>
490
 
            <colspec colwidth="4*"/>
491
 
            <thead>
492
 
              <row>
493
 
                <entry>Field</entry>
494
 
                <entry>Description</entry>
495
 
              </row>
496
 
            </thead><tbody><row>
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>
500
 
                  id</entry>
501
 
                <entry>Your name for the multi-state resource</entry>
502
 
              </row>
503
 
            </tbody>
504
 
          </tgroup>
505
 
        </table>
506
 
      </section>
507
 
      <section>
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>
511
 
        <table frame="all">
512
 
          <title>Multi-state specific resource configuration options</title>
513
 
          <tgroup cols="2">
514
 
            <colspec colwidth="1*"/>
515
 
            <colspec colwidth="4*"/>
516
 
            <thead>
517
 
              <row>
518
 
                <entry>Field</entry>
519
 
                <entry>Description</entry>
520
 
              </row>
521
 
            </thead><tbody><row>
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>
525
 
                master-max</entry>
526
 
                <entry>How many copies of the resource can be promoted to <literal>master</literal> status; default 1.</entry>
527
 
              </row>
528
 
              <row>
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>
535
 
        </table>
536
 
        </section>
537
 
        <section>
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>
540
 
        </section>
541
 
        <section>
542
 
          <title>Contents</title>
543
 
          <para>Masters must contain exactly one group or one regular resource.</para>
544
 
          <warning>
545
 
            <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.
548
 
            </para>
549
 
          </warning>
550
 
          <para> <!-- ws --> </para>
551
 
        </section>
552
 
        <section>
553
 
          <title>Monitoring Multi-State Resources</title>
554
 
          <para>
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>.
557
 
          </para>
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>
560
 
          <example>
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">
564
 
    <operations>
565
 
     <op id="public-ip-slave-check" name="monitor" interval="60"/>
566
 
     <op id="public-ip-master-check" name="monitor" interval="61" role="Master"/>
567
 
    </operations>
568
 
   </primitive>
569
 
  </master> ]]> </programlisting>
570
 
          </example>
571
 
        </section>
572
 
        <section>
573
 
          <title>Constraints</title>
574
 
          <para>
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.
578
 
          </para>
579
 
          <para>
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.
582
 
          </para>
583
 
          <table frame="all">
584
 
            <title>Additional constraint options relevant to multi-state resources</title>
585
 
            <tgroup cols="2">
586
 
              <colspec colwidth="1*"/>
587
 
              <colspec colwidth="4*"/>
588
 
              <thead>
589
 
                <row>
590
 
                  <entry>Field</entry>
591
 
                  <entry>Description</entry>
592
 
                </row>
593
 
              </thead><tbody><row>
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>
597
 
                  rsc-role</entry>
598
 
                  <entry>
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>
601
 
                  </entry>
602
 
                </row>
603
 
                <row>
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>
608
 
                  <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>
611
 
                  </entry>
612
 
                </row>
613
 
                <row>
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>
617
 
                    first-action</entry>
618
 
                  <entry>
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>
621
 
                  </entry>
622
 
                </row>
623
 
                <row>
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>
627
 
                    then-action</entry>
628
 
                  <entry>
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>
631
 
                  </entry>
632
 
                </row>
633
 
              </tbody>
634
 
            </tgroup>
635
 
          </table>
636
 
          <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.
640
 
          </para>
641
 
          <example>
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>
653
 
          </example>
654
 
          <para>
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.
657
 
          </para>
658
 
          <para>
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.
662
 
          </para>
663
 
        </section>
664
 
        <section>
665
 
          <title>Stickiness</title>
666
 
          <para>
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.
671
 
          </para>
672
 
        </section>
673
 
        <section>
674
 
          <title>Which Resource Instance is Promoted</title>
675
 
          <para>
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.
679
 
          </para>
680
 
          <para>The other alternative is to create a location constraint that indicates which nodes are most preferred as masters.</para>
681
 
          <example>
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"/>
686
 
    </rule>
687
 
  </rsc_location> ]]> </programlisting>
688
 
          </example>
689
 
        </section>
690
 
        <section>
691
 
          <title>Resource Agent Requirements</title>
692
 
          <para>
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.
697
 
          </para>
698
 
          <para>
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>.
701
 
          </para>
702
 
          <para>
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.
705
 
          </para>
706
 
          <table frame="all">
707
 
            <title>Role implications of OCF return codes</title>
708
 
            <tgroup cols="2">
709
 
              <colspec colwidth="1*"/>
710
 
              <colspec colwidth="2*"/>
711
 
              <thead>
712
 
                <row>
713
 
                  <entry>Monitor Return Code</entry>
714
 
                  <entry>Description</entry>
715
 
                </row>
716
 
              </thead><tbody><row>
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>
722
 
                </row>
723
 
                <row>
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>
727
 
                    OCF_SUCCESS</entry>
728
 
                  <entry>Running (Slave)</entry>
729
 
                </row>
730
 
                <row>
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>
736
 
                </row>
737
 
                <row>
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>
743
 
                </row>
744
 
                <row>
745
 
                  <entry>Other</entry>
746
 
                  <entry>Failed (Slave)</entry>
747
 
            </row></tbody></tgroup>
748
 
          </table>
749
 
        </section>
750
 
        <section>
751
 
          <title>Notifications</title>
752
 
          <para>
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.
755
 
          </para>
756
 
          <table frame="all">
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>
758
 
            </title>
759
 
            <tgroup cols="2">
760
 
              <colspec colwidth="5*"/>
761
 
              <colspec colwidth="3*"/>
762
 
              <thead>
763
 
                <row>
764
 
                  <entry>Variable</entry>
765
 
                  <entry>Description</entry>
766
 
                </row>
767
 
              </thead><tbody><row>
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>
772
 
                </row>
773
 
                <row>
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>
777
 
                </row>
778
 
                <row>
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>
783
 
                </row>
784
 
                <row>
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>
789
 
                </row>
790
 
                <row>
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>
795
 
                </row>
796
 
                <row>
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>
801
 
                </row>
802
 
                <row>
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>
807
 
                </row>
808
 
                <row>
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>
813
 
                </row>
814
 
                <row>
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>
819
 
                </row>
820
 
                <row>
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>
825
 
                </row>
826
 
                <row>
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>
831
 
                </row>
832
 
                <row>
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>
837
 
                </row>
838
 
                <row>
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>
843
 
                </row>
844
 
                <row>
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>
849
 
                </row>
850
 
                <row>
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>
855
 
                </row>
856
 
                <row>
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>
861
 
                </row>
862
 
                <row>
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>
867
 
                </row>
868
 
                <row>
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>
874
 
          </table>
875
 
        </section>
876
 
        <section>
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>
888
 
          </itemizedlist>
889
 
        </para>
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>
897
 
                  </itemizedlist>
898
 
                </para>
899
 
              </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>
908
 
          <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>
915
 
                </itemizedlist>
916
 
            </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>
921
 
                </itemizedlist>
922
 
            </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>
927
 
                </itemizedlist>
928
 
            </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>
933
 
                </itemizedlist>
934
 
            </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>
949
 
                </itemizedlist>
950
 
            </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>
955
 
                </itemizedlist>
956
 
            </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>
962
 
                </itemizedlist>
963
 
            </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>
969
 
                </itemizedlist>
970
 
            </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>
979
 
          <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>
987
 
                  </itemizedlist>
988
 
              </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>
994
 
                  </itemizedlist>
995
 
              </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>
1002
 
                </itemizedlist>
1003
 
              </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>
1009
 
                  </itemizedlist>
1010
 
              </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>
1019
 
            </itemizedlist>
1020
 
          </para>
1021
 
        </section>
1022
 
    </section>
1023
 
  </chapter>