public boolean isRunningAndQualifyForDisksMigration() { return getStatus().isUpOrPaused() && getRunOnVds() != null && !getRunOnVds().equals(Guid.Empty); }
vm.setVmPauseStatus(instance.getVmPauseStatus()); vm.setPriority(instance.getPriority()); vm.setRunOnVds(instance.getRunOnVds()); vm.setRunOnVdsName(instance.getRunOnVdsName()); vm.setSession(instance.getSession());
private VdsStatic getVdsStatic() { if (cachedVdsStatic == null && ((vdsId != null && !Guid.Empty.equals(vdsId)) || (getVm() != null && getVm().getRunOnVds() != null))) { if (vdsId == null || Guid.Empty.equals(vdsId)) { vdsId = getVm().getRunOnVds(); } try { cachedVdsStatic = vdsStaticDao.get(getVdsId()); } catch (final RuntimeException e) { log.info("Failed to get vds '{}', error: {}", vdsId, e.getMessage()); log.debug("Exception", e); } } return cachedVdsStatic; }
protected VDS getVds() { if (vds == null && ((vdsId != null && !Guid.Empty.equals(vdsId)) || (getVm() != null && getVm().getRunOnVds() != null))) { if (vdsId == null || Guid.Empty.equals(vdsId)) { vdsId = getVm().getRunOnVds(); } try { vds = vdsDao.get(getVdsId()); } catch (final RuntimeException e) { log.info("Failed to get vds '{}', error {}", vdsId, e.getMessage()); log.debug("Exception", e); } } return vds; }
@Override public Response maintenance(Action action) { validateParameters(action, "maintenanceEnabled"); org.ovirt.engine.core.common.businessentities.VM entity = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmByVmId, new IdQueryParameters(guid), id); if (!entity.isHostedEngine()) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity("Moving to maintenance mode is currently only available for the VM containing the hosted engine.") .build()); } return doAction(ActionType.SetHaMaintenance, new SetHaMaintenanceParameters(entity.getRunOnVds(), HaMaintenanceMode.GLOBAL, action.isMaintenanceEnabled()), action); }
@Override protected void connect() { if (getEntity() == null || getEntity().getRunOnVds() == null) { return; } getLogger().debug("VNC console info..."); //$NON-NLS-1$ UICommand invokeConsoleCommand = new UICommand("invokeConsoleCommand", new BaseCommandTarget() { //$NON-NLS-1$ @Override public void executeCommand(UICommand uiCommand) { invokeConsole(); } }); executeCommandWithConsoleSafenessWarning(invokeConsoleCommand); }
@Override protected void connect() { if (getEntity() != null) { getLogger().debug("Connecting to Spice console..."); //$NON-NLS-1$ // Don't connect if there VM is not running on any host. if (getEntity().getRunOnVds() == null) { return; } // If it is not windows or SPICE guest agent is not installed, make sure the WAN options are disabled. if (!AsyncDataProvider.getInstance().isWindowsOsType(getEntity().getVmOsId()) || !getEntity().getHasSpiceDriver()) { getSpiceImpl().getOptions().setWanOptionsEnabled(false); } UICommand invokeConsoleCommand = new UICommand("invokeConsoleCommand", new BaseCommandTarget() { //$NON-NLS-1$ @Override public void executeCommand(UICommand uiCommand) { invokeConsole(); } }); executeCommandWithConsoleSafenessWarning(invokeConsoleCommand); } }
if(entity.getRunOnVds() != null) { model.setHost(new Host()); model.getHost().setId(entity.getRunOnVds().toString());
hostCpu = calculateHostCpus(); updateNumOfSockets(); }), vm.getRunOnVds());