Pacemaker - resource with configured location is not transferred back to the preferred location after recovery from a failure

 Intro


As in the title - I configured a Pacemaker resource and used the location directive to configure its preferred location. The resource got allocated to the preferred node, but it was not transferred there back after a reboot. It took me a few hours to find the root cause and fix it.

Symptoms


Configure a preferred location of Pacemaker resource or resource group:

# crm configure location <location_name> <resource_name> <priority>: <node_name>

For example:

# crm configure location VIP_location VIP 50: node01

should ensure that the VIP resource is always placed on node01, unless other locations with higher priority for this resource are created.

This works fine until the failure of node01. If it happens the resource is transferred to another node in the cluster, which is expected. However, once node01 recovers from the failure, the resource should be transferred back to its preferred location. The problem is that it is not!

Solution


The solution is trivial, but not very well documented. Check the configured value of general cluster resource stickiness. It it's higher or equal to the priority of the location, the resource won't be transferred back to its preferred location after recovery from the failure. So in our example it is enough to execute:

# crm configure rsc_defaults resource-stickiness=49

That's it! A few hours I said ... Yet I managed to find a time to write this post, however :).

No comments:

Post a Comment