logger.debug("found resource = " + resource);
final VirtualMachine vm = resource.getVM();
if (vm == null) {
throw new ProgrammingError("vm is null");
}
final String node = vm.getNode();
if (node == null) {
logger.warn(Lager.id(vmid) + " assuming no node assignment yet " +
"because of ensemble not-done");
return;
}
final VirtualMachineDeployment vmdep = vm.getDeployment();
if (vmdep == null) {
throw new ProgrammingError("deployment is null");
}
boolean preemptable = vm.isPreemptable();
final int mem = vmdep.getIndividualPhysicalMemory();