Product SiteDocumentation Site

12.3. Operation History

A node's resource history is held in the lrm_resources tag (a child of the lrm tag). The information stored here includes enough information for the cluster to stop the resource safely if it is removed from the configuration section. Specifically we store the resource's id, class, type and provider.
  <lrm_resource id="apcstonith" type="apcmastersnmp" class="stonith">
Figure 12.3. A record of the apcstonith resource

Additionally, we store the last job for every combination of resource, action and interval. The concatenation of the values in this tuple are used to create the id of the lrm_rsc_op object.
Table 12.3. Contents of an lrm_rsc_op job.
Field Description
id Identifier for the job constructed from the resource id, operation and interval.
call-id The job's ticket number. Used as a sort key to determine the order in which the jobs were executed.
operation The action the resource agent was invoked with.
interval The frequency, in milliseconds, at which the operation will be repeated. 0 indicates a one-off job.
op-status The job's status. Generally this will be either 0 (done) or -1 (pending). Rarely used in favor of rc-code.
rc-code The job's result. Refer to Section B.3, “How Does the Cluster Interpret the OCF Return Codes?” for details on what the values here mean and how they are interpreted.
last-run Diagnostic indicator. Machine local date/time, in seconds since epoch, at which the job was executed.
last-rc-change Diagnostic indicator. Machine local date/time, in seconds since epoch, at which the job first returned the current value of rc-code
exec-time Diagnostic indicator. Time, in seconds, that the job was running for
queue-time Diagnostic indicator. Time, in seconds, that the job was queued for in the LRMd
crm_feature_set The version which this job description conforms to. Used when processing op-digest
transition-key A concatenation of the job's graph action number, the graph number, the expected result and the UUID of the crmd instance that scheduled it. This is used to construct transition-magic (below).
transition-magic A concatenation of the job's op-status, rc-code and transition-key. Guaranteed to be unique for the life of the cluster (which ensures it is part of CIB update notifications) and contains all the information needed for the crmd to correctly analyze and process the completed job. Most importantly, the decomposed elements tell the crmd if the job entry was expected and whether it failed.
op-digest An MD5 sum representing the parameters passed to the job. Used to detect changes to the configuration and restart resources if necessary.
crm-debug-origin Diagnostic indicator. The origin of the current values.

12.3.1. Simple Example


  <lrm_resource id="apcstonith" type="apcmastersnmp" class="stonith"> 
    <lrm_rsc_op id="apcstonith_monitor_0" operation="monitor" call-id="2" rc-code="7" op-status="0" interval="0" 
		crm-debug-origin="do_update_resource" crm_feature_set="3.0.1" 
		op-digest="2e3da9274d3550dc6526fb24bfcbcba0"
		transition-key="22:2:7:2668bbeb-06d5-40f9-936d-24cb7f87006a"
		transition-magic="0:7;22:2:7:2668bbeb-06d5-40f9-936d-24cb7f87006a" 
		last-run="1239008085" last-rc-change="1239008085" exec-time="10" queue-time="0"/>
  </lrm_resource>

Figure 12.4. A monitor operation performed by the cluster to determine the current state of the apcstonith resource

In the above example, the job is a non-recurring monitor often referred to as a "probe" for the apcstonith resource. The cluster schedules probes for every configured resource on when a new node starts, in order to determine the resource's current state before it takes further any further action.
From the transition-key, we can see that this was the 22nd action of the 2nd graph produced by this instance of the crmd (2668bbeb-06d5-40f9-936d-24cb7f87006a). The third field of the transition-key contains a 7, this indicates that the job expects to find the resource inactive. By now looking at the rc-code property, we see that this was the case.
Evidently, the cluster started the resource elsewhere as that is the only job recorded for this node.