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 of the local given resource
92
93 -C, --cleanup
94 If resource has any past failures, clear its history and fail
95 count. Optionally filtered by --resource, --node, --operation,
96 and --interval (otherwise all). --operation and --interval
97 apply to fail counts, but entire history is always cleared, to
98 allow current state to be rechecked.
99
100 -R, --refresh
101 Delete resource's history (including failures) so its current
102 state is rechecked. Optionally filtered by --resource and
103 --node (otherwise all). Unless --force is specified, resource's
104 group or clone (if any) will also be refreshed.
105
106 -p, --set-parameter=value
107 Set named parameter for resource (requires -v). Use instance
108 attribute unless --meta or --utilization is specified.
109
110 -d, --delete-parameter=value
111 Delete named parameter for resource. Use instance attribute
112 unless --meta or --utilization is specified.
113
114 Resource location:
115 -M, --move
116 Create a constraint to move resource. If --node is specified,
117 the constraint will be to move to that node, otherwise it will
118 be to ban the current node. Unless --force is specified, this
119 will return an error if the resource is already running on the
120 specified node. If --force is specified, this will always ban
121 the current node. Optional: --lifetime, --master. NOTE: This
122 may prevent the resource from running on its previous location
123 until the implicit constraint expires or is removed with
124 --clear.
125
126 -B, --ban
127 Create a constraint to keep resource off a node. Optional:
128 --node, --lifetime, --master. NOTE: This will prevent the
129 resource from running on the affected node until the implicit
130 constraint expires or is removed with --clear. If --node is not
131 specified, it defaults to the node currently running the
132 resource for primitives and groups, or the master for promotable
133 clones with promoted-max=1 (all other situations result in an
134 error as there is no sane default).
135
136 -U, --clear
137 Remove all constraints created by the --ban and/or --move com‐
138 mands. Requires: --resource. Optional: --node, --master,
139 --expired. If --node is not specified, all constraints created
140 by --ban and --move will be removed for the named resource. If
141 --node and --force are specified, any constraint created by
142 --move will be cleared, even if it is not for the specified
143 node. If --expired is specified, only those constraints whose
144 lifetimes have expired will be removed.
145
146 -e, --expired
147 Modifies the --clear argument to remove constraints with expired
148 lifetimes.
149
150 -u, --lifetime=value
151 Lifespan (as ISO 8601 duration) of created constraints (with -B,
152 -M) (see https://en.wikipedia.org/wiki/ISO_8601#Durations)
153
154 --master
155 Limit scope of command to the Master role (with -B, -M, -U).
156 For -B and -M, the previous master may remain active in the
157 Slave role.
158
159 Advanced Commands:
160 -D, --delete
161 (Advanced) Delete a resource from the CIB. Required: -t
162
163 -F, --fail
164 (Advanced) Tell the cluster this resource has failed
165
166 --restart
167 (Advanced) Tell the cluster to restart this resource and any‐
168 thing that depends on it
169
170 --wait (Advanced) Wait until the cluster settles into a stable state
171
172 --force-demote
173 (Advanced) Bypass the cluster and demote a resource on the local
174 node. Unless --force is specified, this will refuse to do so if
175 the cluster believes the resource is a clone instance already
176 running on the local node.
177
178 --force-stop
179 (Advanced) Bypass the cluster and stop a resource on the local
180 node.
181
182 --force-start
183 (Advanced) Bypass the cluster and start a resource on the local
184 node. Unless --force is specified, this will refuse to do so if
185 the cluster believes the resource is a clone instance already
186 running on the local node.
187
188 --force-promote
189 (Advanced) Bypass the cluster and promote a resource on the
190 local node. Unless --force is specified, this will refuse to do
191 so if the cluster believes the resource is a clone instance
192 already running on the local node.
193
194 --force-check
195 (Advanced) Bypass the cluster and check the state of a resource
196 on the local node.
197
198 Additional Options:
199 -N, --node=value
200 Node name
201
202 --recursive
203 Follow colocation chains when using --set-parameter
204
205 -t, --resource-type=value
206 Resource XML element (primitive, group, etc.) (with -D)
207
208 -v, --parameter-value=value
209 Value to use with -p
210
211 -m, --meta
212 Use resource meta-attribute instead of instance attribute (with
213 -p, -g, -d)
214
215 -z, --utilization
216 Use resource utilization attribute instead of instance attribute
217 (with -p, -g, -d)
218
219 -n, --operation=value
220 Operation to clear instead of all (with -C -r)
221
222 -I, --interval=value
223 Interval of operation to clear (default 0) (with -C -r -n)
224
225 -s, --set-name=value
226 (Advanced) XML ID of attributes element to use (with -p, -d)
227
228 -i, --nvpair=value
229 (Advanced) XML ID of nvpair element to use (with -p, -d)
230
231 -T, --timeout=value
232 (Advanced) Abort if command does not finish in this time (with
233 --restart, --wait, --force-*)
234
235 -f, --force
236 If making CIB changes, do so regardless of quorum. See help for
237 individual commands for additional behavior.
238
240 List the available OCF agents:
241
242 # crm_resource --list-agents ocf
243
244 List the available OCF agents from the linux-ha project:
245
246 # crm_resource --list-agents ocf:heartbeat
247
248 Move 'myResource' to a specific node:
249
250 # crm_resource --resource myResource --move --node altNode
251
252 Allow (but not force) 'myResource' to move back to its original loca‐
253 tion:
254
255 # crm_resource --resource myResource --clear
256
257 Stop 'myResource' (and anything that depends on it):
258
259 # crm_resource --resource myResource --set-parameter target-role
260 --meta --parameter-value Stopped
261
262 Tell the cluster not to manage 'myResource':
263
264 The cluster will not attempt to start or stop the resource under any
265 circumstances. Useful when performing maintenance tasks on a resource.
266
267 # crm_resource --resource myResource --set-parameter is-managed
268 --meta --parameter-value false
269
270 Erase the operation history of 'myResource' on 'aNode':
271
272 The cluster will 'forget' the existing resource state (including any
273 errors) and attempt to recover the resource. Useful when a resource
274 had failed permanently and has been repaired by an administrator.
275
276 # crm_resource --resource myResource --cleanup --node aNode
277
279 Written by Andrew Beekhof
280
282 Report bugs to users@clusterlabs.org
283
284
285
286Pacemaker 2.0.1-2.fc30 April 2019 PACEMAKER(8)