Updated Cluster->parse_cib() to support new in_ccm and crmd values

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 11 months ago
parent 56a9916909
commit 13a6c44aa4
  1. 36
      Anvil/Tools/Cluster.pm

@ -3585,26 +3585,46 @@ sub parse_cib
# The "coming up" order is 'in_ccm' then 'crmd' then 'join'. # The "coming up" order is 'in_ccm' then 'crmd' then 'join'.
my $node_id = $anvil->data->{cib}{parsed}{data}{node}{$node_name}{id}; my $node_id = $anvil->data->{cib}{parsed}{data}{node}{$node_name}{id};
my $maintenance_mode = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'maintenance-mode'} eq "on" ? 1 : 0; # 'on' or 'off' - Node is not monitoring resources my $maintenance_mode = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'maintenance-mode'} eq "on" ? 1 : 0; # 'on' or 'off' - Node is not monitoring resources
my $in_ccm = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true" ? 1 : 0; # 'true' or 'false' - Corosync member
my $crmd = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online" ? 1 : 0; # 'online' or 'offline' - In corosync process group
my $join = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member" ? 1 : 0; # 'member' or 'down' - Completed controller join process
my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0; # Our summary of if the node is "up"
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:node_name' => $node_name, 's1:node_name' => $node_name,
's2:node_id' => $node_id, 's2:node_id' => $node_id,
's3:maintenance_mode' => $maintenance_mode, 's3:maintenance_mode' => $maintenance_mode,
's4:in_ccm' => $in_ccm,
's5:crmd' => $crmd,
's6:join' => $join,
's7:ready' => $ready,
}}); }});
### These have changed. In older clusters, these are 'true/false' or 'online/offline', but now show as a timestamp.
# in_ccm - Corosync member
my $in_ccm = 0;
if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} =~ /^\d+$/))
{
$in_ccm = 1;
}
# crmd - In corosync process group
my $crmd = 0;
if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} =~ /^\d+$/))
{
$crmd = 1;
}
# join - Completed controller join process
my $join = 0;
if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} =~ /^\d+$/))
{
$join = 1;
}
# If the global maintenance mode is set, set maintenance mode to true. # If the global maintenance mode is set, set maintenance mode to true.
if (($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'}) && ($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'} eq "true")) if (($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'}) && ($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'} eq "true"))
{ {
$maintenance_mode = 1; $maintenance_mode = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { maintenance_mode => $maintenance_mode }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { maintenance_mode => $maintenance_mode }});
} }
# Our summary of if the node is "up"
my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:in_ccm' => $in_ccm,
's2:crmd' => $crmd,
's3:join' => $join,
's4:ready' => $ready,
}});
$anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{pacemaker_id} = $node_id; $anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{pacemaker_id} = $node_id;
$anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{'maintenance-mode'} = $maintenance_mode; $anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{'maintenance-mode'} = $maintenance_mode;

Loading…
Cancel
Save