Log.print(String.format("%.2f: Total allocated MIPS for VM #"+vm.getId()+" (Host #"+vm.getHost().getId()+") is %.2f, was requested %.2f out of total %.2f (%.2f%%)\n",CloudSim.clock(),totalAllocatedMips,totalRequestedMips,vm.getMips(),totalRequestedMips/vm.getMips()*100));
}
Log.formatLine("%.2f: Total allocated MIPS for VM #"+vm.getId()+" (Host #"+vm.getHost().getId()+") is %.2f, was requested %.2f out of total %.2f (%.2f%%)",CloudSim.clock(),totalAllocatedMips,totalRequestedMips,vm.getMips(),totalRequestedMips/vm.getMips()*100);
if(vm.isInMigration()){
Log.printLine("VM #"+vm.getId()+" is in migration");
doubletime=host.updateVmsProcessing(currentTime);// inform VMs to update processing
if(time<minTime){
minTime=time;
}
if(!Log.isDisabled()){
Log.print(String.format("%.2f: Host #%d utilization is %.2f%%\n",CloudSim.clock(),host.getId(),host.getUtilizationOfCpu()*100));
}
Log.formatLine("%.2f: Host #%d utilization is %.2f%%",CloudSim.clock(),host.getId(),host.getUtilizationOfCpu()*100);
}
setPower(getPower()+timeframePower);
...
...
@@ -179,14 +162,12 @@ public class PowerDatacenter extends Datacenter {
Log.printLine("problem");
}
if(!Log.isDisabled()){
if(oldHost==null){
Log.print(String.format("%.2f: Migration of VM #%d to Host #%d is started\n",CloudSim.clock(),vm.getId(),targetHost.getId()));
Log.formatLine("%.2f: Migration of VM #%d to Host #%d is started",CloudSim.clock(),vm.getId(),targetHost.getId());
}else{
Log.print(String.format("%.2f: Migration of VM #%d from Host #%d to Host #%d is started\n",CloudSim.clock(),vm.getId(),oldHost.getId(),targetHost.getId()));
Log.formatLine("%.2f: Migration of VM #%d from Host #%d to Host #%d is started",CloudSim.clock(),vm.getId(),oldHost.getId(),targetHost.getId());
doubletime=host.updateVmsProcessing(currentTime);// inform VMs to update processing
if(time<minTime){
...
...
@@ -146,12 +132,10 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter {
targetHost.addMigratingInVm(vm);
if(!Log.isDisabled()){
if(oldHost==null){
Log.print(String.format("%.2f: Migration of VM #%d to Host #%d is started\n",CloudSim.clock(),vm.getId(),targetHost.getId()));
Log.formatLine("%.2f: Migration of VM #%d to Host #%d is started",CloudSim.clock(),vm.getId(),targetHost.getId());
}else{
Log.print(String.format("%.2f: Migration of VM #%d from Host #%d to Host #%d is started\n",CloudSim.clock(),vm.getId(),oldHost.getId(),targetHost.getId()));
}
Log.formatLine("%.2f: Migration of VM #%d from Host #%d to Host #%d is started",CloudSim.clock(),vm.getId(),oldHost.getId(),targetHost.getId());