[Pacemaker] Ordering clones and primitives

Dejan Muhamedagic dejanmm at fastmail.fm
Tue Nov 2 14:51:09 UTC 2010


Hi,

On Tue, Nov 02, 2010 at 09:57:12AM -0400, Lars Kellogg-Stedman wrote:
> > You should set the interleave=true meta attribute for the clones.
> > Hope that that would help. You need collocations as well.
> 
> Dejan,
> 
> Thanks for the suggestion.  Can you elaborate a little?  The documentation
> for the interleave option says:
> 
>   Changes the behavior of ordering constraints (between clones/masters) so
>   that instances can start/stop as soon as their peer instance has (rather
>   than waiting for every instance of the other clone has). Allowed values:
>   true, false
> 
> I'm not sure exactly what this means.  In particular, I'm not sure what a
> "master" is in this case; the documentation only refers to masters in the
> context of multi-state resources.

Right. So, interleave is an attribute meaningful in the context
of clones or multi-state resources. I guess that sometimes
you'll run into the "master" term for the multi-state resources.

>  Maybe we could work out an explicit
> example?  Let's start with a sample configuration like this:
> 
>   primitive def_route ocf:pacemaker:Stateful
>   primitive ip_0 ocf:pacemaker:Stateful
>   primitive ip_1 ocf:pacemaker:Stateful
>   primitive net_route ocf:pacemaker:Stateful
>   clone clone_def_route def_route \
>           meta interleave="true"
>   clone clone_net_route net_route \
>           meta interleave="true"
> 
> My goal is that:
> 
> - net_route must start before def_route, and there must be either ip_0 or
>   ip_1 active on a node before either net_route or def_route can start.

This is currently not possible to express with Pacemaker.

> - Both ip_0 and ip_1 can run on the same node.
> - Only a single instance of net_route and def_route can run on any given
>   node.
> 
> Without any constraints and everything started, "crm status" looks like
> this:
> 
>   Online: [ node1 node0 ]
> 
>    ip_0   (ocf::pacemaker:Stateful):      Started node1
>    ip_1   (ocf::pacemaker:Stateful):      Started node0
>    Clone Set: clone_def_route [def_route]
>        Started: [ node1 node0 ]
>    Clone Set: clone_net_route [net_route]
>        Started: [ node1 node0 ]
> 
> If I add what I think is the correct collocation constraint (with the
> caveat that I don't really understand the semantics of collocating clones
> and primitives):
> 
>   colocation ip_0_with_routes \
>     inf: ip_0 clone_net_route clone_def_route
>   colocation ip_1_with_routes \
>     inf: ip_1 clone_net_route clone_def_route
> 
> I end up with this:
> 
>   Online: [ node1 node0 ]
> 
>    ip_0   (ocf::pacemaker:Stateful):      Started node1
>    ip_1   (ocf::pacemaker:Stateful):      Started node0
> 
> All of the clones are missing!

Yes. My advice was misplaced, because with the two collocations
above you express contradiction.

>  They still show up in the resource list:
> 
>   # crm resource list
>    ip_0   (ocf::pacemaker:Stateful) Started
>    ip_1   (ocf::pacemaker:Stateful) Started
>    Clone Set: clone_def_route [def_route]
>        Stopped: [ def_route:0 def_route:1 ]
>    Clone Set: clone_net_route [net_route]
>        Stopped: [ net_route:0 net_route:1 ]
> 
> But trying to start them is  no-op.
> 
> Thanks for your help!  If we get this working maybe we can turn it into an
> example configuration on the wiki.

Right now, I don't have a solution for this problem using
clones if you're running pacemaker v1.0.x. If you're with
v1.1.x, then you can specify clone instances in collocations
(i.e. clone_net_route:n where n is 0 or 1) and
validate-with="pacemaker-1.1" attribute in the cib tag. You'll
have to do the latter with cibadmin, the shell doesn't support
that.

Or just create two sets of Route resources, one for the one ip
one for the other. Not very elegant, but bearable with just two
resources.

Thanks,

Dejan

> _______________________________________________
> 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://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker



More information about the Pacemaker mailing list