Source:
protected void executeVdsBrokerCommand() { _result = getBroker().spmStart(getParameters().getStoragePoolId().toString(), getParameters().getPrevId(), getParameters().getPrevLVER(), getParameters().getRecoveryMode().getValue(), String.valueOf(getParameters().getSCSIFencing()).toLowerCase(), Config.<Integer> getValue(ConfigValues.MaxNumberOfHostsInStoragePool), getParameters().getStoragePoolFormatType().getValue()); proceedProxyReturnValue(); Guid taskId = new Guid(_result.uuid); AsyncTaskStatus taskStatus; log.info("spmStart polling started: taskId '{}'", taskId); do { ThreadUtils.sleep(1000); taskStatus = (AsyncTaskStatus) ResourceManager .getInstance() .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 .getInstance() .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.getInstance().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); }

Target:
protected void executeVdsBrokerCommand() { result = getBroker().spmStart(getParameters().getStoragePoolId().toString(), getParameters().getPrevId(), getParameters().getPrevLVER(), getParameters().getRecoveryMode().getValue(), String.valueOf(getParameters().getSCSIFencing()).toLowerCase(), Config.<Integer> getValue(ConfigValues.MaxNumberOfHostsInStoragePool), getParameters().getStoragePoolFormatType().getValue()); proceedProxyReturnValue(); Guid taskId = new Guid(result.uuid); AsyncTaskStatus taskStatus; log.info("spmStart polling started: taskId '{}'", taskId); do { ThreadUtils.sleep(1000); taskStatus = (AsyncTaskStatus) ResourceManager .getInstance() .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 .getInstance() .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.getInstance().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); }