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. If
139 --node is not specified, all constraints created by --ban and
140 --move will be removed for the named resource. If --node and
141 --force are specified, any constraint created by --move will be
142 cleared, even if it is not for the specified node.
143
144 -u, --lifetime=value
145 Lifespan (as ISO 8601 duration) of created constraints (with -B,
146 -M) (see https://en.wikipedia.org/wiki/ISO_8601#Durations)
147
148 --master
149 Limit scope of command to the Master role (with -B, -M, -U).
150 For -B and -M, the previous master may remain active in the
151 Slave role.
152
153 Advanced Commands:
154 -D, --delete
155 (Advanced) Delete a resource from the CIB. Required: -t
156
157 -F, --fail
158 (Advanced) Tell the cluster this resource has failed
159
160 --restart
161 (Advanced) Tell the cluster to restart this resource and any‐
162 thing that depends on it
163
164 --wait (Advanced) Wait until the cluster settles into a stable state
165
166 --force-demote
167 (Advanced) Bypass the cluster and demote a resource on the local
168 node. Unless --force is specified, this will refuse to do so if
169 the cluster believes the resource is a clone instance already
170 running on the local node.
171
172 --force-stop
173 (Advanced) Bypass the cluster and stop a resource on the local
174 node.
175
176 --force-start
177 (Advanced) Bypass the cluster and start a resource on the local
178 node. Unless --force is specified, this will refuse to do so if
179 the cluster believes the resource is a clone instance already
180 running on the local node.
181
182 --force-promote
183 (Advanced) Bypass the cluster and promote a resource on the
184 local node. Unless --force is specified, this will refuse to do
185 so if the cluster believes the resource is a clone instance
186 already running on the local node.
187
188 --force-check
189 (Advanced) Bypass the cluster and check the state of a resource
190 on the local node.
191
192 Additional Options:
193 -N, --node=value
194 Node name
195
196 --recursive
197 Follow colocation chains when using --set-parameter
198
199 -t, --resource-type=value
200 Resource XML element (primitive, group, etc.) (with -D)
201
202 -v, --parameter-value=value
203 Value to use with -p
204
205 -m, --meta
206 Use resource meta-attribute instead of instance attribute (with
207 -p, -g, -d)
208
209 -z, --utilization
210 Use resource utilization attribute instead of instance attribute
211 (with -p, -g, -d)
212
213 -n, --operation=value
214 Operation to clear instead of all (with -C -r)
215
216 -I, --interval=value
217 Interval of operation to clear (default 0) (with -C -r -n)
218
219 -s, --set-name=value
220 (Advanced) XML ID of attributes element to use (with -p, -d)
221
222 -i, --nvpair=value
223 (Advanced) XML ID of nvpair element to use (with -p, -d)
224
225 -T, --timeout=value
226 (Advanced) Abort if command does not finish in this time (with
227 --restart, --wait, --force-*)
228
229 -f, --force
230 If making CIB changes, do so regardless of quorum. See help for
231 individual commands for additional behavior.
232
234 List the available OCF agents:
235
236 # crm_resource --list-agents ocf
237
238 List the available OCF agents from the linux-ha project:
239
240 # crm_resource --list-agents ocf:heartbeat
241
242 Move 'myResource' to a specific node:
243
244 # crm_resource --resource myResource --move --node altNode
245
246 Allow (but not force) 'myResource' to move back to its original loca‐
247 tion:
248
249 # crm_resource --resource myResource --clear
250
251 Stop 'myResource' (and anything that depends on it):
252
253 # crm_resource --resource myResource --set-parameter target-role
254 --meta --parameter-value Stopped
255
256 Tell the cluster not to manage 'myResource':
257
258 The cluster will not attempt to start or stop the resource under any
259 circumstances. Useful when performing maintenance tasks on a resource.
260
261 # crm_resource --resource myResource --set-parameter is-managed
262 --meta --parameter-value false
263
264 Erase the operation history of 'myResource' on 'aNode':
265
266 The cluster will 'forget' the existing resource state (including any
267 errors) and attempt to recover the resource. Useful when a resource
268 had failed permanently and has been repaired by an administrator.
269
270 # crm_resource --resource myResource --cleanup --node aNode
271
273 Written by Andrew Beekhof
274
276 Report bugs to users@clusterlabs.org
277
278
279
280Pacemaker 2.0.0-5.fc29 April 2019 PACEMAKER(8)