use of org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters in project ovirt-engine by oVirt.
the class VdsKdumpDetectionCommand method restartVdsVms.
private void restartVdsVms() {
List<VM> vms = vmDao.getAllRunningForVds(getVdsId());
if (!vms.isEmpty()) {
RestartVdsVmsOperation restartVmsOper = new RestartVdsVmsOperation(getContext(), getVds());
restartVmsOper.restartVms(vms);
runVdsCommand(VDSCommandType.UpdateVdsVMsCleared, new UpdateVdsVMsClearedVDSCommandParameters(getVds().getId()));
}
}
use of org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters in project ovirt-engine by oVirt.
the class StopVdsCommand method handleSpecificCommandActions.
@Override
protected void handleSpecificCommandActions() {
List<VM> vmList = getVmList();
if (vmList.size() > 0) {
RestartVdsVmsOperation restartVmsOper = new RestartVdsVmsOperation(getContext(), getVds());
restartVmsOper.restartVms(vmList);
runVdsCommand(VDSCommandType.UpdateVdsVMsCleared, new UpdateVdsVMsClearedVDSCommandParameters(getVds().getId()));
}
}
use of org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters in project ovirt-engine by oVirt.
the class ClearNonResponsiveVdsVmsCommand method executeCommand.
@Override
protected void executeCommand() {
List<VM> vms = vmDao.getAllRunningForVds(getVdsId());
Collections.sort(vms, Collections.reverseOrder(new VmsComparer()));
List<Guid> autoStartVmIdsToRerun = new ArrayList<>();
for (VM vm : vms) {
if (vm.isAutoStartup()) {
autoStartVmIdsToRerun.add(vm.getId());
}
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetVmStatus, new SetVmStatusVDSCommandParameters(vm.getId(), VMStatus.Down, VmExitStatus.Error));
// Write that this VM was shut down by host reboot or manual fence
if (returnValue != null && returnValue.getSucceeded()) {
logSettingVmToDown(vm);
}
runInternalActionWithTasksContext(ActionType.ProcessDownVm, new ProcessDownVmParameters(vm.getId(), true));
}
runVdsCommand(VDSCommandType.UpdateVdsVMsCleared, new UpdateVdsVMsClearedVDSCommandParameters(getVdsId()));
if (!autoStartVmIdsToRerun.isEmpty()) {
haAutoStartVmsRunner.addVmsToRun(autoStartVmIdsToRerun);
}
setSucceeded(true);
}
Aggregations