ans = _agentMgr.send(hostId, boot);
if (!ans.getResult()) {
throw new Exception("Boot/Reboot host " + hostId + " failed");
}
VMTemplateVO tmpl = adapter.create(tmplProfile);
s_logger.debug("Create baremetal template for host " + hostId + " successfully, template id:" + tmpl.getId());
return tmpl;
} catch (Exception e) {
s_logger.debug("Create baremetal tempalte for host " + hostId + " failed", e);
throw new CloudRuntimeException(e.getMessage());