1PACEMAKER(8) System Administration Utilities PACEMAKER(8)
2
3
4
6 Pacemaker - Part of the Pacemaker cluster resource manager
7
9 crm_resource <query>|<command> [options]
10
12 crm_resource - perform tasks related to Pacemaker cluster resources
13
15 Help Options:
16 -h, --help
17 Show help options
18
19 --help-all
20 Show all help options
21
22 --help-output
23 Show output help
24
25 --help-queries
26 Show query help
27
28 --help-commands
29 Show command help
30
31 --help-locations
32 Show location help
33
34 --help-advanced
35 Show advanced option help
36
37 --help-additional
38 Show additional options
39
40 Output Options:
41 --output-as=FORMAT
42 Specify output format as one of: text (default), xml
43
44 --output-to=DEST
45 Specify file name for output (or "-" for stdout)
46
47 --text-fancy
48 Use more highly formatted output (requires --output-as=text)
49
50 Queries:
51 -L, --list
52 List all cluster resources with status
53
54 -l, --list-raw
55 List IDs of all instantiated resources (individual members
56 rather than groups etc.)
57
58 -O, --list-operations
59 List active resource operations, optionally filtered by --re‐
60 source and/or --node
61
62 -o, --list-all-operations
63 List all resource operations, optionally filtered by --resource
64 and/or --node
65
66 --list-standards
67 List supported standards
68
69 --list-ocf-providers
70 List all available OCF providers
71
72 --list-agents=STD:PROV
73 List all agents available for the named standard and/or provider
74
75 --list-ocf-alternatives=AGENT
76 List all available providers for the named OCF agent
77
78 --show-metadata=SPEC
79 Show the metadata for the named class:provider:agent
80
81 -q, --query-xml
82 Show XML configuration of resource (after any template expan‐
83 sion)
84
85 -w, --query-xml-raw
86 Show XML configuration of resource (before any template expan‐
87 sion)
88
89 -g, --get-parameter=PARAM
90 Display named parameter for resource (use instance attribute un‐
91 less --meta or --utilization is specified)
92
93 -W, --locate
94 Show node(s) currently running resource
95
96 -a, --constraints
97 Display the location and colocation constraints that apply to a
98 resource, and if --recursive is specified, to the resources di‐
99 rectly or indirectly involved in those colocations. If the
100 named resource is part of a group, or a clone or bundle in‐
101 stance, constraints for the collective resource will be shown
102 unless --force is given.
103
104 -A, --stack
105 Equivalent to --constraints --recursive
106
107 -Y, --why
108 Show why resources are not running, optionally filtered by --re‐
109 source and/or --node
110
111 Commands:
112 --validate=LEVEL
113 Validate resource configuration by calling agent's validate-all
114 action. The configuration may be specified either by giving an
115 existing resource name with -r, or by specifying --class,
116 --agent, and --provider arguments, along with any number of
117 --option arguments. An optional LEVEL argument can be given to
118 control the level of checking performed.
119
120 -C, --cleanup
121 If resource has any past failures, clear its history and fail
122 count. Optionally filtered by --resource, --node, --operation
123 and --interval (otherwise all). --operation and --interval apply
124 to fail counts, but entire history is always clear, to allow
125 current state to be rechecked. If the named resource is part of
126 a group, or one numbered instance of a clone or bundled re‐
127 source, the clean-up applies to the whole collective resource
128 unless --force is given.
129
130 -R, --refresh
131 Delete resource's history (including failures) so its current
132 state is rechecked. Optionally filtered by --resource and --node
133 (otherwise all). If the named resource is part of a group, or
134 one numbered instance of a clone or bundled resource, the re‐
135 fresh applies to the whole collective resource unless --force is
136 given.
137
138 -p, --set-parameter=PARAM
139 Set named parameter for resource (requires -v). Use instance at‐
140 tribute unless --meta or --utilization is specified.
141
142 -d, --delete-parameter=PARAM
143 Delete named parameter for resource. Use instance attribute un‐
144 less --meta or --utilization is specified.
145
146 Locations:
147 -M, --move
148 Create a constraint to move resource. If --node is specified,
149 the constraint will be to move to that node, otherwise it will
150 be to ban the current node. Unless --force is specified this
151 will return an error if the resource is already running on the
152 specified node. If --force is specified, this will always ban
153 the current node. Optional: --lifetime, --promoted. NOTE: This
154 may prevent the resource from running on its previous location
155 until the implicit constraint expires or is removed with
156 --clear.
157
158 -B, --ban
159 Create a constraint to keep resource off a node. Optional:
160 --node, --lifetime, --promoted. NOTE: This will prevent the re‐
161 source from running on the affected node until the implicit con‐
162 straint expires or is removed with --clear. If --node is not
163 specified, it defaults to the node currently running the re‐
164 source for primitives and groups, or the promoted instance of
165 promotable clones with promoted-max=1 (all other situations re‐
166 sult in an error as there is no sane default).
167
168 -U, --clear
169 Remove all constraints created by the --ban and/or --move com‐
170 mands. Requires: --resource. Optional: --node, --promoted, --ex‐
171 pired. If --node is not specified, all constraints created by
172 --ban and --move will be removed for the named resource. If
173 --node and --force are specified, any constraint created by
174 --move will be cleared, even if it is not for the specified
175 node. If --expired is specified, only those constraints whose
176 lifetimes have expired will be removed.
177
178 -e, --expired
179 Modifies the --clear argument to remove constraints with expired
180 lifetimes.
181
182 -u, --lifetime=TIMESPEC
183 Lifespan (as ISO 8601 duration) of created constraints (with -B,
184 -M) see https://en.wikipedia.org/wiki/ISO_8601#Durations)
185
186 --promoted
187 Limit scope of command to promoted role (with -B, -M, -U). For
188 -B and -M, previously promoted instances may remain active in
189 the unpromoted role.
190
191 --master
192 Deprecated: Use --promoted instead
193
194 Advanced:
195 -D, --delete
196 (Advanced) Delete a resource from the CIB. Required: -t
197
198 -F, --fail
199 (Advanced) Tell the cluster this resource has failed
200
201 --restart
202 (Advanced) Tell the cluster to restart this resource and any‐
203 thing that depends on it
204
205 --wait (Advanced) Wait until the cluster settles into a stable state
206
207 --digests
208 (Advanced) Show parameter hashes that Pacemaker uses to detect
209 configuration changes (only accurate if there is resource his‐
210 tory on the specified node). Required: --resource, --node. Op‐
211 tional: any NAME=VALUE parameters will be used to override the
212 configuration (to see what the hash would be with those
213 changes).
214
215 --force-demote
216 (Advanced) Bypass the cluster and demote a resource on the local
217 node. Unless --force is specified, this will refuse to do so if
218 the cluster believes the resource is a clone instance already
219 running on the local node.
220
221 --force-stop
222 (Advanced) Bypass the cluster and stop a resource on the local
223 node
224
225 --force-start
226 (Advanced) Bypass the cluster and start a resource on the local
227 node. Unless --force is specified, this will refuse to do so if
228 the cluster believes the resource is a clone instance already
229 running on the local node.
230
231 --force-promote
232 (Advanced) Bypass the cluster and promote a resource on the lo‐
233 cal node. Unless --force is specified, this will refuse to do so
234 if the cluster believes the resource is a clone instance already
235 running on the local node.
236
237 --force-check=LEVEL
238 (Advanced) Bypass the cluster and check the state of a resource
239 on the local node. An optional LEVEL argument can be given to
240 control the level of checking performed.
241
242 Additional Options:
243 -N, --node=NAME
244 Node name
245
246 --recursive
247 Follow colocation chains when using --set-parameter or --con‐
248 straints
249
250 -t, --resource-type=ELEMENT
251 Resource XML element (primitive, group, etc.) (with -D)
252
253 -v, --parameter-value=PARAM
254 Value to use with -p
255
256 -m, --meta
257 Use resource meta-attribute instead of instance attribute (with
258 -p, -g, -d)
259
260 -z, --utilization
261 Use resource utilization attribute instead of instance attribute
262 (with -p, -g, -d)
263
264 -n, --operation=OPERATION
265 Operation to clear instead of all (with -C -r)
266
267 -I, --interval=N
268 Interval of operation to clear (default 0) (with -C -r -n)
269
270 --class=CLASS
271 The standard the resource agent conforms to (for example, ocf).
272 Use with --agent, --provider, --option, and --validate.
273
274 --agent=AGENT
275 The agent to use (for example, IPaddr). Use with --class,
276 --provider, --option, and --validate.
277
278 --provider=PROVIDER
279 The vendor that supplies the resource agent (for example, heart‐
280 beat). Use with --class, --agent, --option, and --validate.
281
282 --option=PARAM
283 Specify a device configuration parameter as NAME=VALUE (may be
284 specified multiple times). Use with --validate and without the
285 -r option.
286
287 -s, --set-name=ID
288 (Advanced) XML ID of attributes element to use (with -p, -d)
289
290 -i, --nvpair=ID
291 (Advanced) XML ID of nvpair element to use (with -p, -d)
292
293 -T, --timeout=N
294 (Advanced) Abort if command does not finish in this time (with
295 --restart, --wait, --force-*)
296
297 -f, --force
298 If making CIB changes, do so regardless of quorum. See help for
299 individual commands for additional behavior.
300
301 Application Options:
302 -$, --version
303 Display software version and exit
304
305 -V, --verbose
306 Increase debug output (may be specified multiple times)
307
308 -Q, --quiet
309 Be less descriptive in output.
310
311 -r, --resource=ID
312 Resource ID
313
315 List the available OCF agents:
316
317 # crm_resource --list-agents ocf
318
319 List the available OCF agents from the linux-ha project:
320
321 # crm_resource --list-agents ocf:heartbeat
322
323 Move 'myResource' to a specific node:
324
325 # crm_resource --resource myResource --move --node altNode
326
327 Allow (but not force) 'myResource' to move back to its original loca‐
328 tion:
329
330 # crm_resource --resource myResource --clear
331
332 Stop 'myResource' (and anything that depends on it):
333
334 # crm_resource --resource myResource --set-parameter target-role
335 --meta --parameter-value Stopped
336
337 Tell the cluster not to manage 'myResource' (the cluster will not at‐
338 tempt to start or stop the resource under any circumstances; useful
339 when performing maintenance tasks on a resource):
340
341 # crm_resource --resource myResource --set-parameter is-managed
342 --meta --parameter-value false
343
344 Erase the operation history of 'myResource' on 'aNode' (the cluster
345 will 'forget' the existing resource state, including any errors, and
346 attempt to recover theresource; useful when a resource had failed per‐
347 manently and has been repaired by an administrator):
348
349 # crm_resource --resource myResource --cleanup --node aNode
350
352 Written by Andrew Beekhof and the Pacemaker project contributors
353
354
355
356Pacemaker 2.1.5-3.fc37 December 2022 PACEMAKER(8)