[ClusterLabs] Node attributes

Ken Gaillot kgaillot at redhat.com
Thu May 19 15:04:08 UTC 2016


On 05/18/2016 10:49 PM, ‪H Yavari‬ ‪ wrote:
> Hi,
> 
> How can I define a constraint for two resource based on one nodes
> attribute?
> 
> For example resource X and Y are co-located based on node attribute Z.
> 
> 
> 
> Regards,
> H.Yavari

Hi,

See
http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Explained/index.html#idm140617356537136

High-level tools such as pcs and crm provide a simpler interface, but
the concepts will be the same.

This works for location constraints, not colocation, but you can easily
accomplish what you want. If your goal is that X and Y each can only run
on a node with attribute Z, then set up a location constraint for each
one using the appropriate rule. If you goal is that X and Y must be
colocated together, on a node with attribute Z, then set up a regular
colocation constraint between them, and a location constraint for one of
them with the appropriate rule; or, put them in a group, and set up a
location constraint for the group with the appropriate rule.




More information about the Users mailing list