[ClusterLabs] Determine a resource's current host in the CIB

Digimer lists at alteeve.ca
Thu Sep 24 02:02:36 EDT 2020


Hi all,

  I'm trying to parse the CIB to determine which node a given resource
(VM) is currently running on. I notice that the 'monitor' shows in both
node's status element (from when it last ran when the node previously
hosted the resource).

https://pastebin.com/6RCMWdgq

Specifically, I see under node 1 (the active host when the CIB was read):

<lrm_rsc_op id="srv07-el6_monitor_60000"
operation_key="srv07-el6_monitor_60000" operation="monitor"
crm-debug-origin="do_update_resource" crm_feature_set="3.3.0"
transition-key="23:85:0:829209fd-35f2-4626-a9cd-f8a50a62871e"
transition-magic="0:0;23:85:0:829209fd-35f2-4626-a9cd-f8a50a62871e"
exit-reason="" on_node="mk-a02n01" call-id="76" rc-code="0"
op-status="0" interval="60000" last-rc-change="1600925201"
exec-time="541" queue-time="0"
op-digest="65d0f0c9227f2593835f5de6c9cb9d0e"/>

And under node 2 (hosted the server in the past):

<lrm_rsc_op id="srv07-el6_monitor_60000"
operation_key="srv07-el6_monitor_60000" operation="monitor"
crm-debug-origin="do_update_resource" crm_feature_set="3.3.0"
transition-key="23:83:0:829209fd-35f2-4626-a9cd-f8a50a62871e"
transition-magic="0:0;23:83:0:829209fd-35f2-4626-a9cd-f8a50a62871e"
exit-reason="" on_node="mk-a02n02" call-id="61" rc-code="0"
op-status="0" interval="60000" last-rc-change="1600925173"
exec-time="539" queue-time="0"
op-digest="65d0f0c9227f2593835f5de6c9cb9d0e"/>

I don't see any specific entry in the CIB saying "resource X is
currently hosted on node Y", so I assume I should infer which node is
the current host? If so, should I look at which node's 'exec-time' is
higher, or which node has the higher 'call-id'?

Or am I missing a more obvious way to tell what resource is running on
which node?

-- 
Digimer
Papers and Projects: https://alteeve.com/w/
"I am, somehow, less interested in the weight and convolutions of
Einstein’s brain than in the near certainty that people of equal talent
have lived and died in cotton fields and sweatshops." - Stephen Jay Gould


More information about the Users mailing list