Promotable clone resources

Promotable clone resources have the promotable meta attribute set to true and operate in two modes: promoted and unpromoted. When an instance starts, it must initialize in the Unpromoted state.

Note

The Promoted and Unpromoted role names are the functional equivalent of the Master and Slave Pacemaker roles in previous RHEL releases.

Create a promotable clone resource

Configure a promotable clone resource to manage services that run in different modes, such as active and passive. You can create a new promotable resource or convert an existing resource or group to support promoted and unpromoted roles.

Procedure

  • Create a resource as a promotable clone:
    # pcs resource create resource_id [standard:[provider:]]type [resource options] promotable [clone_id] [clone options]

    By default, the name of the promotable clone is resource_id-clone. You can set a custom name for the clone by specifying a value for the clone_id option.

  • Alternately, you can create a promotable resource from a previously-created resource or resource group with the following command:
    # pcs resource promotable resource_id [clone_id] [clone options]

    By default, the name of the promotable clone is resource_id-clone or group_name-clone. You can set a custom name for the clone by specifying a value for the clone_id option.

    The following table describes the extra clone options you can specify for a promotable resource.

    Table 1. Extra Clone Options Available for Promotable Clones
    Field Description

    promoted-max

    How many copies of the resource can be promoted; default 1.

    promoted-node-max

    How many copies of the resource can be promoted on a single node; default 1.

Promotable resource constraints

You can determine the behavior of a promotable resource in a cluster by configuring constraints for that resource. For general information about resource constraints, see Configuring cluster resources.

Promotable resource location constraints

In most cases, a promotable resource will have a single copy on each active cluster node. If this is not the case, you can indicate which nodes the cluster should preferentially assign copies to with resource location constraints. These constraints are written no differently than those for regular resources. For information about location constraints, see Determining which node a resource can run on.

Promotable resource colocation constraints

You can create a colocation constraint which specifies whether the resources are operating in a promoted or unpromoted role. The following command creates a resource colocation constraint:

# pcs constraint colocation add [promoted|unpromoted] source_resource with [promoted|unpromoted] target_resource [score] [options]

For information about colocation constraints, see Colocating cluster resources.

Promotable resource ordering constraints

When configuring an ordering constraint that includes promotable resources, one of the actions that you can specify for the resources is promote, indicating that the resource be promoted from unpromoted role to promoted role. Additionally, you can specify an action of demote, indicated that the resource be demoted from promoted role to unpromoted role.

The command for configuring an order constraint is as follows:

# pcs constraint order [action] resource_id then [action] resource_id [options]

Demote a promoted resource on failure

Configure a promotable resource so that when a promote or monitor action fails, or the partition loses quorum, the resource is demoted rather than fully stopped. This prevents manual intervention in scenarios where fully stopping the resource requires manual action.

Procedure

  • To configure a promotable resource to be demoted when a promote action fails, set the on-fail operation meta option to demote, as in the following example:
    # pcs resource op add my-rsc promote on-fail="demote"
  • To configure a promotable resource to be demoted when a monitor action fails, set interval to a nonzero value, set the on-fail operation meta option to demote, and set role to Promoted, as in the following example.
    # pcs resource op add my-rsc monitor interval="10s" on-fail="demote" role="Promoted"
  • To configure a cluster so that when a cluster partition loses quorum any promoted resources will be demoted but left running and all other resources will be stopped, set the no-quorum-policy cluster property to demote

    Setting the on-fail meta-attribute to demote for an operation does not affect how promotion of a resource is determined. If the affected node still has the highest promotion score, it will be selected to be promoted again.