return new StartAnswer(cmd, "Cannot get current power status of " + getName()); return new StartAnswer(cmd, "IPMI reboot failed"); return new StartAnswer(cmd, "IPMI power on failed"); boolean echoRet = hc.echo(vm.getNics()[0].getIp(), TimeUnit.MINUTES.toMillis(30), TimeUnit.MINUTES.toMillis(1)); if (!echoRet) { return new StartAnswer(cmd, String.format("Call security group agent on vm[%s] timeout", vm.getNics()[0].getIp())); vmvo = q.find(); if (vmvo == null) { return new StartAnswer(cmd, String.format("cannot find vm[name:%s] while waiting for baremtal provision done notification", vm.getName())); return new StartAnswer(cmd); return new StartAnswer(cmd, String.format("timeout after %s seconds, no baremetal provision done notification received. vm[name:%s] failed to start", isProvisionDoneNotificationTimeout, vm.getName())); return new StartAnswer(cmd);
@Override public synchronized StartAnswer execute(StartCommand cmd) { VirtualMachineTO vmSpec = cmd.getVirtualMachine(); String vmName = vmSpec.getName(); OvmVm.Details vmDetails = null; try { vmDetails = new OvmVm.Details(); applySpecToVm(vmDetails, vmSpec); createVbds(vmDetails, vmSpec); createVifs(vmDetails, vmSpec); startVm(vmDetails); // Add security group rules NicTO[] nics = vmSpec.getNics(); for (NicTO nic : nics) { if (nic.isSecurityGroupEnabled()) { if (vmSpec.getType().equals(VirtualMachine.Type.User)) { defaultNetworkRulesForUserVm(vmName, vmSpec.getId(), nic); } } } return new StartAnswer(cmd); } catch (Exception e) { s_logger.debug("Start vm " + vmName + " failed", e); cleanup(vmDetails); return new StartAnswer(cmd, e.getMessage()); } }
final String msg = "VM " + vmName + " is runing on host " + host; s_logger.debug(msg); return new StartAnswer(command, msg, host); } else { final String msg = "There is already a VM having the same name " + vmName + " vm record " + vRec.toString(); s_logger.warn(msg); return new StartAnswer(command, msg); final StartAnswer startAnswer = new StartAnswer(command); final String msg = citrixResourceBase.handleVmStartFailure(conn, vmName, vm, "", e); final StartAnswer startAnswer = new StartAnswer(command, msg);
return new StartAnswer(command, "Failed to connect physical disks to host"); return new StartAnswer(command); } catch (final LibvirtException e) { s_logger.warn("LibvirtException ", e); libvirtComputingResource.handleVmStartFailure(conn, vmName, vm); return new StartAnswer(command, e.getMessage()); } catch (final InternalErrorException e) { s_logger.warn("InternalErrorException ", e); libvirtComputingResource.handleVmStartFailure(conn, vmName, vm); return new StartAnswer(command, e.getMessage()); } catch (final URISyntaxException e) { s_logger.warn("URISyntaxException ", e); libvirtComputingResource.handleVmStartFailure(conn, vmName, vm); return new StartAnswer(command, e.getMessage()); } finally { if (state != DomainState.VIR_DOMAIN_RUNNING) {
LOGGER.debug(msg); state = State.Stopped; return new StartAnswer(cmd, msg); return new StartAnswer(cmd); } catch (Exception e) { LOGGER.debug("Start vm " + vmName + " failed", e); state = State.Stopped; return new StartAnswer(cmd, e.getMessage()); } finally { hypervisorsupport.setVmState(vmName, state);