Cloned resources allow the same Pacemaker-managed service to run on more than one node at the same time, which fits stateless daemons, monitors, and cluster-wide helpers. Keeping identical instances active across the cluster can reduce failover latency because there is nothing to move when a node disappears.

In Pacemaker, a clone is a wrapper around an existing resource definition in the cluster information base (CIB). The wrapper controls how many instances may run (for example clone-max and clone-node-max) while the underlying resource agent remains unchanged, and placement still follows constraints and node eligibility. When no clone limits exist, instances are typically started on every eligible node and reported as a Clone Set in pcs status output.

Only resources designed for concurrent operation should be cloned. Cloning a single-writer or stateful service (databases, filesystems, exclusive IP addresses) can cause split-brain behavior and data corruption, and it is an efficient way to multiply outages. Use a promotable resource when exactly one active instance is required, or add constraints so only one instance can run.

Steps to create a cloned resource in Pacemaker:

  1. Confirm the resource to clone exists.
    $ sudo pcs status resources
      * Resource Group: web-stack:
        * cluster_ip (ocf:heartbeat:IPaddr2): Started node-02
        * web-service (systemd:nginx): Started node-02
      * dummy-check (ocf:pacemaker:Dummy): Started node-01

    Use the ocf:pacemaker:Dummy agent for a safe cloneable example.

  2. Create the clone resource with a maximum of two instances.
    $ sudo pcs resource clone dummy-check meta clone-max=2 --wait=120
    Resource 'dummy-check-clone' is running on nodes node-01, node-03.

    Clone only resources that are safe to run on multiple nodes.

    clone-max limits the number of clone instances. Default clone ID is dummy-check-clone.

  3. Verify the clone is running on the expected nodes.
    $ sudo pcs status resources
      * Resource Group: web-stack:
        * cluster_ip (ocf:heartbeat:IPaddr2): Started node-02
        * web-service (systemd:nginx): Started node-02
      * Clone Set: dummy-check-clone [dummy-check]:
        * Started: [ node-01 node-03 ]