@Override
public boolean prepare(VirtualMachineProfile profile, NicProfile nic, Network network, DeployDestination dest, ReservationContext context) {
try {
if (DataCenter.NetworkType.Basic.equals(dest.getDataCenter().getNetworkType())) {
if (!preparePxeInBasicZone(profile, nic, dest, context)) {
return false;
}
} else {
if (!preparePxeInAdvancedZone(profile, nic, network, dest, context)) {
return false;
}
}
IpmISetBootDevCommand bootCmd = new IpmISetBootDevCommand(BootDev.pxe);
Answer aws = _agentMgr.send(dest.getHost().getId(), bootCmd);
if (!aws.getResult()) {
s_logger.warn("Unable to set host: " + dest.getHost().getId() + " to PXE boot because " + aws.getDetails());
}
return aws.getResult();
} catch (Exception e) {
s_logger.warn("Cannot prepare PXE server", e);
return false;
}
}