Product SiteDocumentation Site

4.2. Describing a Cluster Node

Beyond the basic definition of a node, the administrator can also describe the node's attributes, such as how much RAM, disk, what OS or kernel version it has, perhaps even its physical location. This information can then be used by the cluster when deciding where to place resources. For more information on the use of node attributes, see the section on Chapter 8, Rules.
Node attributes can be specified ahead of time or populated later, when the cluster is running, using crm_attribute.
Below is what the node's definition would look like if the admin ran the command:
  crm_attribute --type nodes --node-uname pcmk-1 --attr-name kernel --attr-value `uname -r` 

  <node uname="pcmk-1" type="normal" id="1186dc9a-324d-425a-966e-d757e693dc86">
   <instance_attributes id="nodes-1186dc9a-324d-425a-966e-d757e693dc86">
     <nvpair id="kernel-1186dc9a-324d-425a-966e-d757e693dc86" name="kernel" value="2.6.16.46-0.4-default"/>
   </instance_attributes>
  </node>

Figure 4.1. The result of using crm_attribute to specify which kernel pcmk-1 is running

A simpler way to determine the current value of an attribute is to use crm_attribute command again:
crm_attribute --type nodes --node-uname pcmk-1 --attr-name kernel --get-value
By specifying --type nodes the admin tells the cluster that this attribute is persistent. There are also transient attributes which are kept in the status section which are "forgotten" whenever the node rejoins the cluster. The cluster uses this area to store a record of how many times a resource has failed on that node but administrators can also read and write to this section by specifying --type status.