|
|
@ -2601,14 +2601,14 @@ sub manage_resource |
|
|
|
{ |
|
|
|
{ |
|
|
|
$anvil->DRBD->get_status({debug => $debug}); |
|
|
|
$anvil->DRBD->get_status({debug => $debug}); |
|
|
|
} |
|
|
|
} |
|
|
|
my $peer_name = $anvil->data->{drbd}{config}{$host}{peer}; |
|
|
|
my $peer_name = $anvil->data->{drbd}{config}{$host}{peer} // ""; |
|
|
|
my $connection_state = $anvil->data->{drbd}{status}{$host}{resource}{$resource}{connection}{$peer_name}{'connection-state'}; |
|
|
|
my $connection_state = $anvil->data->{drbd}{status}{$host}{resource}{$resource}{connection}{$peer_name}{'connection-state'} // ""; |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { |
|
|
|
peer_name => $peer_name, |
|
|
|
peer_name => $peer_name, |
|
|
|
resource => $resource, |
|
|
|
resource => $resource, |
|
|
|
connection_state => $connection_state, |
|
|
|
connection_state => $connection_state, |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
if (lc($connection_state) eq "standalone") |
|
|
|
if (($connection_state) && (lc($connection_state) eq "standalone")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, priority => "alert", key => "log_0746", variables => { resource => $resource }}); |
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, priority => "alert", key => "log_0746", variables => { resource => $resource }}); |
|
|
|
|
|
|
|
|
|
|
@ -2653,20 +2653,15 @@ sub manage_resource |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# This generally brings up the resource |
|
|
|
# This generally brings up the resource |
|
|
|
|
|
|
|
if ($peer_name) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
# This isn't fatal when bringing up the resource |
|
|
|
my ($return_code) = $anvil->DRBD->allow_two_primaries({ |
|
|
|
my ($return_code) = $anvil->DRBD->allow_two_primaries({ |
|
|
|
debug => 2, |
|
|
|
debug => 2, |
|
|
|
resource => $resource, |
|
|
|
resource => $resource, |
|
|
|
set_to => "no", |
|
|
|
set_to => "no", |
|
|
|
}); |
|
|
|
}); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { return_code => $return_code }}); |
|
|
|
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { return_code => $return_code }}); |
|
|
|
if ($return_code) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
# Abort the migration. |
|
|
|
|
|
|
|
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, priority => "alert", key => "error_0422", variables => { |
|
|
|
|
|
|
|
server_name => $resource, |
|
|
|
|
|
|
|
return_code => $return_code, |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
return($return_code); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Now call an adjust to make sure all other config details are loaded. It also up's the |
|
|
|
# Now call an adjust to make sure all other config details are loaded. It also up's the |
|
|
|