Author: fapeeler
Date: Wed Dec 17 08:22:06 2008
New Revision: 727427
URL: http://svn.apache.org/viewvc?rev=727427&view=rev
Log:
vmware.pm: missing forimaging check in node_status, which caused image
creation request to access vms that are in non-persistent mode. which of
course in this mode looses any changes a user makes.
load routine, typo in regex for detecting spaces in paths for vms
added additional state checks for vms off and stuck in block which
handles space issues on remote vmware server using localdisk
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm?rev=727427&r1=727426&r2=727427&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm
Wed Dec 17 08:22:06 2008
@@ -383,14 +383,19 @@
foreach my $v
(keys %vmlist) {
#handle
any spaces in the path
-
$vmlist{$v}{path} =~ s/(\s+)/\\\\ /g;
+
$vmlist{$v}{path} =~ s/(\s+)/\\ /g;
my
@sshcmd_2 = run_ssh_command($hostnode, $identity, "vmware-cmd -q
$vmlist{$v}{path} getstate", "root");
foreach
$a (@{$sshcmd_2[1]}) {
next if ($a =~ /^Warning: /);
chomp($a);
-
if ($a =~ /^on/i) {
+
if ($a =~ /^(on|off|stuck)/i) {
$vmlist{$v}{"state"} = $a;
}
+
else{
+
notify($ERRORS{'WARNING'}, 0, "unknown state $a for $vmlist{$v}{path}
on $hostnode");
+
$vmlist{$v}{"state"} = $a;
+
}
+
}
} ## end
foreach my $v (keys %vmlist)
notify($ERRORS{'OK'}, 0, "ls datastorepath $datastorepath ");
@@ -411,6 +416,10 @@
notify($ERRORS{'DEBUG'}, 0, "unregistered
$vmlist{$v}{path}");
}
}
+
elsif ($vmlist{$v}{state} eq "stuck") {
+
$save = 1;
+
notify($ERRORS{'DEBUG'}, 0, "vm on $hostnode in stuck state
saving $vmlist{$v}{path}");
+
}
else {
notify($ERRORS{'DEBUG'}, 0, "$vmlist{$v}{path} is in strange
state $vmlist{$v}{state}");
}
@@ -2046,6 +2055,7 @@
my $vmhost_hostname = $self->data->get_vmhost_hostname;
my $vmhost_imagename = $self->data->get_vmhost_image_name;
my $vmclient_shortname = $self->data->get_computer_short_name;
+ my $request_forimaging =
$self->data->get_request_forimaging();
my ($hostnode, $identity);
@@ -2139,6 +2149,11 @@
$status{status} = 'RELOAD';
}
+ if($request_forimaging){
+ $status{status} = 'RELOAD';
+ notify($ERRORS{'OK'}, 0, "forimaging flag enabled RELOAD
machine");
+ }
+
notify($ERRORS{'OK'}, 0, "returning node status hash reference
(\$node_status->{status}=$status{status})");
return \%status;