[Pacemaker] Starting a cloned resource only on nodes running another resource

Ashley Winters Ashley.Winters at freedomvoice.com
Tue Nov 17 18:11:34 EST 2009


I want to start a single instance of resource A on any node which is running one or more instances of resource B. And, I don't want to stop resource A until there are no more instances of resource B on that node. I'm using pacemaker 1.0.5 & openais 0.80.5.

In my case, resource A is a Route, and resource B is an IPaddr. I have several different IPaddr resources which can run on my cluster, and I want them to be able to share nodes. Whenever I first start one of my IPaddr resources on a node, I need to fix the node's routing table. I can't setup the route statically ahead of time since it would be an illegal route without the IPaddr being up.

I initially tried simply "group my-group my-ip my-route", by creating a new Route resource for every IPaddr. However, when you have multiple groups like that running on the same node, and you migrate one of them away, the Route resource in the migrating group deletes the route! And the remaining services on that node are robbed of their (identical) route.

Then I tried "clone c-my-route my-route" to propagate the routes to all the nodes, but that fails on any node without an IPaddr running on it, and doesn't even automagically fix itself when something migrates an IPaddr to it.

I understand it's possible to setup rules to limit where a resource runs, but I haven't managed to apply one to a cloned resource. Should I be trying to use a ping resource or cibadmin or something to set an attribute which governs the running of a cloned Route resource? Or is there another way which I'm missing?

Any advice is welcome.

Thanks,

- Ashley Winters




More information about the Pacemaker mailing list