Source:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); VDSReturnValue vdsReturnValue = null; try { vdsReturnValue = runVdsCommand(VDSCommandType.DestroyImage, createVDSParameters()); } catch (EngineException e) { log.error("Failed to delete image {}/{}", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst().get(), e); if (!getParameters().isLiveMerge()) { throw e; } } if (vdsReturnValue != null && vdsReturnValue.getCreationInfo() != null) { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); Guid result = createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()); getTaskIdList().add(result); getReturnValue().getVdsmTaskIdList().add(result); log.info("Successfully started task to remove orphaned volumes resulting from live merge"); } else if (ActionType.RemoveSnapshotSingleDisk == getParentParameters().getParentCommand()) { log.info("Retrying deleting image {}/{}", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst().get()); MergeStatusReturnValue returnValue = new MergeStatusReturnValue(VmBlockJobType.COMMIT, new HashSet<>(getParameters().getImageList())); getReturnValue().setActionReturnValue(returnValue); ((RemoveSnapshotSingleDiskParameters) getParameters().getParentParameters()). setNextCommandStep(RemoveSnapshotSingleDiskStep.DESTROY_IMAGE); } setSucceeded(true); setCommandStatus(CommandStatus.SUCCEEDED); }

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); VDSReturnValue vdsReturnValue = null; try { vdsReturnValue = runVdsCommand(VDSCommandType.DestroyImage, createVDSParameters()); } catch (EngineException e) { log.error("Failed to delete image {}/{}", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst().get(), e); if (!getParameters().isLiveMerge()) { throw e; } } if (vdsReturnValue != null && vdsReturnValue.getCreationInfo() != null) { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); Guid result = createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()); getTaskIdList().add(result); getReturnValue().getVdsmTaskIdList().add(result); log.info("Successfully started task to remove orphaned volumes" ); } else if (ActionType.RemoveSnapshotSingleDisk == getParentParameters().getParentCommand() || ActionType.RemoveSnapshotSingleDiskLive == getParentParameters().getParentCommand()) { log.info("Retrying deleting image {}/{}", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst().get()); MergeStatusReturnValue returnValue = new MergeStatusReturnValue(VmBlockJobType.COMMIT, new HashSet<>(getParameters().getImageList())); getReturnValue().setActionReturnValue(returnValue); ((RemoveSnapshotSingleDiskParameters) getParameters().getParentParameters()). setNextCommandStep(RemoveSnapshotSingleDiskStep.DESTROY_IMAGE); } setSucceeded(true); setCommandStatus(CommandStatus.SUCCEEDED); }