use of org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters in project ovirt-engine by oVirt.
the class SPMRevertTaskVDSCommand method executeIrsBrokerCommand.
@Override
protected void executeIrsBrokerCommand() {
VDSReturnValue returnValue = resourceManager.runVdsCommand(VDSCommandType.HSMRevertTask, new HSMTaskGuidBaseVDSCommandParameters(getCurrentIrsProxy().getCurrentVdsId(), getParameters().getTaskId()));
if (returnValue != null && !returnValue.getSucceeded()) {
getVDSReturnValue().setVdsError(returnValue.getVdsError());
getVDSReturnValue().setSucceeded(false);
}
}
use of org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters in project ovirt-engine by oVirt.
the class SpmStartVDSCommand method executeVdsBrokerCommand.
@Override
protected void executeVdsBrokerCommand() {
result = getBroker().spmStart(getParameters().getStoragePoolId().toString(), getParameters().getPrevId(), getParameters().getPrevLVER(), getParameters().getRecoveryMode().getValue(), String.valueOf(getParameters().getSCSIFencing()).toLowerCase(), Config.getValue(ConfigValues.MaxNumberOfHostsInStoragePool), getParameters().getStoragePoolFormatType().getValue());
proceedProxyReturnValue();
Guid taskId = new Guid(result.uuid);
AsyncTaskStatus taskStatus;
log.info("spmStart polling started: taskId '{}'", taskId);
do {
// TODO: make configurable
ThreadUtils.sleep(1000L);
taskStatus = (AsyncTaskStatus) resourceManager.runVdsCommand(VDSCommandType.HSMGetTaskStatus, new HSMTaskGuidBaseVDSCommandParameters(vdsId, taskId)).getReturnValue();
log.debug("spmStart polling - task status: '{}'", taskStatus.getStatus());
} while (taskStatus.getStatus() != AsyncTaskStatusEnum.finished && taskStatus.getStatus() != AsyncTaskStatusEnum.unknown);
log.info("spmStart polling ended: taskId '{}' task status '{}'", taskId, taskStatus.getStatus());
if (!taskStatus.getTaskEndedSuccessfully()) {
log.error("Start SPM Task failed - result: '{}', message: {}", taskStatus.getResult(), taskStatus.getMessage());
}
SpmStatusResult spmStatus = (SpmStatusResult) resourceManager.runVdsCommand(VDSCommandType.SpmStatus, new SpmStatusVDSCommandParameters(vdsId, getParameters().getStoragePoolId())).getReturnValue();
if (spmStatus != null) {
log.info("spmStart polling ended, spm status: {}", spmStatus.getSpmStatus());
} else {
log.error("spmStart polling ended, failed to get the spm status");
}
try {
resourceManager.runVdsCommand(VDSCommandType.HSMClearTask, new HSMTaskGuidBaseVDSCommandParameters(vdsId, taskId));
} catch (Exception e) {
log.error("Could not clear spmStart task '{}', continuing with SPM selection: {}", taskId, e.getMessage());
log.debug("Exception", e);
}
setReturnValue(spmStatus);
}
use of org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters in project ovirt-engine by oVirt.
the class SPMClearTaskVDSCommand method executeIrsBrokerCommand.
@Override
protected void executeIrsBrokerCommand() {
VDSReturnValue returnValue = resourceManager.runVdsCommand(VDSCommandType.HSMClearTask, new HSMTaskGuidBaseVDSCommandParameters(getCurrentIrsProxy().getCurrentVdsId(), getParameters().getTaskId()));
if (returnValue != null && !returnValue.getSucceeded()) {
getVDSReturnValue().setVdsError(returnValue.getVdsError());
getVDSReturnValue().setSucceeded(false);
}
}
Aggregations