How to tell whether pacemaker resource will restart or not after updating parameter with `pcs resource update <resourceid> <parameter>`?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Pacemaker cluster

Issue

When performing pcs resource update <resource-id> <parameter=new_value> some resources require restart to apply the change and some not. How to tell if resource will restart?

Resolution

Updating of pacemaker resource parameter will cause restart if the resource agent doesn't advertise reload operation and parameter in question doesn't have unique=0 set.

In other words the resource won't restart when running pcs resource update <resource-id> <parameter=new_value> only if the parameter which is being updated does have unique=0 set AND at the same time the resource agent of resource does support reload operation. These two conditions must apply in order to just reload the new value instead restarting the resource.

Diagnostic Steps

Updating resource won't cause resource restart if the resource-agent script does support reload operation:

case $1 in
    start)
        resource_start
        ;;
    stop)
        resource_stop
        ;;
    reload)                                      #   <----------------- reload definition
        resource_reload
        ;;
    monitor)
        resource_monitor
        ;;
    *)
        resource_usage
        exit $OCF_ERR_UNIMPLEMENTED
        ;;
esac
exit $?

The support of reload operation is also reflected in resource script metadata section:

<resource-agent name="resource_name">
    <version>1.1</version>

    <longdesc>
      Example Resource Agent for XYZ
    </longdesc>

    ...

    <actions>
      <action name="start"   timeout="240" />
      <action name="reload"  timeout="240" />    #   <----------------- reload action
      <action name="stop"    timeout="100" />
      <action name="meta-data"    timeout="5" />
      <action name="validate-all" timeout="30" />
    </actions>
  </resource-agent>

And the resource parameter being updated must have unique=0:

<parameter name="resource_conf" unique="0">      #   <----------------- unique set to 0
    <longdesc>Full path to the resource.conf file.</longdesc>
    <shortdesc>Path to resource.conf</shortdesc>
    <content type="string" default="${OCF_RESKEY_resconf_default}"/>
</parameter>
SBR
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.