Reference

crm_resource(8)

Part of the Pacemaker cluster resource manager

NAME

Pacemaker - Part of the Pacemaker cluster resource manager

SYNOPSIS

crm_resource <query>|<command> [options]

DESCRIPTION

crm_resource - perform tasks related to Pacemaker cluster resources

OPTIONS

Help Options:

-h, --help

Show help options

--help-all

Show all help options

--help-output

Show output help

--help-queries

Show query help

--help-commands

Show command help

--help-locations

Show location help

--help-advanced

Show advanced option help

--help-additional

Show additional options

Output Options:

--output-as=FORMAT

Specify output format as one of: text (default), xml

--output-to=DEST

Specify file name for output (or "-" for stdout)

Queries:

-L, --list

List all cluster resources with status

-l, --list-raw

List IDs of all instantiated resources (individual members rather than groups etc.)

-O, --list-operations

List active resource operations, optionally filtered by --resource and/or --node

-o, --list-all-operations

List all resource operations, optionally filtered by --resource and/or --node

--list-options=TYPE

List all available options of the given type. Allowed values: primitive (primitive resource meta-attributes), fencing (parameters common to all fencing resources)

--list-standards

List supported standards

--list-ocf-providers

List all available OCF providers

--list-agents=STD:PROV

List all agents available for the named standard and/or provider

--list-ocf-alternatives=AGENT

List all available providers for the named OCF agent

--show-metadata=SPEC

Show the metadata for the named class:provider:agent

-q, --query-xml

Show XML configuration of resource (after any template expansion)

-w, --query-xml-raw

Show XML configuration of resource (before any template expansion)

-g, --get-parameter=PARAM

Display named parameter for resource (use instance attribute unless --element, --meta, or --utilization is specified)

-W, --locate

Show node(s) currently running resource

-a, --constraints

Display the location and colocation constraints that apply to a resource, and if --recursive is specified, to the resources directly or indirectly involved in those colocations. If the named resource is part of a group, or a clone or bundle instance, constraints for the collective resource will be shown unless --force is given.

-A, --stack

Equivalent to --constraints --recursive

-Y, --why

Show why resources are not running, optionally filtered by --resource and/or --node

Commands:

--validate=LEVEL

Validate resource configuration by calling agent's validate-all action. The configuration may be specified either by giving an existing resource name with -r, or by specifying --class, --agent, and --provider arguments, along with any number of --option arguments. An optional LEVEL argument can be given to control the level of checking performed.

-C, --cleanup

If resource has any past failures, clear its history and fail count. Optionally filtered by --resource, --node, --operation and --interval (otherwise all). --operation and --interval apply to fail counts, but entire history is always clear, to allow current state to be rechecked. If the named resource is part of a group, or one numbered instance of a clone or bundled resource, the clean-up applies to the whole collective resource unless --force is given.

-R, --refresh

Delete resource's history (including failures) so its current state is rechecked. Optionally filtered by --resource and --node (otherwise all). If the named resource is part of a group, or one numbered instance of a clone or bundled resource, the refresh applies to the whole collective resource unless --force is given.

-p, --set-parameter=PARAM

Set named parameter for resource (requires -v). Use instance attribute unless --element, --meta, or --utilization is specified.

-d, --delete-parameter=PARAM

Delete named parameter for resource. Use instance attribute unless --element, --meta or, --utilization is specified.

Locations:

-M, --move

Create a constraint to move resource. If --node is specified, the constraint will be to move to that node, otherwise it will be to ban the current node. Unless --force is specified this will return an error if the resource is already running on the specified node. If --force is specified, this will always ban the current node. Optional: --lifetime, --promoted. NOTE: This may prevent the resource from running on its previous location until the implicit constraint expires or is removed with --clear.

-B, --ban

Create a constraint to keep resource off a node. Optional: --node, --lifetime, --promoted. NOTE: This will prevent the resource from running on the affected node until the implicit constraint expires or is removed with --clear. If --node is not specified, it defaults to the node currently running the resource for primitives and groups, or the promoted instance of promotable clones with promoted-max=1 (all other situations result in an error as there is no sane default).

-U, --clear

Remove all constraints created by the --ban and/or --move commands. Requires: --resource. Optional: --node, --promoted, --expired. If --node is not specified, all constraints created by --ban and --move will be removed for the named resource. If --node and --force are specified, any constraint created by --move will be cleared, even if it is not for the specified node. If --expired is specified, only those constraints whose lifetimes have expired will be removed.

