@Override public BaremetalPxeType getPxeServerType(HostVO host) { if (host.getResource().equalsIgnoreCase(BaremetalPingPxeResource.class.getName())) { return BaremetalPxeType.PING; } else { throw new CloudRuntimeException("Unkown PXE server resource " + host.getResource()); } }
@Override public ServerResource reloadResource(HostVO host) { String resourceName = host.getResource(); ServerResource resource = getResource(resourceName); if (resource != null) { _hostDao.loadDetails(host); HashMap<String, Object> params = buildConfigParams(host); try { resource.configure(host.getName(), params); } catch (ConfigurationException e) { s_logger.warn("Unable to configure resource due to " + e.getMessage()); return null; } if (!resource.start()) { s_logger.warn("Unable to start the resource"); return null; } } return resource; }