Author: fapeeler
Date: Fri Jan 16 16:29:52 2015
New Revision: 1652448
URL: http://svn.apache.org/r1652448
Log:
VCL-179
more corrections to detect if node is turned on and accessible for libvirt
Modified:
vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm
URL:
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm?rev=1652448&r1=1652447&r2=1652448&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/libvirt.pm Fri Jan 16
16:29:52 2015
@@ -378,6 +378,12 @@ repository image file path: $repository_
EOF
);
+ # Call the OS module's pre_capture() subroutine
+ if ($self->os->can("pre_capture") && !$self->os->pre_capture({end_state
=> 'on'})) {
+ notify($ERRORS{'WARNING'}, 0, "failed to complete OS module's
pre_capture tasks");
+ return;
+ }
+
# Check the power status before proceeding
my $power_status = $self->power_status();
if (!$power_status) {
@@ -421,12 +427,6 @@ EOF
return;
}
- # Call the OS module's pre_capture() subroutine
- if ($self->os->can("pre_capture") && !$self->os->pre_capture({end_state
=> 'off'})) {
- notify($ERRORS{'WARNING'}, 0, "failed to complete OS module's
pre_capture tasks");
- return;
- }
-
# Update the image name in the database
if ($old_image_name ne $new_image_name && !update_image_name($image_id,
$imagerevision_id, $new_image_name)) {
notify($ERRORS{'WARNING'}, 0, "failed to update image name in
the database: $old_image_name --> $new_image_name");
@@ -439,10 +439,9 @@ EOF
return;
}
- # Wait for the domain to power off
- if (!$self->wait_for_power_off(600)) {
+ # Shutdown domain
+ if (!$self->os->shutdown()) {
notify($ERRORS{'WARNING'}, 0, "$domain_name has not powered off
after the OS module's pre_capture tasks were completed, powering off
forcefully");
-
if (!$self->power_off($domain_name)) {
notify($ERRORS{'WARNING'}, 0, "failed to power off
$domain_name after the OS module's pre_capture tasks were completed");
return;