/** * Restore VM allocation from the allocation history. * @see #savedAllocation */ protected void restoreAllocation() { for (Host host : getHostList()) { host.vmDestroyAll(); host.reallocateMigratingInVms(); } for (Map<String, Object> map : getSavedAllocation()) { Vm vm = (Vm) map.get("vm"); PowerHost host = (PowerHost) map.get("host"); if (!host.vmCreate(vm)) { Log.printConcatLine("Couldn't restore VM #", vm.getId(), " on host #", host.getId()); System.exit(0); } getVmTable().put(vm.getUid(), host); } }