[ClusterLabs] Mutually exclusive resources ?

Ken Gaillot kgaillot at redhat.com
Wed Sep 27 10:02:12 EDT 2023


On Wed, 2023-09-27 at 15:42 +0300, Andrei Borzenkov wrote:
> On Wed, Sep 27, 2023 at 3:21 PM Adam Cecile <acecile at le-vert.net>
> wrote:
> > Hello,
> > 
> > 
> > I'm struggling to understand if it's possible to create some kind
> > of constraint to avoid two different resources to be running on the
> > same host.
> > 
> > Basically, I'd like to have floating IP "1" and floating IP "2"
> > always being assigned to DIFFERENT nodes.
> > 
> > Is that something possible ?
> 
> Sure, negative colocation constraint.
> 
> > Can you give me a hint ?
> > 
> 
> Using crmsh:
> 
> colcoation IP1-no-with-IP2 -inf: IP1 IP2
> 
> > Thanks in advance, Adam.

To elaborate, use -INFINITY if you want the IPs to *never* run on the
same node, even if there are no other nodes available (meaning one of
them has to stop). If you *prefer* that they run on different nodes,
but want to allow them to run on the same node in a degraded cluster,
use a finite negative score.
-- 
Ken Gaillot <kgaillot at redhat.com>



More information about the Users mailing list