Product SiteDocumentation Site

8.2. Node Attribute Expressions

Expression objects are used to control a resource based on the attributes defined by a node or nodes.

Table 8.2. Properties of an Expression

Field Default Description
id
A unique name for the expression (required)
attribute
The node attribute to test (required)
type
string
Determines how the value(s) should be tested. Allowed values are string, integer, and version.
operation
The comparison to perform (required). Allowed values:
  • lt: True if the value of the node’s attribute is less than value
  • gt: True if the value of the node’s attribute is greater than value
  • lte: True if the value of the node’s attribute is less than or equal to value
  • gte: True if the value of the node’s attribute is greater than or equal to value
  • eq: True if the value of the node’s attribute is equal to value
  • ne: True if the value of the node’s attribute is not equal to value
  • defined: True if the node has the named attribute
  • not_defined: True if the node does not have the named attribute
value
User-supplied value for comparison (required)
value-source
literal
How the value is derived (since 1.1.17). Allowed values:
  • literal: value is a literal string to compare against
  • param: value is the name of a resource parameter to compare against (only valid in location constraints)
  • meta: value is the name of a resource meta-attribute to compare against (only valid in location constraints)

In addition to any attributes added by the administrator, the cluster defines special, built-in node attributes for each node that can also be used.

Table 8.3. Built-in node attributes

Name Value
#uname
Node name
#id
Node ID
#kind
Node type. Possible values are cluster, remote, and container. Kind is remote for Pacemaker Remote nodes created with the ocf:pacemaker:remote resource, and container for Pacemaker Remote guest nodes and bundle nodes (since 1.1.13)
#is_dc
"true" if this node is a Designated Controller (DC), "false" otherwise
#cluster-name
The value of the cluster-name cluster property, if set
#site-name
The value of the site-name cluster property, if set, otherwise identical to #cluster-name
#role
The role the relevant multistate resource has on this node. Valid only within a rule for a location constraint for a multistate resource.