* Remember in the last commit how I said that DRBD->update_global_common() was done? Well that was cute, 'cause it was quite broken. Now it's working.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent d647014ad1
commit 39b4a912af
  1. 208
      Anvil/Tools/DRBD.pm
  2. 9
      share/words.xml
  3. 196
      tools/test.pl

@ -5,8 +5,9 @@ package Anvil::Tools::DRBD;
use strict;
use warnings;
use Scalar::Util qw(weaken isweak);
use Data::Dumper;
use Scalar::Util qw(weaken isweak);
use Text::Diff;
our $VERSION = "3.0.0";
my $THIS_FILE = "DRBD.pm";
@ -1022,22 +1023,28 @@ sub update_global_common
# Read in the existing config.
my $new_global_common = "";
my $old_global_common = $anvil->Storage->read_file({file => $sql_file});
my $old_global_common = $anvil->Storage->read_file({file => $anvil->data->{path}{configs}{'global-common.conf'}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { old_global_common => $old_global_common }});
foreach my $line (split/\n/, $old_global_common)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { line => $line }});
my $comment = "";
if ($line =~ /^#/)
{
$new_global_common .= $line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
if ($line =~ /(#.*)$/)
{
$comment = $1;
$line =~ s/$comment//;
$line =~ s/\Q$comment\E//;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
comment => $comment,
line => $line,
}});
}
if ($line =~ /\}/)
@ -1049,23 +1056,25 @@ sub update_global_common
if (not $usage_count_seen)
{
$update = 1;
$new_line = "\tusage-count ".$say_usage_count.";";
$update = 1;
my $new_line = "\tusage-count ".$say_usage_count.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
if (not $udev_always_use_vnr_seen)
{
$update = 1;
$new_line = "\tudev-always-use-vnr;";
$update = 1;
my $new_line = "\tudev-always-use-vnr;";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
}
elsif ($in_common)
@ -1077,13 +1086,14 @@ sub update_global_common
if (not $fence_peer_seen)
{
$update = 1;
$new_line = "\t\tfence-peer ".$say_fence_peer.";";
$update = 1;
my $new_line = "\t\tfence-peer ".$say_fence_peer.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
}
elsif ($in_startup)
@ -1100,13 +1110,14 @@ sub update_global_common
if (not $auto_promote_seen)
{
$update = 1;
$new_line = "\t\tauto-promote ".$say_auto_promote.";";
$update = 1;
my $new_line = "\t\tauto-promote ".$say_auto_promote.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
}
elsif ($in_disk)
@ -1116,23 +1127,25 @@ sub update_global_common
if (not $disk_flushes_seen)
{
$update = 1;
$new_line = "\t\tdisk-flushes ".$say_disk_flushes.";";
$update = 1;
my $new_line = "\t\tdisk-flushes ".$say_flushes.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
if (not $md_flushes_seen)
{
$update = 1;
$new_line = "\t\tmd-flushes ".$say_md_flushes.";";
$update = 1;
my $new_line = "\t\tmd-flushes ".$say_flushes.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
}
elsif ($in_net)
@ -1142,46 +1155,50 @@ sub update_global_common
if (not $allow_two_primaries_seen)
{
$update = 1;
$new_line = "\t\tallow-two-primaries".$say_allow_two_primaries.";";
$update = 1;
my $new_line = "\t\tallow-two-primaries ".$say_allow_two_primaries.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
if (not $after_sb_0pri_seen)
{
$update = 1;
$new_line = "\t\tafter-sb-0pri".$say_after_sb_0pri.";";
$update = 1;
my $new_line = "\t\tafter-sb-0pri ".$say_after_sb_0pri.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
if (not $after_sb_1pri_seen)
{
$update = 1;
$new_line = "\t\tafter-sb-1pri".$say_after_sb_1pri.";";
$update = 1;
my $new_line = "\t\tafter-sb-1pri ".$say_after_sb_1pri.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
if (not $after_sb_2pri_seen)
{
$update = 1;
$new_line = "\t\tafter-sb-2pri".$say_after_sb_2pri.";";
$update = 1;
my $new_line = "\t\tafter-sb-2pri ".$say_after_sb_2pri.";";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
}});
$new_global_common .= $new_line."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
}
else
@ -1190,18 +1207,44 @@ sub update_global_common
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_common => $in_common }});
}
}
$new_global_common .= $line.$comment."\n";
next;
}
if ($line =~ /global \{/)
if ($line =~ /global\s*\{/)
{
$in_global = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_global => $in_global }});
$new_global_common .= $line.$comment."\n";
next;
}
if ($in_common)
{
if ($line =~ /handlers\s*\{/)
{
$in_handlers = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_handlers => $in_handlers }});
}
if ($line =~ /startup\s*\{/)
{
$in_startup = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_startup => $in_startup }});
}
if ($line =~ /options\s*\{/)
{
$in_options = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_options => $in_options }});
}
if ($line =~ /disk\s*\{/)
{
$in_disk = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_disk => $in_disk }});
}
if ($line =~ /net\s*\{/)
{
$in_net = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_net => $in_net }});
}
}
if ($line =~ /common\s*\{/)
{
$in_common = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { in_common => $in_common }});
}
if ($in_global)
{
@ -1230,22 +1273,16 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
if ($line =~ /\s*udev-always-use-vnr;$/)
if ($line =~ /\s*udev-always-use-vnr;/)
{
$udev_always_use_vnr_seen = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
udev_always_use_vnr_seen => $usage_count_seen,
}});
# No change needed
$new_global_common .= $line.$comment."\n";
}
}
if ($in_handlers)
@ -1275,11 +1312,8 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
}
@ -1314,11 +1348,8 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
}
@ -1349,11 +1380,8 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
if ($line =~ /(\s*)md-flushes(\s+)(.*?)(;.*)$/)
@ -1381,11 +1409,8 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
}
@ -1416,11 +1441,8 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
if ($line =~ /(\s*)after-sb-0pri(\s+)(.*?)(;.*)$/)
@ -1448,14 +1470,11 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
if ($line =~ /(\s*)after-sb-1pr(\s+)(.*?)(;.*)$/)
if ($line =~ /(\s*)after-sb-1pri(\s+)(.*?)(;.*)$/)
{
my $left_space = $1;
my $middle_space = $2;
@ -1480,11 +1499,8 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
if ($line =~ /(\s*)after-sb-2pri(\s+)(.*?)(;.*)$/)
@ -1512,14 +1528,44 @@ sub update_global_common
}});
$new_global_common .= $new_line.$comment."\n";
}
else
{
# No change needed
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
next;
}
}
}
# Add this line (will have 'next'ed if the line was modified before getting here).
$new_global_common .= $line.$comment."\n";
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0518", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'}, line => $line }});
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_global_common' => $new_global_common,
}});
if ($update)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0517", variables => {
file => $anvil->data->{path}{configs}{'global-common.conf'},
diff => diff \$old_global_common, \$new_global_common, { STYLE => 'Unified' },,
}});
my $failed = $anvil->Storage->write_file({
debug => $debug,
overwrite => 1,
backup => 1,
file => $anvil->data->{path}{configs}{'global-common.conf'},
body => $new_global_common,
user => "root",
group => "root",
mode => "0644",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { failed => $failed }});
if ($failed)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "error_0043", variables => { file => $anvil->data->{path}{configs}{'global-common.conf'} }});
return('!!error!!');
}
}
return($update);

