[Pacemaker] location syntax for crm shell.

Florian Haas f.g.haas at gmx.net
Wed Sep 14 11:42:29 EDT 2011

On 2011-09-14 17:29, Schaefer, Diane E wrote:
> Hi,
>   We are running a two-node cluster using pacemaker 1.1.5-18.1 with
> heartbeat 3.0.4-41.1.  I am confused on the correct syntax to use when
> adding a location constraint using the crm shell.  I would like a
> resource to always run on a particular node. Here are the results of my
> experiments:
> 1)       location location-res1 res1 inf: node1
> This returns the WARNING : location-res1 : referenced node node1 does
> not exist
> Does it want the node ID and not the name?

No, but it wants the node name exactly as given by "uname -n". If on
your system "uname -n" returns the FQDN and not the unqualified
hostname, you would have to refer to this node by "node1.<domain>" and
not by just "node1".

> The resource does start on node1 and seem to stay there.  I’m not sure
> why the warning occurs.

If the constraint simply applies to no nodes in the cluster, then where
the resource is started is essentially random absent other constraints.
The fact that you resource starts on the "correct" node may be entirely

> 2)      location location-res1 rule inf: #uname eq node1
> This also returns the same warning as above with the same results, the
> resource starts. 


> 3)      location location-res1 rule inf: uname eq node1
> No warning on this one, but the resource does not start.

This would apply to a node which has explicitly had an attribute named
"uname" set with crm_attribute, which you probably haven't.

Hope this helps.


More information about the Pacemaker mailing list