Creating a Pacemaker resource places a service, IP address, or filesystem under cluster control so it can be started on a healthy node and recovered automatically during failures.

Resource definitions are stored in the cluster information base (CIB) and executed by a resource agent, such as a systemd unit or an OCF agent. The pcs command writes the resource parameters and operation rules, including monitor intervals that determine how often Pacemaker checks health.

Resource changes take effect immediately unless maintenance-mode is enabled. Incorrect parameters, missing packages, or inconsistent service configuration across nodes can trigger repeated restarts and unexpected failovers, so plan changes for a maintenance window on production clusters.

Steps to create a Pacemaker resource:

  1. Confirm the cluster is online and has quorum before adding a resource.
    $ sudo pcs status
    Cluster name: clustername
    Cluster Summary:
      * Stack: corosync (Pacemaker is running)
      * Current DC: node-03 (version 2.1.6-6fdc9deea29) - partition with quorum
      * Last updated: Wed Dec 31 09:02:24 2025 on node-01
      * Last change:  Wed Dec 31 09:02:09 2025 by root via cibadmin on node-01
      * 3 nodes configured
      * 1 resource instance configured
    
    Node List:
      * Online: [ node-01 node-02 node-03 ]
    
    Full List of Resources:
      * cluster_ip (ocf:heartbeat:IPaddr2): Started node-01
    
    Daemon Status:
      corosync: active/enabled
      pacemaker: active/enabled
      pcsd: active/enabled

    A cluster with maintenance-mode enabled accepts resource changes but does not start resources until the property is cleared.

  2. Identify a service unit to manage as a resource.
    $ systemctl list-unit-files --type=service | grep -E '^(nginx|httpd|apache2)\.service'
    apache2.service                              enabled         enabled
    nginx.service                                enabled         enabled

    Install the same service package and configuration on every cluster node before handing control to Pacemaker.

  3. Disable the service unit outside cluster control on every cluster node.
    $ sudo systemctl disable --now nginx
    Synchronizing state of nginx.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
    Executing: /usr/lib/systemd/systemd-sysv-install disable nginx
    Removed "/etc/systemd/system/multi-user.target.wants/nginx.service".

    Leaving the unit enabled can start the service on multiple nodes during boot or manual restarts, causing port conflicts or data corruption.

  4. Create the resource with a monitor interval.
    $ sudo pcs resource create web-service systemd:nginx op monitor interval=30s

    Use systemd:httpd on RHEL or systemd:apache2 on Debian-based systems. Add explicit operation timeouts (for example op start timeout=60s) for slow-starting services.

  5. Review the created resource definition in the cluster configuration.
    $ sudo pcs resource config web-service
    Resource: web-service (class=systemd type=nginx)
      Operations:
        op monitor interval=30s
    ##### snipped #####
  6. Confirm the resource is started.
    $ sudo pcs status resources
      * cluster_ip (ocf:heartbeat:IPaddr2): Started node-01
      * web-service (systemd:nginx): Started node-02

    Run sudo pcs resource cleanup web-service after correcting parameters to clear failure counts and allow new start attempts.