if (requestedRA == null) {
throw new IllegalArgumentException("requestedRA may not be null");
}
final int numNodes = req.getRequestedRA().getNodeNumber();
final VirtualMachine vm = new VirtualMachine();
final String name = req.getName();
vm.setName(name);
vm.setPreemptable(req.getRequestedRA().isSpotInstance());
if (numNodes > 1) {
logger.debug("binding " + numNodes + " virtual machines: " + name);
} else {
logger.debug("binding virtual machine: " + name);
}
final VirtualMachineDeployment dep = new VirtualMachineDeployment();
vm.setDeployment(dep);
this.bindNetwork.neededAllocations(vm, req.getRequestedNics());
this.bindResourcePool.consume(vm, req.getRequestedResourcePool());
this.bindSchedule.consume(dep, req.getRequestedSchedule());
this.bindInitialState.consume(vm, req.getInitialStateRequest());
this.bindShutdownMechanism.consume(dep, req.getShutdownType());
this.bindKernel.consume(vm, req.getRequestedKernel());
this.bindDisks.consume(vm, req.getVMFiles());
this.bindResourceRequest.consume(dep, req.getRequestedRA());
this.bindVMM.consume(vm, req.getRequiredVMM());
this.bindCustomizations.consume(vm, req.getCustomizationRequests());
this.bindCredential.consume(vm, req.getCredential());
// all in group get the same data
if (req.getMdUserData() != null) {
vm.setMdUserData(req.getMdUserData());
}
final VirtualMachine[] vms = new VirtualMachine[numNodes];
for (int i = 0; i < vms.length; i++) {
try {