Product SiteDocumentation Site

Chapter 6. Resource Constraints

Table of Contents

6.1. Scores
6.1.1. Infinity Math
6.2. Deciding Which Nodes a Resource Can Run On
6.2.1. Location Properties
6.2.2. Asymmetrical "Opt-In" Clusters
6.2.3. Symmetrical "Opt-Out" Clusters
6.2.4. What if Two Nodes Have the Same Score
6.3. Specifying the Order in which Resources Should Start/Stop
6.3.1. Ordering Properties
6.3.2. Optional and mandatory ordering
6.4. Placing Resources Relative to other Resources
6.4.1. Colocation Properties
6.4.2. Mandatory Placement
6.4.3. Advisory Placement
6.4.4. Colocation by Node Attribute
6.5. Resource Sets
6.6. Ordering Sets of Resources
6.6.1. Ordered Set
6.6.2. Ordering Multiple Sets
6.6.3. Resource Set OR Logic
6.7. Colocating Sets of Resources

6.1. Scores

Scores of all kinds are integral to how the cluster works. Practically everything from moving a resource to deciding which resource to stop in a degraded cluster is achieved by manipulating scores in some way.
Scores are calculated per resource and node. Any node with a negative score for a resource can’t run that resource. The cluster places a resource on the node with the highest score for it.

6.1.1. Infinity Math

Pacemaker implements INFINITY (or equivalently, +INFINITY) internally as a score of 1,000,000. Addition and subtraction with it follow these three basic rules:
  • Any value + INFINITY = INFINITY
  • Any value - INFINITY = -INFINITY


What if you want to use a score higher than 1,000,000? Typically this possibility arises when someone wants to base the score on some external metric that might go above 1,000,000.
The short answer is you can’t.
The long answer is it is sometimes possible work around this limitation creatively. You may be able to set the score to some computed value based on the external metric rather than use the metric directly. For nodes, you can store the metric as a node attribute, and query the attribute when computing the score (possibly as part of a custom resource agent).