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