On Mon, Jun 26, 2006 at 09:25:22PM +0800, James Pan wrote: > > I configured two resource groups namely "nfs" and "fs", > group "fs" contains one primitive resource: resource_fs which is a > filesystem, > the filesystem's device is set to an invalid device so that this > resource will always fail to start. > > grou "nfs" contains one primitive resource resource_nfs which is a nfs > server. > > this is the result of crm_resource -L: > ----------------------------------------------------------------- > hadev1:~ # crm_resource -L > Resource Group: nfs > resource_nfs (lsb:nfsserver) > Resource Group: fs > resource_fs (heartbeat::ocf:Filesystem) > ------------------------------------------------------------------ > > As the result, resource_nfs will be running and resource_fs will be stopped. > Now I want these two resources to be colocated, so i add a colocation > constraint for them. > > if I add the following colocation constraint: > <rsc_colocation id="colocation_nfs_fs" from="nfs" to="fs" score="INFINITY"/> > nothing will change, resource_nfs will be still running and resources_fs > will be still stopped.
This has nothing to do with your question, but it is related. The colocation constraint with INFINITY can bite. If you have three resources, R, A, and B, and both A and B should run together with R (R<--INF-->AB), but A and B don't depend on each other, then stopping either A or B stops R too. So, it sort of does more than needed. According to Andrew Beekhof this won't change before he can do some big changes and that certainly won't be in 2.0.6. The way I solved this kind of setup is by specifying same scores for all interdependent resources on a per node basis and with always different scores for different nodes. That way you can ensure to have all resources running on one node. After adding order constraints you should be OK. Cheers, Dejan > > but if the constraint is: > <rsc_colocation id="colocation_nfs_fs" from="resource_nfs" > to="resource_fs" score="INFINITY"/> > this time resource_nfs will be stopped. > > The only difference between the two constraints is the resource ids. one > uses the group ids and the other uses > the primitive resource ids. But the running result is different. > > Is it a bug? It is easy to reproduce. > > > JMP > _______________________________________________________ > Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev > Home Page: http://linux-ha.org/ _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/