File: resource.exp

package info (click to toggle)
pacemaker 1.0.9.1%2Bhg15626-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 34,668 kB
  • ctags: 5,645
  • sloc: xml: 87,444; ansic: 57,853; python: 11,479; sh: 5,255; makefile: 663; perl: 387; sed: 262
file content (392 lines) | stat: -rw-r--r-- 12,319 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
.TRY resource status p0
.EXT crm_resource -W -r 'p0'
resource p0 is NOT running
.SETENV showobj=p3
.TRY resource start p3
.EXT crm_resource --meta -r 'p3' -p target-role -v 'Started'
.INP: configure
.INP: _regtest on
.INP: show xml p3
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p3" provider="heartbeat" type="Dummy">
        <meta_attributes id="p3-meta_attributes">
          <nvpair id="p3-meta_attributes-target-role" name="target-role" value="Started"/>
        </meta_attributes>
      </primitive>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource stop p3
.EXT crm_resource --meta -r 'p3' -p target-role -v 'Stopped'
.INP: configure
.INP: _regtest on
.INP: show xml p3
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p3" provider="heartbeat" type="Dummy">
        <meta_attributes id="p3-meta_attributes">
          <nvpair id="p3-meta_attributes-target-role" name="target-role" value="Stopped"/>
        </meta_attributes>
      </primitive>
    </resources>
    <constraints/>
  </configuration>
</cib>

.SETENV showobj=c1
.TRY resource manage c1
.EXT crm_resource --meta -r 'c1' -p is-managed -v 'true'
.INP: configure
.INP: _regtest on
.INP: show xml c1
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <clone id="c1">
        <meta_attributes id="c1-meta_attributes">
          <nvpair id="c1-meta_attributes-is-managed" name="is-managed" value="true"/>
        </meta_attributes>
        <primitive class="ocf" id="p1" provider="heartbeat" type="Dummy"/>
      </clone>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource unmanage c1
.EXT crm_resource --meta -r 'c1' -p is-managed -v 'false'
.INP: configure
.INP: _regtest on
.INP: show xml c1
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <clone id="c1">
        <meta_attributes id="c1-meta_attributes">
          <nvpair id="c1-meta_attributes-is-managed" name="is-managed" value="false"/>
        </meta_attributes>
        <primitive class="ocf" id="p1" provider="heartbeat" type="Dummy"/>
      </clone>
    </resources>
    <constraints/>
  </configuration>
</cib>

.SETENV showobj=cli-prefer-p3
.TRY resource migrate p3
.EXT crm_resource -M -r 'p3'
Resource p3 not moved: not-active and no preferred location specified.
Error performing operation: cib object missing
.INP: configure
.INP: _regtest on
.INP: show xml cli-prefer-p3
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.TRY resource migrate p3 node1
.EXT crm_resource -M -r 'p3' -H 'node1'
.INP: configure
.INP: _regtest on
.INP: show xml cli-prefer-p3
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources/>
    <constraints>
      <rsc_location id="cli-prefer-p3" rsc="p3">
        <rule id="cli-prefer-rule-p3" score="INFINITY">
          <expression attribute="#uname" id="cli-prefer-expr-p3" operation="eq" value="node1"/>
        </rule>
      </rsc_location>
    </constraints>
  </configuration>
</cib>

.TRY resource unmigrate p3
.EXT crm_resource -U -r 'p3'
.INP: configure
.INP: _regtest on
.INP: show xml cli-prefer-p3
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources/>
    <constraints/>
  </configuration>
</cib>

.SETENV showobj=p0
.TRY resource param p0 set a0 "1 2 3"
.EXT crm_resource -r 'p0' -p 'a0' -v '1 2 3'
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy">
        <instance_attributes id="p0-instance_attributes">
          <nvpair id="p0-instance_attributes-a0" name="a0" value="1 2 3"/>
        </instance_attributes>
      </primitive>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource param p0 show a0
.EXT crm_resource -r 'p0' -g 'a0'
1 2 3
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy">
        <instance_attributes id="p0-instance_attributes">
          <nvpair id="p0-instance_attributes-a0" name="a0" value="1 2 3"/>
        </instance_attributes>
      </primitive>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource param p0 delete a0
.EXT crm_resource -r 'p0' -d 'a0'
Deleted p0 option: id=p0-instance_attributes-a0 name=a0
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource meta p0 set m0 123
.EXT crm_resource --meta -r 'p0' -p 'm0' -v '123'
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy">
        <meta_attributes id="p0-meta_attributes">
          <nvpair id="p0-meta_attributes-m0" name="m0" value="123"/>
        </meta_attributes>
      </primitive>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource meta p0 show m0
.EXT crm_resource --meta -r 'p0' -g 'm0'
123
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy">
        <meta_attributes id="p0-meta_attributes">
          <nvpair id="p0-meta_attributes-m0" name="m0" value="123"/>
        </meta_attributes>
      </primitive>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource meta p0 delete m0
.EXT crm_resource --meta -r 'p0' -d 'm0'
Deleted p0 option: id=p0-meta_attributes-m0 name=m0
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource failcount p0 set node1 5
.EXT crm_failcount -r 'p0' -N 'node1' -v '5'
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource failcount p0 show node1
.EXT crm_failcount -r 'p0' -N 'node1' -G
scope=status  name=fail-count-p0 value=0
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource failcount p0 delete node1
.EXT crm_failcount -r 'p0' -N 'node1' -D
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource cleanup p0 node1
.EXT crm_resource -C -r 'p0' -H 'node1'
Cleaning up p0 on node1
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>

.TRY resource cleanup p0
.EXT crm_resource -C -r 'p0' -H 'node1'
Cleaning up p0 on node1
.INP: configure
.INP: _regtest on
.INP: show xml p0
<?xml version="1.0" ?>
<cib admin_epoch="0" crm_feature_set="3.0.1" dc-uuid="f36760d8-d84a-46b2-b452-4c8cac8b3396" epoch="0" have-quorum="1" num_updates="1" remote-tls-port="0" validate-with="pacemaker-1.0">
  <configuration>
    <crm_config/>
    <rsc_defaults/>
    <op_defaults/>
    <nodes/>
    <resources>
      <primitive class="ocf" id="p0" provider="heartbeat" type="Dummy"/>
    </resources>
    <constraints/>
  </configuration>
</cib>