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