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, --stack
97 Display the (co)location constraints that apply to a resource
98 and the resources is it colocated with
99
100 -a, --constraints
101 Display the (co)location constraints that apply to a resource
102
103 -Y, --why
104 Show why resources are not running, optionally filtered by --re‐
105 source and/or --node
106
107 Commands:
108 --validate
109 Validate resource configuration by calling agent's validate-all
110 action. The configuration may be specified either by giving an
111 existing resource name with -r, or by specifying --class,
112 --agent, and --provider arguments, along with any number of
113 --option arguments.
114
115 -C, --cleanup
116 If resource has any past failures, clear its history and fail
117 count. Optionally filtered by --resource, --node, --operation
118 and --interval (otherwise all). --operation and --interval apply
119 to fail counts, but entire history is always clear, to allow
120 current state to be rechecked. If the named resource is part of
121 a group, or one numbered instance of a clone or bundled re‐
122 source, the clean-up applies to the whole collective resource
123 unless --force is given.
124
125 -R, --refresh
126 Delete resource's history (including failures) so its current
127 state is rechecked. Optionally filtered by --resource and --node
128 (otherwise all). If the named resource is part of a group, or
129 one numbered instance of a clone or bundled resource, the re‐
130 fresh applies to the whole collective resource unless --force is
131 given.
132
133 -p, --set-parameter=PARAM
134 Set named parameter for resource (requires -v). Use instance at‐
135 tribute unless --meta or --utilization is specified.
136
137 -d, --delete-parameter=PARAM
138 Delete named parameter for resource. Use instance attribute un‐
139 less --meta or --utilization is specified.
140
141 Locations:
142 -M, --move
143 Create a constraint to move resource. If --node is specified,
144 the constraint will be to move to that node, otherwise it will
145 be to ban the current node. Unless --force is specified this
146 will return an error if the resource is already running on the
147 specified node. If --force is specified, this will always ban
148 the current node. Optional: --lifetime, --promoted. NOTE: This
149 may prevent the resource from running on its previous location
150 until the implicit constraint expires or is removed with
151 --clear.
152
153 -B, --ban
154 Create a constraint to keep resource off a node. Optional:
155 --node, --lifetime, --promoted. NOTE: This will prevent the re‐
156 source from running on the affected node until the implicit con‐
157 straint expires or is removed with --clear. If --node is not
158 specified, it defaults to the node currently running the re‐
159 source for primitives and groups, or the promoted instance of
160 promotable clones with promoted-max=1 (all other situations re‐
161 sult in an error as there is no sane default).
162
163 -U, --clear
164 Remove all constraints created by the --ban and/or --move com‐
165 mands. Requires: --resource. Optional: --node, --promoted, --ex‐
166 pired. If --node is not specified, all constraints created by
167 --ban and --move will be removed for the named resource. If
168 --node and --force are specified, any constraint created by
169 --move will be cleared, even if it is not for the specified
170 node. If --expired is specified, only those constraints whose
171 lifetimes have expired will be removed.
172
173 -e, --expired
174 Modifies the --clear argument to remove constraints with expired
175 lifetimes.
176
177 -u, --lifetime=TIMESPEC
178 Lifespan (as ISO 8601 duration) of created constraints (with -B,
179 -M) see https://en.wikipedia.org/wiki/ISO_8601#Durations)
180
181 --promoted
182 Limit scope of command to promoted role (with -B, -M, -U). For
183 -B and -M, previously promoted instances may remain active in
184 the unpromoted role.
185
186 --master
187 Deprecated: Use --promoted instead
188
189 Advanced:
190 -D, --delete
191 (Advanced) Delete a resource from the CIB. Required: -t
192
193 -F, --fail
194 (Advanced) Tell the cluster this resource has failed
195
196 --restart
197 (Advanced) Tell the cluster to restart this resource and any‐
198 thing that depends on it
199
200 --wait (Advanced) Wait until the cluster settles into a stable state
201
202 --digests
203 (Advanced) Show parameter hashes that Pacemaker uses to detect
204 configuration changes (only accurate if there is resource his‐
205 tory on the specified node). Required: --resource, --node. Op‐
206 tional: any NAME=VALUE parameters will be used to override the
207 configuration (to see what the hash would be with those
208 changes).
209
210 --force-demote
211 (Advanced) Bypass the cluster and demote a resource on the local
212 node. Unless --force is specified, this will refuse to do so if
213 the cluster believes the resource is a clone instance already
214 running on the local node.
215
216 --force-stop
217 (Advanced) Bypass the cluster and stop a resource on the local
218 node
219
220 --force-start
221 (Advanced) Bypass the cluster and start a resource on the local
222 node. Unless --force is specified, this will refuse to do so if
223 the cluster believes the resource is a clone instance already
224 running on the local node.
225
226 --force-promote
227 (Advanced) Bypass the cluster and promote a resource on the lo‐
228 cal node. Unless --force is specified, this will refuse to do so
229 if the cluster believes the resource is a clone instance already
230 running on the local node.
231
232 --force-check
233 (Advanced) Bypass the cluster and check the state of a resource
234 on the local node
235
236 Additional Options:
237 -N, --node=NAME
238 Node name
239
240 --recursive
241 Follow colocation chains when using --set-parameter
242
243 -t, --resource-type=ELEMENT
244 Resource XML element (primitive, group, etc.) (with -D)
245
246 -v, --parameter-value=PARAM
247 Value to use with -p
248
249 -m, --meta
250 Use resource meta-attribute instead of instance attribute (with
251 -p, -g, -d)
252
253 -z, --utilization
254 Use resource utilization attribute instead of instance attribute
255 (with -p, -g, -d)
256
257 -n, --operation=OPERATION
258 Operation to clear instead of all (with -C -r)
259
260 -I, --interval=N
261 Interval of operation to clear (default 0) (with -C -r -n)
262
263 --class=CLASS
264 The standard the resource agent conforms to (for example, ocf).
265 Use with --agent, --provider, --option, and --validate.
266
267 --agent=AGENT
268 The agent to use (for example, IPaddr). Use with --class,
269 --provider, --option, and --validate.
270
271 --provider=PROVIDER
272 The vendor that supplies the resource agent (for example, heart‐
273 beat). Use with --class, --agent, --option, and --validate.
274
275 --option=PARAM
276 Specify a device configuration parameter as NAME=VALUE (may be
277 specified multiple times). Use with --validate and without the
278 -r option.
279
280 -s, --set-name=ID
281 (Advanced) XML ID of attributes element to use (with -p, -d)
282
283 -i, --nvpair=ID
284 (Advanced) XML ID of nvpair element to use (with -p, -d)
285
286 -T, --timeout=N
287 (Advanced) Abort if command does not finish in this time (with
288 --restart, --wait, --force-*)
289
290 -f, --force
291 If making CIB changes, do so regardless of quorum. See help for
292 individual commands for additional behavior.
293
294 Application Options:
295 -$, --version
296 Display software version and exit
297
298 -V, --verbose
299 Increase debug output (may be specified multiple times)
300
301 -Q, --quiet
302 Be less descriptive in output.
303
304 -r, --resource=ID
305 Resource ID
306
308 List the available OCF agents:
309
310 # crm_resource --list-agents ocf
311
312 List the available OCF agents from the linux-ha project:
313
314 # crm_resource --list-agents ocf:heartbeat
315
316 Move 'myResource' to a specific node:
317
318 # crm_resource --resource myResource --move --node altNode
319
320 Allow (but not force) 'myResource' to move back to its original loca‐
321 tion:
322
323 # crm_resource --resource myResource --clear
324
325 Stop 'myResource' (and anything that depends on it):
326
327 # crm_resource --resource myResource --set-parameter target-role
328 --meta --parameter-value Stopped
329
330 Tell the cluster not to manage 'myResource' (the cluster will not at‐
331 tempt to start or stop the resource under any circumstances; useful
332 when performing maintenance tasks on a resource):
333
334 # crm_resource --resource myResource --set-parameter is-managed
335 --meta --parameter-value false
336
337 Erase the operation history of 'myResource' on 'aNode' (the cluster
338 will 'forget' the existing resource state, including any errors, and
339 attempt to recover theresource; useful when a resource had failed per‐
340 manently and has been repaired by an administrator):
341
342 # crm_resource --resource myResource --cleanup --node aNode
343
345 Written by Andrew Beekhof
346
347
348
349Pacemaker 2.1.0-0.2.rc1.fc34 May 2021 PACEMAKER(8)