Product SiteDocumentation Site

5.4. Resource Options

Resources have two types of options: meta-attributes and instance attributes. Meta-attributes apply to any type of resource, while instance attributes are specific to each resource agent.

5.4.1. Resource Meta-Attributes

Meta-attributes are used by the cluster to decide how a resource should behave and can be easily set using the --meta option of the crm_resource command.

Table 5.2. Meta-attributes of a Primitive Resource

Field Default Description
priority
0
If not all resources can be active, the cluster will stop lower priority resources in order to keep higher priority ones active.
target-role
Started
What state should the cluster attempt to keep this resource in? Allowed values:
  • Stopped: Force the resource to be stopped
  • Started: Allow the resource to be started (and in the case of multi-state resources, promoted to master if appropriate)
  • Slave: Allow the resource to be started, but only in Slave mode if the resource is multi-state
  • Master: Equivalent to Started
is-managed
TRUE
Is the cluster allowed to start and stop the resource? Allowed values: true, false
resource-stickiness
value of resource-stickiness in the rsc_defaults section
How much does the resource prefer to stay where it is?
requires
fencing (unless stonith-enabled is false or class is stonith, in which case it defaults to quorum)
Conditions under which the resource can be started (since 1.1.8) Allowed values:
  • nothing: can always be started
  • quorum: The cluster can only start this resource if a majority of the configured nodes are active
  • fencing: The cluster can only start this resource if a majority of the configured nodes are active and any failed or unknown nodes have been powered off
  • unfencing: The cluster can only start this resource if a majority of the configured nodes are active and any failed or unknown nodes have been powered off and only on nodes that have been unfenced (since 1.1.9)
migration-threshold
INFINITY
How many failures may occur for this resource on a node, before this node is marked ineligible to host this resource. A value of 0 indicates that this feature is disabled (the node will never be marked ineligible); by constrast, the cluster treats INFINITY (the default) as a very large but finite number. This option has an effect only if the failed operation has on-fail=restart (the default), and additionally for failed start operations, if the cluster property start-failure-is-fatal is false.
failure-timeout
0
How many seconds to wait before acting as if the failure had not occurred, and potentially allowing the resource back to the node on which it failed. A value of 0 indicates that this feature is disabled. As with any time-based actions, this is not guaranteed to be checked more frequently than the value of cluster-recheck-interval (see Section 3.2, “Cluster Options”).
multiple-active
stop_start
What should the cluster do if it ever finds the resource active on more than one node? Allowed values:
  • block: mark the resource as unmanaged
  • stop_only: stop all active instances and leave them that way
  • stop_start: stop all active instances and start the resource in one location only
allow-migrate
TRUE for ocf:pacemaker:remote resources, FALSE otherwise
Whether the cluster should try to "live migrate" this resource when it needs to be moved (see Section 9.3.4, “Migrating Resources”)
remote-node
The name of the remote-node this resource defines. This both enables the resource as a remote-node and defines the unique name used to identify the remote-node. If no other parameters are set, this value will also be assumed as the hostname to connect to at the port specified by remote-port. WARNING: This value cannot overlap with any resource or node IDs. If not specified, this feature is disabled.
remote-port
3121
Port to use for the guest connection to pacemaker_remote
remote-addr
value of remote-node
The IP address or hostname to connect to if remote-node’s name is not the hostname of the guest.
remote-connect-timeout
60s
How long before a pending guest connection will time out.

Note

Support for remote nodes was added in pacemaker 1.1.10. If you are using an earlier version, options related to remote nodes will not be available.
As an example of setting resource options, if you performed the following commands on an LSB Email resource:
# crm_resource --meta --resource Email --set-parameter priority --parameter-value 100
# crm_resource -m -r Email -p multiple-active -v block
the resulting resource definition might be:

Example 5.3. An LSB resource with cluster options

<primitive id="Email" class="lsb" type="exim">
  <meta_attributes id="Email-meta_attributes">
    <nvpair id="Email-meta_attributes-priority" name="priority" value="100"/>
    <nvpair id="Email-meta_attributes-multiple-active" name="multiple-active" value="block"/>
  </meta_attributes>
</primitive>