Author: arkurth
Date: Wed Jan 30 15:47:36 2013
New Revision: 1440483
URL: http://svn.apache.org/viewvc?rev=1440483&view=rev
Log:
Merged revision(s) 1440481 from
vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm:
VCL-671
Fixed logic bug in VMware.pm::reclaim_vmhost_disk_space. When space needs to be
freed up, it was retrieving other VMs on the host and checking if they were
assigned to other reservations. If assigned to another reservation, the VM
should not be deleted. The logic was backwards.
........
Modified:
vcl/branches/vcl-2.3-bugfixes/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
(contents, props changed)
Modified:
vcl/branches/vcl-2.3-bugfixes/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
URL:
http://svn.apache.org/viewvc/vcl/branches/vcl-2.3-bugfixes/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm?rev=1440483&r1=1440482&r2=1440483&view=diff
==============================================================================
---
vcl/branches/vcl-2.3-bugfixes/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
(original)
+++
vcl/branches/vcl-2.3-bugfixes/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
Wed Jan 30 15:47:36 2013
@@ -2473,7 +2473,7 @@ sub reclaim_vmhost_disk_space {
return;
}
- my $reservation_id = $self->data->get_reservation_id();
+ my $request_id = $self->data->get_request_id();
my $reservation_computer_id = $self->data->get_computer_id();
my $vmhost_profile_vmdisk = $self->data->get_vmhost_profile_vmdisk();
@@ -2628,20 +2628,20 @@ sub reclaim_vmhost_disk_space {
}
- # Check if any reservations have been assigned to the computer
+ # Check if any other requests have been assigned to the computer
my $computer_requests =
get_request_by_computerid($check_computer_id);
- # Remove the ID for the current reservation
- delete $computer_requests->{$reservation_id};
- if (!keys(%$computer_requests)) {
- notify($ERRORS{'DEBUG'}, 0, "$vmx_file_name can't be
deleted because it is assigned to another reservation: " . join(", ", sort
keys(%$computer_requests)));
- $vmx_files->{$vmx_file_path}{reservations} = [sort
keys(%$computer_requests)];
+ # Remove the ID for the current request
+ delete $computer_requests->{$request_id};
+ if (keys(%$computer_requests)) {
+ notify($ERRORS{'DEBUG'}, 0, "$vmx_file_name can't be
deleted because it is assigned to another request: " . join(", ", sort
keys(%$computer_requests)));
+ $vmx_files->{$vmx_file_path}{requests} = [sort
keys(%$computer_requests)];
$vmx_files->{$vmx_file_path}{deletable} = 0;
next;
}
else {
- notify($ERRORS{'DEBUG'}, 0, "$check_computer_name has
not been assigned to any other reservations");
- $vmx_files->{$vmx_file_path}{reservations} = [];
+ notify($ERRORS{'DEBUG'}, 0, "$check_computer_name has
not been assigned to any other requests");
+ $vmx_files->{$vmx_file_path}{requests} = [];
}
# Get the amount of space being used by the vmx directory
Propchange:
vcl/branches/vcl-2.3-bugfixes/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
------------------------------------------------------------------------------
Merged
/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm:r1440481