[Pacemaker] colocate three resources

Andrew Beekhof andrew at beekhof.net
Sun Nov 9 22:26:50 EST 2014

> On 9 Nov 2014, at 9:28 pm, Matthias Teege <matthias-gmane at mteege.de> wrote:
> Hallo,
> On a cluster I have to place three resources on the same node.
> ms ms_disk_R p_disk_R
> ms ms_disk_S p_disk_S 
> primitive vm_srv ocf:heartbeat:VirtualDomain
> The colocation constraints looks like this:
> colocation vm_with_disk_R inf: vm_srv ms_disk_R:Master
> colocation vm_with_disk_S inf: vm_srv ms_disk_S:Master
> Do I have to add another colocation constraint to define a
> colocation between disk_R and disk_S.  I'm not sure because the
> documentation says:
> "with-rsc: The colocation target.  The cluster will decide where to
> put this resource first and then decide where to put the resource in
> the rsc field."
> In my case the colocation targets are "ms_disk_R" and "ms_disk_S".
> If pacemaker decides to put disk_R on node A and disk_S on node B
> vm_srv would not start.

Correct, this is why you need the third constraint - as smart as pacemaker is, its nowhere as good as a human brain.
So while it is obvious to us that "ms_disk_R" and "ms_disk_S" need to go on the same node, pacemaker will need the extra hint.

Suggestion, do this:

colocation disk_S_with_disk_R inf: ms_disk_S:Master ms_disk_R:Master
colocation vm_with_disk_S inf: vm_srv ms_disk_S:Master

For ordering you want as much parallelism as possible, for colocation - chains work best.

> I use order constraints to start disks before the vm resource.
> order disk_R_before_vm inf: ms_disk_R:promote vm_srv:start
> order disk_S_before_vm inf: ms_disk_S:promote vm_srv:start
> Thanks
> Matthias
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org

More information about the Pacemaker mailing list