@ -786,7 +786,7 @@ Output of: [#!variable!command!#] was;
<key name="log_0347">The migration of the server: [#!variable!server!#] to here was successful!</key>
<key name="log_0348">It looks like we were called to verify that the: [#!variable!server!#] migrated here, but it isn't here yet. We'll proceed with an attempt to pull the server over.</key>
<key name="log_0349">We're pulling the: [#!variable!server!#] from: [#!variable!target!#].</key>
<key name="log_0350">Temporarily enabling dual primary for the resource: [#!variable!resource!#] to the node: [#!variable!target_name!# (#!variable!target_node_id!#].</key>
<key name="log_0350">Temporarily enabling dual primary for the resource: [#!variable!resource!#] to the node: [#!variable!target_name!# (#!variable!target_node_id!#)].</key>
<key name="log_0351">The attempt to enable dual-primary for the resource: [#!variable!resource!#] to the node: [#!variable!target_name!# (#!variable!target_node_id!#)] returned a non-zero return code [#!variable!return_code!#]. The returned output (if any) was: [#!variable!output!#].</key>
<key name="log_0352">The migration of: [#!variable!server!#] to the node: [#!variable!target!#] will now begin.</key>
<key name="log_0353">The attempt to migrate the server: [#!variable!server!#] to the node: [#!variable!target!#] returned a non-zero return code [#!variable!return_code!#]. The returned output (if any) was: [#!variable!output!#].</key>
@ -974,6 +974,13 @@ The IPMI BMC administrator (oem) user was not found. The output (if any) of the
<key name="log_0514">The password for the IPMI BMC appears to have been successfully updated, though we had to reduce it to 20-bytes long. Will test to confirm.</key>
<key name="log_0515">The password for the IPMI BMC appears to have been successfully updated, though we had to reduce it to 16-bytes long. Will test to confirm.</key>
<key name="log_0516">Waiting: [#!variable!reset_delay!#] seconds to give the BMC time to reset...</key>
<key name="log_0517">
The file: [#!variable!file!#] needs to be updated. The difference is:
====
#!variable!diff!#
====
</key>
<key name="log_0518">Appending the file: [#!variable!file!#] with the line: [#!variable!line!#].</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<key name="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>

@ -29,197 +29,7 @@ $anvil->Database->connect();
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, secure => 0, key => "log_0132"});
$anvil->Get->switches;
my $xml = '<cib crm_feature_set="3.3.0" validate-with="pacemaker-3.2" epoch="28" num_updates="0" admin_epoch="0" cib-last-written="Wed Jul 29 23:45:47 2020" update-origin="mk-a02n01" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="2">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-have-watchdog" name="have-watchdog" value="false"/>
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.0.3-5.el8_2.1-4b1f869f0f"/>
<nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
<nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="mk-anvil-02"/>
<nvpair id="cib-bootstrap-options-stonith-max-attempts" name="stonith-max-attempts" value="INFINITY"/>
<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="true"/>
</cluster_property_set>
</crm_config>
<nodes>
<node id="1" uname="mk-a02n01"/>
<node id="2" uname="mk-a02n02"/>
</nodes>
<resources>
<primitive class="stonith" id="ipmilan_node1" type="fence_ipmilan">
<instance_attributes id="ipmilan_node1-instance_attributes">
<nvpair id="ipmilan_node1-instance_attributes-delay" name="delay" value="15"/>
<nvpair id="ipmilan_node1-instance_attributes-ipaddr" name="ipaddr" value="10.201.13.1"/>
<nvpair id="ipmilan_node1-instance_attributes-password" name="password" value="another secret p"/>
<nvpair id="ipmilan_node1-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n01"/>
<nvpair id="ipmilan_node1-instance_attributes-username" name="username" value="admin"/>
</instance_attributes>
<operations>
<op id="ipmilan_node1-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="ipmilan_node2" type="fence_ipmilan">
<instance_attributes id="ipmilan_node2-instance_attributes">
<nvpair id="ipmilan_node2-instance_attributes-ipaddr" name="ipaddr" value="10.201.13.2"/>
<nvpair id="ipmilan_node2-instance_attributes-password" name="password" value="another secret p"/>
<nvpair id="ipmilan_node2-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n02"/>
<nvpair id="ipmilan_node2-instance_attributes-username" name="username" value="admin"/>
</instance_attributes>
<operations>
<op id="ipmilan_node2-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="apc_snmp_node1_psu1" type="fence_apc_snmp">
<instance_attributes id="apc_snmp_node1_psu1-instance_attributes">
<nvpair id="apc_snmp_node1_psu1-instance_attributes-ip" name="ip" value="10.201.2.3"/>
<nvpair id="apc_snmp_node1_psu1-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n01"/>
<nvpair id="apc_snmp_node1_psu1-instance_attributes-pcmk_off_action" name="pcmk_off_action" value="reboot"/>
<nvpair id="apc_snmp_node1_psu1-instance_attributes-port" name="port" value="3"/>
<nvpair id="apc_snmp_node1_psu1-instance_attributes-power_wait" name="power_wait" value="5"/>
</instance_attributes>
<operations>
<op id="apc_snmp_node1_psu1-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="apc_snmp_node1_psu2" type="fence_apc_snmp">
<instance_attributes id="apc_snmp_node1_psu2-instance_attributes">
<nvpair id="apc_snmp_node1_psu2-instance_attributes-ip" name="ip" value="10.201.2.4"/>
<nvpair id="apc_snmp_node1_psu2-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n01"/>
<nvpair id="apc_snmp_node1_psu2-instance_attributes-pcmk_off_action" name="pcmk_off_action" value="reboot"/>
<nvpair id="apc_snmp_node1_psu2-instance_attributes-port" name="port" value="3"/>
<nvpair id="apc_snmp_node1_psu2-instance_attributes-power_wait" name="power_wait" value="5"/>
</instance_attributes>
<operations>
<op id="apc_snmp_node1_psu2-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="apc_snmp_node2_psu1" type="fence_apc_snmp">
<instance_attributes id="apc_snmp_node2_psu1-instance_attributes">
<nvpair id="apc_snmp_node2_psu1-instance_attributes-ip" name="ip" value="10.201.2.3"/>
<nvpair id="apc_snmp_node2_psu1-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n02"/>
<nvpair id="apc_snmp_node2_psu1-instance_attributes-pcmk_off_action" name="pcmk_off_action" value="reboot"/>
<nvpair id="apc_snmp_node2_psu1-instance_attributes-port" name="port" value="4"/>
<nvpair id="apc_snmp_node2_psu1-instance_attributes-power_wait" name="power_wait" value="5"/>
</instance_attributes>
<operations>
<op id="apc_snmp_node2_psu1-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="apc_snmp_node2_psu2" type="fence_apc_snmp">
<instance_attributes id="apc_snmp_node2_psu2-instance_attributes">
<nvpair id="apc_snmp_node2_psu2-instance_attributes-ip" name="ip" value="10.201.2.4"/>
<nvpair id="apc_snmp_node2_psu2-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n02"/>
<nvpair id="apc_snmp_node2_psu2-instance_attributes-pcmk_off_action" name="pcmk_off_action" value="reboot"/>
<nvpair id="apc_snmp_node2_psu2-instance_attributes-port" name="port" value="4"/>
<nvpair id="apc_snmp_node2_psu2-instance_attributes-power_wait" name="power_wait" value="5"/>
</instance_attributes>
<operations>
<op id="apc_snmp_node2_psu2-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="delay_node1" type="fence_delay">
<instance_attributes id="delay_node1-instance_attributes">
<nvpair id="delay_node1-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n01"/>
<nvpair id="delay_node1-instance_attributes-wait" name="wait" value="60"/>
</instance_attributes>
<operations>
<op id="delay_node1-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
<primitive class="stonith" id="delay_node2" type="fence_delay">
<instance_attributes id="delay_node2-instance_attributes">
<nvpair id="delay_node2-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="mk-a02n02"/>
<nvpair id="delay_node2-instance_attributes-wait" name="wait" value="60"/>
</instance_attributes>
<operations>
<op id="delay_node2-monitor-interval-60" interval="60" name="monitor"/>
</operations>
</primitive>
</resources>
<constraints/>
<fencing-topology>
<fencing-level devices="ipmilan_node1" id="fl-mk-a02n01-1" index="1" target="mk-a02n01"/>
<fencing-level devices="ipmilan_node2" id="fl-mk-a02n02-1" index="1" target="mk-a02n02"/>
<fencing-level devices="apc_snmp_node1_psu1,apc_snmp_node1_psu2" id="fl-mk-a02n01-2" index="2" target="mk-a02n01"/>
<fencing-level devices="apc_snmp_node2_psu1,apc_snmp_node2_psu2" id="fl-mk-a02n02-2" index="2" target="mk-a02n02"/>
<fencing-level devices="delay_node1" id="fl-mk-a02n01-3" index="3" target="mk-a02n01"/>
<fencing-level devices="delay_node2" id="fl-mk-a02n02-3" index="3" target="mk-a02n02"/>
</fencing-topology>
</configuration>
<status>
<node_state id="2" uname="mk-a02n02" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
<lrm id="2">
<lrm_resources>
<lrm_resource id="ipmilan_node1" type="fence_ipmilan" class="stonith">
<lrm_rsc_op id="ipmilan_node1_last_0" operation_key="ipmilan_node1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="7:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;7:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="5" rc-code="7" op-status="0" interval="0" last-rc-change="1596077508" last-run="1596077508" exec-time="2" queue-time="0" op-digest="94ccc3ba507c38b16a5ab5adad892afe" op-secure-params=" password passwd " op-secure-digest="30aa995f9bd3385e535d0a45b5b673c7"/>
</lrm_resource>
<lrm_resource id="ipmilan_node2" type="fence_ipmilan" class="stonith">
<lrm_rsc_op id="ipmilan_node2_last_0" operation_key="ipmilan_node2_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="15:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;15:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="26" rc-code="0" op-status="0" interval="0" last-rc-change="1596077508" last-run="1596077508" exec-time="87" queue-time="0" op-digest="e759a456df902485096d4a48725ed81c" op-secure-params=" password passwd " op-secure-digest="47989163387c397e63fa3acdbec0d274"/>
<lrm_rsc_op id="ipmilan_node2_monitor_60000" operation_key="ipmilan_node2_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="16:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;16:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="29" rc-code="0" op-status="0" interval="60000" last-rc-change="1596077509" exec-time="87" queue-time="0" op-digest="467ef5117cbb737e5c6fc23b58809791" op-secure-params=" password passwd " op-secure-digest="47989163387c397e63fa3acdbec0d274"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node1_psu1" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node1_psu1_last_0" operation_key="apc_snmp_node1_psu1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="9:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;9:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="13" rc-code="7" op-status="0" interval="0" last-rc-change="1596077508" last-run="1596077508" exec-time="0" queue-time="0" op-digest="bf350e059a2283cb416a705205fcef98" op-secure-params=" password passwd " op-secure-digest="91abc2f7f37dfdd5f531054a74a66ced"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node1_psu2" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node1_psu2_last_0" operation_key="apc_snmp_node1_psu2_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="19:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;19:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="27" rc-code="0" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="809" queue-time="0" op-digest="7ff7ebe3c6b94ef30b8074ffb385cacb" op-secure-params=" password passwd " op-secure-digest="a3c98981d6a0382ece4146587d008b5c"/>
<lrm_rsc_op id="apc_snmp_node1_psu2_monitor_60000" operation_key="apc_snmp_node1_psu2_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="20:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;20:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="31" rc-code="0" op-status="0" interval="60000" last-rc-change="1596077509" exec-time="775" queue-time="0" op-digest="534f24f08deb08c3f65872f2139ebf6b" op-secure-params=" password passwd " op-secure-digest="a3c98981d6a0382ece4146587d008b5c"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node2_psu1" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node2_psu1_last_0" operation_key="apc_snmp_node2_psu1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="11:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;11:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="21" rc-code="7" op-status="0" interval="0" last-rc-change="1596077508" last-run="1596077508" exec-time="0" queue-time="0" op-digest="e4739b474ee5043eaf7233ee12ee51d3" op-secure-params=" password passwd " op-secure-digest="3f31fc0be92206a110435411ffb3caf8"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node2_psu2" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node2_psu2_last_0" operation_key="apc_snmp_node2_psu2_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="23:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;23:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="28" rc-code="0" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="782" queue-time="0" op-digest="f3b985aa75b8f5fa0df015dc0b03b1f1" op-secure-params=" password passwd " op-secure-digest="26e92809fff4cf6b4cd47ff641d8276a"/>
<lrm_rsc_op id="apc_snmp_node2_psu2_monitor_60000" operation_key="apc_snmp_node2_psu2_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="24:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;24:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="30" rc-code="0" op-status="0" interval="60000" last-rc-change="1596077509" exec-time="745" queue-time="0" op-digest="0e4b4767fac04c243d40c582eb192994" op-secure-params=" password passwd " op-secure-digest="26e92809fff4cf6b4cd47ff641d8276a"/>
</lrm_resource>
<lrm_resource id="delay_node1" type="fence_delay" class="stonith">
<lrm_rsc_op id="delay_node1_last_0" operation_key="delay_node1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="8:13:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;8:13:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="45" rc-code="7" op-status="0" interval="0" last-rc-change="1596080690" last-run="1596080690" exec-time="0" queue-time="0" op-digest="cc9e9045724a0f58a4c1e20e87fc27e0"/>
</lrm_resource>
<lrm_resource id="delay_node2" type="fence_delay" class="stonith">
<lrm_rsc_op id="delay_node2_last_0" operation_key="delay_node2_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="24:14:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;24:14:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="50" rc-code="0" op-status="0" interval="0" last-rc-change="1596080694" last-run="1596080694" exec-time="16" queue-time="0" op-digest="3c18f0bcefeff3c4b79dda97eed85b65"/>
<lrm_rsc_op id="delay_node2_monitor_60000" operation_key="delay_node2_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="25:14:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;25:14:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n02" call-id="51" rc-code="0" op-status="0" interval="60000" last-rc-change="1596080694" exec-time="16" queue-time="0" op-digest="28ef7d9656d3e7ad95f689543241ecf8"/>
</lrm_resource>
</lrm_resources>
</lrm>
</node_state>
<node_state id="1" uname="mk-a02n01" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
<lrm id="1">
<lrm_resources>
<lrm_resource id="ipmilan_node1" type="fence_ipmilan" class="stonith">
<lrm_rsc_op id="ipmilan_node1_last_0" operation_key="ipmilan_node1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="13:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;13:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="26" rc-code="0" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="93" queue-time="0" op-digest="94ccc3ba507c38b16a5ab5adad892afe" op-secure-params=" password passwd " op-secure-digest="30aa995f9bd3385e535d0a45b5b673c7"/>
<lrm_rsc_op id="ipmilan_node1_monitor_60000" operation_key="ipmilan_node1_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="14:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;14:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="29" rc-code="0" op-status="0" interval="60000" last-rc-change="1596077509" exec-time="84" queue-time="0" op-digest="8010b53c30280214d0b61d74406e67ec" op-secure-params=" password passwd " op-secure-digest="30aa995f9bd3385e535d0a45b5b673c7"/>
</lrm_resource>
<lrm_resource id="ipmilan_node2" type="fence_ipmilan" class="stonith">
<lrm_rsc_op id="ipmilan_node2_last_0" operation_key="ipmilan_node2_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="2:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;2:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="9" rc-code="7" op-status="0" interval="0" last-rc-change="1596077508" last-run="1596077508" exec-time="0" queue-time="0" op-digest="e759a456df902485096d4a48725ed81c" op-secure-params=" password passwd " op-secure-digest="47989163387c397e63fa3acdbec0d274"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node1_psu1" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node1_psu1_last_0" operation_key="apc_snmp_node1_psu1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="17:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;17:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="27" rc-code="0" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="783" queue-time="0" op-digest="bf350e059a2283cb416a705205fcef98" op-secure-params=" password passwd " op-secure-digest="91abc2f7f37dfdd5f531054a74a66ced"/>
<lrm_rsc_op id="apc_snmp_node1_psu1_monitor_60000" operation_key="apc_snmp_node1_psu1_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="18:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;18:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="30" rc-code="0" op-status="0" interval="60000" last-rc-change="1596077509" exec-time="729" queue-time="0" op-digest="baa323cdbcb6e29b8e4ab11e6ec3829a" op-secure-params=" password passwd " op-secure-digest="91abc2f7f37dfdd5f531054a74a66ced"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node1_psu2" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node1_psu2_last_0" operation_key="apc_snmp_node1_psu2_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="4:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;4:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="17" rc-code="7" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="0" queue-time="0" op-digest="7ff7ebe3c6b94ef30b8074ffb385cacb" op-secure-params=" password passwd " op-secure-digest="a3c98981d6a0382ece4146587d008b5c"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node2_psu1" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node2_psu1_last_0" operation_key="apc_snmp_node2_psu1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="21:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;21:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="28" rc-code="0" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="808" queue-time="0" op-digest="e4739b474ee5043eaf7233ee12ee51d3" op-secure-params=" password passwd " op-secure-digest="3f31fc0be92206a110435411ffb3caf8"/>
<lrm_rsc_op id="apc_snmp_node2_psu1_monitor_60000" operation_key="apc_snmp_node2_psu1_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="22:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;22:0:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="31" rc-code="0" op-status="0" interval="60000" last-rc-change="1596077509" exec-time="766" queue-time="0" op-digest="69497c1e46db98fb718209f7a6a06515" op-secure-params=" password passwd " op-secure-digest="3f31fc0be92206a110435411ffb3caf8"/>
</lrm_resource>
<lrm_resource id="apc_snmp_node2_psu2" type="fence_apc_snmp" class="stonith">
<lrm_rsc_op id="apc_snmp_node2_psu2_last_0" operation_key="apc_snmp_node2_psu2_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="6:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;6:0:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="25" rc-code="7" op-status="0" interval="0" last-rc-change="1596077509" last-run="1596077509" exec-time="0" queue-time="0" op-digest="f3b985aa75b8f5fa0df015dc0b03b1f1" op-secure-params=" password passwd " op-secure-digest="26e92809fff4cf6b4cd47ff641d8276a"/>
</lrm_resource>
<lrm_resource id="delay_node1" type="fence_delay" class="stonith">
<lrm_rsc_op id="delay_node1_last_0" operation_key="delay_node1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="21:13:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;21:13:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="54" rc-code="0" op-status="0" interval="0" last-rc-change="1596080690" last-run="1596080690" exec-time="16" queue-time="0" op-digest="cc9e9045724a0f58a4c1e20e87fc27e0"/>
<lrm_rsc_op id="delay_node1_monitor_60000" operation_key="delay_node1_monitor_60000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="22:13:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:0;22:13:0:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="55" rc-code="0" op-status="0" interval="60000" last-rc-change="1596080690" exec-time="15" queue-time="0" op-digest="76803906e86431fd72b35b182101783d"/>
</lrm_resource>
<lrm_resource id="delay_node2" type="fence_delay" class="stonith">
<lrm_rsc_op id="delay_node2_last_0" operation_key="delay_node2_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.3.0" transition-key="8:14:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" transition-magic="0:7;8:14:7:b04a8d49-a133-4cd6-9d7e-6feeb76c5dcf" exit-reason="" on_node="mk-a02n01" call-id="59" rc-code="7" op-status="0" interval="0" last-rc-change="1596080694" last-run="1596080694" exec-time="0" queue-time="0" op-digest="3c18f0bcefeff3c4b79dda97eed85b65"/>
</lrm_resource>
</lrm_resources>
</lrm>
</node_state>
</status>
</cib>
';
$anvil->Cluster->parse_cib({
debug => 3,
cib => $xml,
my $updated = $anvil->DRBD->update_global_common({
debug => 2,
});
print "DRBD global common updated? [".$updated."]\n";

Loading…
Cancel
Save