Scroll to navigation

PACEMAKER(8) System Administration Utilities PACEMAKER(8)

NAME

Pacemaker - Part of the Pacemaker cluster resource manager

SYNOPSIS

crm_resource (query|command) [options]

DESCRIPTION

crm_resource - Perform tasks related to cluster resources. Allows resources to be queried (definition and location), modified, and moved around the cluster.

OPTIONS

-?, --help
Display this text and exit
-$, --version
Display version information and exit
Increase debug output (may be specified multiple times)
Be less descriptive in results
Resource ID

Queries:

List all cluster resources with status
List IDs of all instantiated resources (individual members rather than groups etc.)
List active resource operations, optionally filtered by --resource and/or --node
List all resource operations, optionally filtered by --resource and/or --node
List supported standards
List all available OCF providers
List all agents available for the named standard and/or provider.
List all available providers for the named OCF agent
Show the metadata for the named class:provider:agent
Show XML configuration of resource (after any template expansion)
Show XML configuration of resource (before any template expansion)
Display named parameter for resource. Use instance attribute unless --meta or --utilization is specified
Show node(s) currently running resource
Display the prerequisites and dependents of a resource
Display the (co)location constraints that apply to a resource
Show why resources are not running, optionally filtered by --resource and/or --node

Commands:

Call the validate-all action of the local given resource
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 cleared, 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.
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.

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

Resource location:

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, --master. NOTE: This may prevent the resource from running on its previous location until the implicit constraint expires or is removed with --clear.
Create a constraint to keep resource off a node. Optional: --node, --lifetime, --master. 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 master for master/slave clones with master-max=1 (all other situations result in an error as there is no sane default).
Remove all constraints created by the --ban and/or --move commands. Requires: --resource. Optional: --node, --master, --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.
Modifies the --clear argument to remove constraints with expired lifetimes.
Lifespan (as ISO 8601 duration) of created constraints (with -B, -M) (see https://en.wikipedia.org/wiki/ISO_8601#Durations)
Limit scope of command to the Master role (with -B, -M, -U). For -B and -M, the previous master may remain active in the Slave role.

Advanced Commands:

(Advanced) Delete a resource from the CIB. Required: -t
(Advanced) Tell the cluster this resource has failed
(Advanced) Tell the cluster to restart this resource and anything that depends on it
(Advanced) Wait until the cluster settles into a stable state
(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.
(Advanced) Bypass the cluster and stop a resource on the local node.
(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.
(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.
(Advanced) Bypass the cluster and check the state of a resource on the local node.

Additional Options:

Node name
Follow colocation chains when using --set-parameter
Resource XML element (primitive, group, etc.) (with -D)
Value to use with -p
Use resource meta-attribute instead of instance attribute (with -p, -g, -d)
Use resource utilization attribute instead of instance attribute (with -p, -g, -d)
Operation to clear instead of all (with -C -r)
Interval of operation to clear (default 0) (with -C -r -n)
(Advanced) XML ID of attributes element to use (with -p, -d)
(Advanced) XML ID of nvpair element to use (with -p, -d)
(Advanced) Abort if command does not finish in this time (with --restart, --wait, --force-*)
If making CIB changes, do so regardless of quorum. See help for individual commands for additional behavior.

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 the resource. 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

REPORTING BUGS

Report bugs to users@clusterlabs.org

December 2020 Pacemaker 1.1.23-1.el7_9.1