-e, --expired

Modifies the --clear argument to remove constraints with expired lifetimes.

-u, --lifetime=TIMESPEC

Lifespan (as ISO 8601 duration) of created constraints (with -B, -M) see https://en.wikipedia.org/wiki/ISO_8601#Durations)

--promoted

Limit scope of command to promoted role (with -B, -M, -U). For -B and -M, previously promoted instances may remain active in the unpromoted role.

--master

Deprecated: Use --promoted instead

Advanced:

-D, --delete

(Advanced) Delete a resource from the CIB. Required: -t

-F, --fail

(Advanced) Tell the cluster this resource has failed

--restart

(Advanced) Tell the cluster to restart this resource and anything that depends on it

--wait

(Advanced) Wait until the cluster settles into a stable state

--digests

(Advanced) Show parameter hashes that Pacemaker uses to detect configuration changes (only accurate if there is resource history on the specified node). Required: --resource, --node. Optional: any NAME=VALUE parameters will be used to override the configuration (to see what the hash would be with those changes).

--force-demote

(Advanced) Bypass the cluster and demote a resource on the local node. Unless --force is specified, this will refuse to do so if the cluster believes the resource is a clone instance already running on the local node.

--force-stop

(Advanced) Bypass the cluster and stop a resource on the local node

--force-start

(Advanced) Bypass the cluster and start a resource on the local node. Unless --force is specified, this will refuse to do so if the cluster believes the resource is a clone instance already running on the local node.

--force-promote

(Advanced) Bypass the cluster and promote a resource on the local node. Unless --force is specified, this will refuse to do so if the cluster believes the resource is a clone instance already running on the local node.

--force-check=LEVEL

(Advanced) Bypass the cluster and check the state of a resource on the local node. An optional LEVEL argument can be given to control the level of checking performed.

Additional Options:

-N, --node=NAME

Node name

--recursive

Follow colocation chains when using --set-parameter or --constraints

-t, --resource-type=ELEMENT

Resource XML element (primitive, group, etc.) (with -D)

-v, --parameter-value=PARAM

Value to use with -p

-m, --meta

Use resource meta-attribute instead of instance attribute (with -p, -g, -d)

-z, --utilization

Use resource utilization attribute instead of instance attribute (with -p, -g, -d)

--element

Use resource element attribute instead of instance attribute (with -p, -g, -d)

-n, --operation=OPERATION

Operation to clear instead of all (with -C -r)

-I, --interval=N

Interval of operation to clear (default 0) (with -C -r -n)

--class=CLASS

The standard the resource agent conforms to (for example, ocf). Use with --agent, --provider, --option, and --validate.

--agent=AGENT

The agent to use (for example, IPaddr). Use with --class, --provider, --option, and --validate.

--provider=PROVIDER

The vendor that supplies the resource agent (for example, heartbeat). Use with --class, --agent, --option, and --validate.

--option=PARAM

Specify a device configuration parameter as NAME=VALUE (may be specified multiple times). Use with --validate and without the -r option.

-s, --set-name=ID

(Advanced) XML ID of attributes element to use (with -p, -d)

-i, --nvpair=ID

(Advanced) XML ID of nvpair element to use (with -p, -d)

-T, --timeout=N

(Advanced) Abort if command does not finish in this time (with --restart, --wait, --force-*)

--all

List all options, including advanced and deprecated (with --list-options)

-f, --force

Force the action to be performed. See help for individual commands for additional behavior.

Application Options:

-$, --version

Display software version and exit

-V, --verbose

Increase debug output (may be specified multiple times)

-Q, --quiet

Be less descriptive in output.

-r, --resource=ID

Resource ID

EXAMPLES

List the available OCF agents:

# crm_resource --list-agents ocf

List the available OCF agents from the linux-ha project:

# crm_resource --list-agents ocf:heartbeat

Move 'myResource' to a specific node:

# crm_resource --resource myResource --move --node altNode

Allow (but not force) 'myResource' to move back to its original location:

# crm_resource --resource myResource --clear

Stop 'myResource' (and anything that depends on it):

# crm_resource --resource myResource --set-parameter target-role--meta --parameter-value Stopped

Tell the cluster not to manage 'myResource' (the cluster will not attempt to start or stop the resource under any circumstances; useful when performing maintenance tasks on a resource):

# crm_resource --resource myResource --set-parameter is-managed--meta --parameter-value false

