MachinePool machinePool = getMachinePool();
int poolSize = machinePool.getAllocatedMachines().size();
// clean out obsolete machines from termination queue
this.terminationQueue.filter(machinePool.getAllocatedMachines());
ResizePlanner resizePlanner = new ResizePlanner(machinePool,
this.terminationQueue, scaleDownConfig()
.getVictimSelectionPolicy(), scaleDownConfig()
.getInstanceHourMargin());
int netSize = resizePlanner.getEffectiveSize();
ResizePlan resizePlan = resizePlanner
.calculateResizePlan(desiredSize());
if (resizePlan.isScaleUp()) {
List<Machine> startedMachines = scaleUp(poolSize, resizePlan);
poolSize += startedMachines.size();
} else if (resizePlan.isScaleDown()) {