Commit 4a8721c7 authored by Anton Beloglazov's avatar Anton Beloglazov

Reverted revision 41 - it caused another problem. At this moment there is a…

Reverted revision 41 - it caused another problem. At this moment there is a small bug: sometimes not all cloudlets return to the broker after the execution.
parent 8a9bd8f0
...@@ -132,6 +132,15 @@ public class PowerDatacenter extends Datacenter { ...@@ -132,6 +132,15 @@ public class PowerDatacenter extends Datacenter {
setPower(getPower() + timeframePower); setPower(getPower() + timeframePower);
/** Remove completed VMs **/
for (PowerHost host : this.<PowerHost>getHostList()) {
for (Vm vm : host.getCompletedVms()) {
getVmAllocationPolicy().deallocateHostForVm(vm);
getVmList().remove(vm);
Log.printLine("VM #" + vm.getId() + " has been deallocated from host #" + host.getId());
}
}
Log.printLine(); Log.printLine();
if (!isDisableMigrations()) { if (!isDisableMigrations()) {
......
...@@ -218,7 +218,8 @@ public class PowerVmAllocationPolicySingleThreshold extends VmAllocationPolicySi ...@@ -218,7 +218,8 @@ public class PowerVmAllocationPolicySingleThreshold extends VmAllocationPolicySi
continue; continue;
} }
if (!host.vmCreate(vm)) { if (!host.vmCreate(vm)) {
Log.printLine("failed"); Log.printLine("Something is wrong, the VM can's be restored");
System.exit(0);
} }
getVmTable().put(vm.getUid(), host); getVmTable().put(vm.getUid(), host);
Log.printLine("Restored VM #" + vm.getId() + " on host #" + host.getId()); Log.printLine("Restored VM #" + vm.getId() + " on host #" + host.getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment