[Pacemaker] cloning primatives with differing params

Tim Serong tserong at suse.com
Wed Oct 26 01:45:01 EDT 2011


On 26/10/11 05:45, Brian J. Murrell wrote:
> I want to create a stonith primitive and clone it for each node in my
> cluster.  I'm using the fence-agents virsh agent as my stonith
> primitive.  Currently for a single node it looks like:
>
> primitive st-pm-node1 stonith:fence_virsh \
> 	params ipaddr="192.168.122.1" login="xxx" passwd="xxx" port="node1" action="reboot" pcmk_host_list="node1" pcmk_host_check="static-list" pcmk_host_map="" secure="true"
>
> But of course that only works for one node and I want to create a
> clonable primitive that will apply to all nodes as they are added
> to the cluster.  What is stumping me though is the required "port"
> parameter which is the node to stonith.  I've not seen an example
> of how a clone resource can be created that can substitute values
> in for each clone.  Is that even possible?

OCF resource agents can be aware they're running as clones, and do 
interesting things as a result, e.g.: IPaddr2, when cloned, with the 
unique_clone_address parameter set will add the clone ID to the IP 
address, to give you a whole bunch of IP addresses.

Unfortunately I don't know offhand if the same trick can work with 
STONITH agents (they'd have to be told by pacemaker they were cloned, 
and then each would have to be instrumented to support it).

>
> On a pretty un-related question... given an asymmetric cluster, is there
> a way to specify that a resource can run on any node without having
> to add a location constraint for each node as they are added?

You could try one constraint per resource, covering all nodes, something 
like:

   location some-res-on-all-nodes some-resource \
     rule 0: #uname eq node1 or #uname eq node2 or #uname eq node3 ...

Regards,

Tim
-- 
Tim Serong
Senior Clustering Engineer
SUSE
tserong at suse.com




More information about the Pacemaker mailing list