Utilization attributes and placement strategy
To configure node capacity or resource requirements, use utilization attributes. Assign a utilization variable and value to a resource to specify its requirements, and assign the same variable and value to a node to specify what it provides.
About this task
You can name utilization attributes according to your preferences and define as many name and value pairs as your configuration needs. The values of utilization attributes must be integers.
Configuring node and resource capacity
The following example procedure configures utilization attributes for two nodes and then specifies the same utilization attributes that three different resources require. A node is considered eligible for a resource if it has sufficient free capacity to satisfy the resource’s requirements, as defined by the utilization attributes.
Displaying node utilization as pcs commands
You can export node utilization as a series of pcs commands by using the --output-format=cmd option. This is useful for scripting, automation, or replicating the same configuration on a different system.
You can display the configured node utilization in one of three formats:
text: Displays the output in plain text. This is the default format.json: Displays the output in a machine-readable JSON format, which is useful for scripting and automation.cmd: Displays the output as a series ofpcscommands, which you can use to recreate the same node utilization on a different system.
- To display the configured node utilization as a series of
pcscommands:# pcs node utilization --output-format=cmdExample output
pcs node utilization node1 cpu=2 pcs node utilization node2 cpu=4
Configuring placement strategy
After you have configured the capacities your nodes provide and the capacities your resources require, you need to set the placement-strategy cluster property, otherwise the capacity configurations have no effect.
Four values are available for the placement-strategy cluster property:
default- Utilization values are not taken into account at all. Resources are allocated according to allocation scores. If scores are equal, resources are evenly distributed across nodes.utilization- Utilization values are taken into account only when deciding whether a node is considered eligible (that is, whether it has sufficient free capacity to satisfy the resource’s requirements). Load-balancing is still done based on the number of resources allocated to a node.balanced- Utilization values are taken into account when deciding whether a node is eligible to serve a resource and when load-balancing, so an attempt is made to spread the resources in a way that optimizes resource performance.minimal- Utilization values are taken into account only when deciding whether a node is eligible to serve a resource. For load-balancing, an attempt is made to concentrate the resources on as few nodes as possible, thereby enabling possible power savings on the remaining nodes.
The following example command sets the value of placement-strategy to balanced. After running this command, Pacemaker will ensure the load from your resources will be distributed evenly throughout the cluster, without the need for complicated sets of colocation constraints.
# pcs property set placement-strategy=balanced