Removing an unused Pacemaker resource prevents the cluster from monitoring, restarting, or failing over a service that is no longer meant to be managed, keeping the configuration predictable and easier to maintain.

Resources are stored in the cluster configuration (the CIB) and enforced by Pacemaker based on resource definitions, operations, and constraints; the pcs command updates the live configuration and propagates changes across the cluster.

Disabling or deleting a resource can stop a production service and can indirectly impact other resources through ordering and colocation rules, so constraint references should be removed first and resource IDs should be verified carefully, especially when deleting a group, clone, or bundle where pcs removes contained resources as well.

Steps to delete a Pacemaker resource:

  1. List configured resources to confirm the exact resource ID targeted for deletion.
    $ sudo pcs status resources
      * cluster_ip (ocf:heartbeat:IPaddr2): Started node-02
      * web-service (systemd:nginx): Started node-02

    Deleting a group, clone, or bundle ID removes all resources contained inside it.

  2. List constraint IDs that reference the resource.
    $ sudo pcs constraint ref web-service
    Resource: web-service
      colocation-web-service-cluster_ip-INFINITY
      order-cluster_ip-web-service-mandatory

    Constraint IDs returned here must be removed or updated to avoid dangling references after deletion.

  3. Delete any constraint IDs that reference the resource.
    $ sudo pcs constraint delete colocation-web-service-cluster_ip-INFINITY order-cluster_ip-web-service-mandatory

    Removing constraints can change where other resources run and the order they start, which can interrupt dependent services.

  4. Disable the resource before deletion.
    $ sudo pcs resource disable web-service --safe --wait=120
    Waiting for the cluster to apply configuration changes (timeout: 120 seconds)...
    resource 'web-service' is not running on any node

    Preview the impact without changes by adding --simulate and list only affected resources by adding --brief.

    Disabling stops the service and may interrupt client access.

  5. Delete the resource from the cluster configuration.
    $ sudo pcs resource delete web-service
    Deleting Resource - web-service

    Deleting a resource removes it from cluster management and cannot be undone without re-creating it.

  6. Verify the resource is no longer listed.
    $ sudo pcs status resources
      * cluster_ip (ocf:heartbeat:IPaddr2): Started node-02
  7. Verify no constraints still reference the deleted resource ID.
    $ sudo pcs constraint ref web-service
    Resource: web-service
      No Matches

    No listed constraint IDs indicates no remaining references to web-service in the current constraint configuration.