Erase the operation history of 'myResource' on 'aNode' (the cluster will 'forget' the existing resource state, including any errors, and attempt to recover theresource; useful when a resource had failed permanently and has been repaired by an administrator):

# crm_resource --resource myResource --cleanup --node aNode

AUTHOR

Written by Andrew Beekhof and the Pacemaker project contributors

History

-$ since Debian 7 (Wheezy); --agent since Debian 11 (Bullseye); --all since Debian 13 (Trixie); --ban since Debian 9 (Stretch); --class since Debian 11 (Bullseye); --clear since Debian 9 (Stretch); --constraints since Debian 7 (Wheezy); --digests since Debian 12 (Bookworm); --element since Debian 13 (Trixie); --expired since Debian 10 (Buster); --fail since Debian 7 (Wheezy); --force since Debian 10 (Buster); --force-check since Debian 9 (Stretch); --force-demote since Debian 9 (Stretch); --force-promote since Debian 9 (Stretch); --force-start since Debian 9 (Stretch); --force-stop since Debian 9 (Stretch); --help-additional since Debian 11 (Bullseye); --help-advanced since Debian 11 (Bullseye); --help-all since Debian 11 (Bullseye); --help-commands since Debian 11 (Bullseye); --help-locations since Debian 11 (Bullseye); --help-output since Debian 12 (Bookworm); --help-queries since Debian 11 (Bullseye); --interval since Debian 10 (Buster); --lifetime since Debian 7 (Wheezy); --list-agents since Debian 9 (Stretch); --list-all-operations since Debian 7 (Wheezy); --list-ocf-alternatives since Debian 9 (Stretch); --list-ocf-providers since Debian 9 (Stretch); --list-operations since Debian 7 (Wheezy); --list-options since Debian 13 (Trixie); --list-raw since Debian 7 (Wheezy); --list-standards since Debian 9 (Stretch); --master since Debian 9 (Stretch); --meta since Debian 7 (Wheezy); --move since Debian 7 (Wheezy); --node since Debian 7 (Wheezy); --nvpair since Debian 7 (Wheezy); --operation since Debian 10 (Buster); --option since Debian 11 (Bullseye); --output-as since Debian 12 (Bookworm); --output-to since Debian 12 (Bookworm); --parameter-value since Debian 7 (Wheezy); --promoted since Debian 12 (Bookworm); --provider since Debian 11 (Bullseye); --query-xml-raw since Debian 7 (Wheezy); --recursive since Debian 9 (Stretch); --refresh since Debian 10 (Buster); --restart since Debian 9 (Stretch); --set-name since Debian 7 (Wheezy); --show-metadata since Debian 9 (Stretch); --stack since Debian 7 (Wheezy); --timeout since Debian 9 (Stretch); --utilization since Debian 7 (Wheezy); --validate since Debian 10 (Buster); --version since Debian 7 (Wheezy); --wait since Debian 9 (Stretch); --why since Debian 10 (Buster); -A since Debian 7 (Wheezy); -B since Debian 9 (Stretch); -F since Debian 7 (Wheezy); -I since Debian 10 (Buster); -N since Debian 7 (Wheezy); -O since Debian 7 (Wheezy); -R since Debian 10 (Buster); -T since Debian 9 (Stretch); -Y since Debian 10 (Buster); -a since Debian 7 (Wheezy); -e since Debian 10 (Buster); -f since Debian 10 (Buster); -h since Debian 11 (Bullseye); -l since Debian 7 (Wheezy); -m since Debian 7 (Wheezy); -n since Debian 10 (Buster); -o since Debian 7 (Wheezy); -q since Debian 7 (Wheezy); -u since Debian 7 (Wheezy); -w since Debian 7 (Wheezy); -z since Debian 7 (Wheezy).

--force-relocation until Debian 6.0 (Squeeze); --get-property until Debian 6.0 (Squeeze); --help-validate until Debian 11 (Bullseye); --host-uname until Debian 6.0 (Squeeze); --migrate until Debian 6.0 (Squeeze); --property-value until Debian 6.0 (Squeeze); --reprobe until Debian 7 (Wheezy); --set-property until Debian 6.0 (Squeeze); --text-fancy until Debian 12 (Bookworm); --un-migrate until Debian 6.0 (Squeeze); --un-move until Debian 7 (Wheezy); -? until Debian 10 (Buster); -G until Debian 6.0 (Squeeze); -H until Debian 6.0 (Squeeze); -P until Debian 7 (Wheezy); -S until Debian 6.0 (Squeeze); -x until Debian 6.0 (Squeeze).