crm_attribute8
Part of the pacemaker cluster resource manager
Usage
crm_attribute -n
<attribute>
<command>
[options]
Overview
crm_attribute - query and update Pacemaker cluster options and node attributes
Options
Help Options:
-
-h, --help -
Show help options
-
--help-all -
Show all help options
-
--help-output -
Show output help
-
--help-selections -
Show selecting options
-
--help-command -
Show command options
-
--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)
Selecting attributes:
-
-a, --all -
With
-L/--list-options, include advanced and deprecated options in the output. This is always treated as true when--output-as=xml is specified.
-
-i, --id=XML_ID -
(Advanced) Operate on instance of specified attribute with this XML ID
-
-n, --name=NAME -
Operate on attribute or option with this name. For queries, this is optional, in which case all matching attributes will be returned.
-
-P, --pattern=PATTERN -
Operate on all attributes matching this pattern (with
-v,-D, or-G)
-
-p, --promotion=RESOURCE -
Operate on node attribute used as promotion score for specified resource, or resource given in OCF_RESOURCE_INSTANCE environment variable if none is specified; this also defaults
-l/--lifetime to reboot (normally invoked from an OCF resource agent)
-
-s, --set-name=NAME -
(Advanced) Operate on instance of specified attribute that is within set with this XML ID
Commands:
-
-L, --list-options=TYPE -
List all available options of the given type. Allowed values: cluster
-
-D, --delete -
Delete the attribute/option (with
-nor-P)
-
-G, --query -
Query the current value of the attribute/option. See also:
-n,-P
-
-v, --update=VALUE -
Update the value of the attribute/option (with
-nor-P)
Additional options:
-
-d, --default=VALUE -
(Advanced) Default value to display if none is found in configuration
-
-l, --lifetime=LIFETIME -
Lifetime of the node attribute. Valid values: reboot, forever
-
-N, --node=NODE -
Set a node attribute for named node (instead of a cluster option). See also:
-l
-
-t, --type=SECTION -
Which part of the configuration to update/delete/query the option in. Valid values: crm_config, rsc_defaults, op_defaults, tickets
-
--score -
Treat new attribute values as atomic score updates where possible (with
--update/-v, when running against a CIB file or updating an attribute outside the status section; enabled by default if--promotion/-p is specified)
- This currently happens by default and cannot be disabled, but
-
this default behavior is deprecated and will be removed in a future release (exception: this will remain the default with
--promotion/-p). Set this flag if this behavior is desired.
- This option takes effect when updating XML attributes. For an
-
attribute named "name", if the new value is "name++" or "name+=X" for some score X, the new value is set as follows:
- * If attribute "name" is not already set to some value in
-
the element being updated, the new value is set as a literal string.
- * If the new value is "name++", then the attribute is set to
-
its existing value (parsed as a score) plus 1.
- * If the new value is "name+=X" for some score X, then the
-
attribute is set to its existing value plus X, where the existing value and X are parsed and added as scores.
- Scores are integer values capped at INFINITY and
-INFINITY. -
Refer to Pacemaker Explained for more details on scores, including how they are parsed and added.
-
-W, --wait=UNTIL -
Wait for some event to occur before returning. Values are 'no' (wait only for the attribute daemon to acknowledge the request), 'local' (wait until the change has propagated to where a local query will return the request value, or the value set by a later request), or 'cluster' (wait until the change has propagated to where a query anywhere on the cluster will return the requested value, or the value set by a later request). Default is 'no'. (with
-N, and one of-Dor-u)
-
-z, --utilization -
Set an utilization attribute for the node.
Application Options:
-
-$, --version -
Display software version and exit
-
-V, --verbose -
Increase debug output (may be specified multiple times)
-
-q, --quiet -
Print only the value on stdout
Examples
Add new node attribute called 'location' with the value of 'office' for host 'myhost':
-
crm_attribute --node myhost --name location --update office
Query the value of the 'location' node attribute for host 'myhost':
-
crm_attribute --node myhost --name location --query
Change the value of the 'location' node attribute for host 'myhost':
-
crm_attribute --node myhost --name location --update backoffice
Delete the 'location' node attribute for host 'myhost':
-
crm_attribute --node myhost --name location --delete
Query the value of the 'cluster-delay' cluster option:
-
crm_attribute --type crm_config --name cluster-delay --query
Query value of the 'cluster-delay' cluster option and print only the value:
-
crm_attribute --type crm_config --name cluster-delay --query --quiet
Releases
6 releases since Debian 7 (Wheezy); the text changed 5 times.
--all since Debian 13 (Trixie);
--help-additional since Debian 12 (Bookworm);
--help-all since Debian 12 (Bookworm);
--help-command since Debian 12 (Bookworm);
--help-output since Debian 12 (Bookworm);
--help-selections since Debian 12 (Bookworm);
--list-options since Debian 13 (Trixie);
--output-as since Debian 12 (Bookworm);
--output-to since Debian 12 (Bookworm);
--pattern since Debian 10 (Buster);
--promotion since Debian 12 (Bookworm);
--score since Debian 13 (Trixie);
--wait since Debian 13 (Trixie);
-L since Debian 13 (Trixie);
-P since Debian 10 (Buster);
-W since Debian 13 (Trixie);
-a since Debian 13 (Trixie);
-h since Debian 12 (Bookworm);
-p since Debian 12 (Bookworm).
--text-fancy until Debian 12 (Bookworm);
-? until Debian 11 (Bullseye).