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);
Assert.assertFalse(ans.getDetails(), ans.getResult());
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); startAnswer.setIqnToData(iqnToData); final String msg = citrixResourceBase.handleVmStartFailure(conn, vmName, vm, "", e); final StartAnswer startAnswer = new StartAnswer(command, msg); startAnswer.setIqnToData(iqnToData);
if (startAnswer != null && startAnswer.getResult()) { handlePath(vmTO.getDisks(), startAnswer.getIqnToData()); final String host_guid = startAnswer.getHost_guid(); final GPUDeviceTO gpuDevice = startAnswer.getVirtualMachine().getGpuDevice(); if (gpuDevice != null) { _resourceMgr.updateGPUDetails(destHostId, gpuDevice.getGroupDetails()); s_logger.info("Unable to start VM on " + dest.getHost() + " due to " + (startAnswer == null ? " no start answer" : startAnswer.getDetails())); if (startAnswer != null && startAnswer.getContextParam("stopRetry") != null) { break; _workDao.updateStep(work, Step.Release); if ((prevStep == Step.Started || prevStep == Step.Starting) && startAnswer != null && startAnswer.getResult()) { //TODO check the response of cleanup and record it in DB for retry cleanup(vmGuru, vmProfile, work, Event.OperationFailed, false); } else {
private void syncDiskChainChange(final StartAnswer answer) { final VirtualMachineTO vmSpec = answer.getVirtualMachine(); for (final DiskTO disk : vmSpec.getDisks()) { if (disk.getType() != Volume.Type.ISO) { final VolumeObjectTO vol = (VolumeObjectTO)disk.getData(); final VolumeVO volume = _volsDao.findById(vol.getId()); // Use getPath() from VolumeVO to get a fresh copy of what's in the DB. // Before doing this, in a certain situation, getPath() from VolumeObjectTO // returned null instead of an actual path (because it was out of date with the DB). if(vol.getPath() != null) { volumeMgr.updateVolumeDiskChain(vol.getId(), vol.getPath(), vol.getChainInfo()); } else { volumeMgr.updateVolumeDiskChain(vol.getId(), volume.getPath(), vol.getChainInfo()); } } } }
if (startAnswer != null) { StartAnswer startAns = (StartAnswer)startAnswer; VirtualMachineTO vmTO = startAns.getVirtualMachine(); for (NicTO nicTO : vmTO.getNics()) { if (nicTO.getType() == TrafficType.Guest) {
@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()); } }
@Test public final void testStartStopCommand() { String sample = getSampleStartCommand(); StartAnswer sans = simpleVmStart(sample); Assert.assertTrue(sans.getDetails(), sans.getResult()); StopAnswer stopAns = simpleVmStop(); Assert.assertTrue(stopAns.getDetails(), stopAns.getResult()); }
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) {
@Test public final void testStartStartCommand() { String sample = getSampleStartCommand(); StartAnswer sans = simpleVmStart(sample); Assert.assertTrue(sans.getDetails(), sans.getResult()); simpleVmStart(sample); StopAnswer ans = simpleVmStop(); Assert.assertTrue(ans.getDetails(), ans.getResult()); }
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);