Product SiteDocumentation Site

14.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 the resource’s id, class, type and provider are stored.

Exemplu 14.3. O înregistrare a resursei apcstonith

<lrm_resource id="apcstonith" type="apcmastersnmp" class="stonith"/>

Suplimentar, stocăm ultimul job pentru fiecare combinaţie de resource, action şi interval. Concatenarea valorilor din această tuplă este folosită pentru a crea id-ul obiectului lrm_rsc_op.

Tabel 14.3. Contents of an lrm_rsc_op job

Câmp Descriere
id
Identifier for the job constructed from the resource’s 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
Acţiunea cu care a fost invocat agentul de resursă.
interval
Frecvenţa, în milisecunde, la care va fi repetată operaţiunea. 0 indică un job unicat.
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 Secțiune B.4, „OCF Return Codes” for details on what the values here mean and how they are interpreted.
last-run
Indicator de diagnostic. Ora/data locală a maşinii, în secunde de la epoch, la care job-ul a fost executat.
last-rc-change
Indicator de diagnostic. Ora/data locală a maşinii, în secunde de la epocă, la care job-ul a returnat prima oară valoarea rc-code.
exec-time
Indicator de diagnostic. Timpul, în milisecunde, pentru care a rulat job-ul
queue-time
Indicator de diagnostic. Timpul, în secunde, pentru care a fost pus job-ul în coada de aşteptare în LRMd
crm_feature_set
Versiunea la care se conformează această descriere a job-ului. Folosită când se procesează 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
Un hash MD5 reprezentând parametrii trimişi job-ului. Folosit pentru a detecta schimbările în configuraţie şi a reporni resursele dacă este necesar.
crm-debug-origin
Indicator de diagnostic. Originea valorilor curente.

14.3.1. Exemplu Simplu

Exemplu 14.4. O operaţiune de monitorizare (determina starea curentă a resursei apcstonith)

<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>

In the above example, the job is a non-recurring monitor operation 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 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 looking at the rc-code property, we see that this was the case.
Cum acela este singurul job înregistrat pentru acest nod putem concluziona că clusterul a pornit resursa în altă parte.