@ -276,61 +276,64 @@ sub remove_from_pacemaker
$anvil->nice_exit({exit_code => 1});
$anvil->nice_exit({exit_code => 1});
}
}
}
}
elsif ($anvil->data->{cib}{pars ed}{data}{server}{$server_name}{status} ne "off")
else
{
{
# As we're going to delete the server, we won't wait. We'll come back here and destroy the
# As we're going to delete the server, we won't wait. We'll come back here and destroy the
# server if it's still running.
# server if it's still running.
my $problem = $anvil->Cluster->shutdown_server({
if ($anvil->data->{cib}{parsed}{data}{server}{$server_name}{status} ne "off")
debug => 2,
server => $server_name,
'wait' => 0,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { problem => $problem }});
if ($problem)
{
{
# Failed to stop.
my $problem = $anvil->Cluster->shutdown_server({
debug => 2,
server => $server_name,
'wait' => 0,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { problem => $problem }});
if ($problem)
{
# Failed to stop.
$anvil->Job->update_progress({
progress => 100,
message => "error_0223,!!server_name!".$server_name."!!",
job_status => "failed",
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, priority => 'err', key => "error_0223", variables => { server_name => $server_name }});
$anvil->nice_exit({exit_code => 1});
}
# Force the server off now.
$anvil->Job->update_progress({
$anvil->Job->update_progress({
progress => 100,
progress => 20,
message => "error_0223,!!server_name!".$server_name."!!",
message => "job_0223,!!server_name!".$server_name."!!",
job_status => "failed",
});
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, priority => 'err', key => "error_0223", variables => { server_name => $server_name }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "job_0223", variables => { server_name => $server_name }});
$anvil->nice_exit({exit_code => 1});
my $success = $anvil->Server->shutdown_virsh({
}
debug => 2,
force => 1,
# Force the server off now.
server => $server_name,
$anvil->Job->update_progress({
});
progress => 20,
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { success => $success }});
message => "job_0223,!!server_name!".$server_name."!!",
if (not $success)
});
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "job_0223", variables => { server_name => $server_name }});
# Failed to stop
my $success = $anvil->Server->shutdown_virsh({
$anvil->Job->update_progress({
debug => 2,
progress => 100,
force => 1,
message => "error_0223,!!server_name!".$server_name."!!",
server => $server_name,
job_status => "failed",
});
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { success => $success }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, priority => 'err', key => "error_0223", variables => { server_name => $server_name }});
if (not $success)
$anvil->nice_exit({exit_code => 1});
{
}
# Failed to stop
# Server is off now.
$anvil->Job->update_progress({
$anvil->Job->update_progress({
progress => 100,
progress => 25,
message => "error_0223,!!server_name!".$server_name."!!",
message => "job_0211,!!server_name!".$server_name."!!",
job_status => "failed",
});
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, priority => 'err', key => "error_0223", variables => { server_name => $server_name }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "job_0211", variables => { server_name => $server_name }});
$anvil->nice_exit({exit_code => 1});
}
}
# Server is off now.
$anvil->Job->update_progress({
progress => 25,
message => "job_0211,!!server_name!".$server_name."!!",
});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "job_0211", variables => { server_name => $server_name }});
# Delete the resource.
# Delete the resource.
$problem = $anvil->Cluster->delete_server({debug => 2, server_name => $server_name});
my $problem = $anvil->Cluster->delete_server({debug => 2, server_name => $server_name});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { problem => $problem }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { problem => $problem }});
if ($problem)
if ($problem)
{
{