Source:
<code>protected boolean performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); newDiskImage = cloneDiskImage(getDestinationImageId()); newDiskImage.setStorageIds(new ArrayList<>(Arrays.asList(getDestinationStorageDomainId()))); setStoragePoolId(newDiskImage.getStoragePoolId() != null ? newDiskImage.getStoragePoolId() : Guid.Empty); getParameters().setStoragePoolId(getStoragePoolId()); newDiskImage.setVolumeType(VolumeType.Sparse); newDiskImage.setVolumeFormat(VolumeFormat.COW); <START> VDSReturnValue vdsReturnValue; <END> try { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); vdsReturnValue = runVdsCommand( VDSCommandType.CreateSnapshot, new CreateSnapshotVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "")); if (vdsReturnValue != null && vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<>()); getParameters().getVdsmTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId(), getParameters().getDestinationImageId())); getReturnValue().getInternalVdsmTaskIdList().add(getParameters().getVdsmTaskIds().get(0)); if (getDestinationImageId().equals(Guid.Empty)) { throw new RuntimeException(); } } } catch (Exception e) { log.error("Failed creating snapshot from image id '{}'", getImage().getImageId()); CommandCoordinatorUtil.logAndFailTaskOfCommandWithEmptyVdsmId(getAsyncTaskId(), "Create snapshot failed at VDSM. DB task ID is " + getAsyncTaskId()); throw new EngineException(EngineError.VolumeCreationError); } return vdsReturnValue != null ? vdsReturnValue.getSucceeded() : false; }</code><technical_language>need in try block</technical_language>

Target:
protected boolean performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); newDiskImage = cloneDiskImage(getDestinationImageId()); newDiskImage.setStorageIds(new ArrayList<>(Arrays.asList(getDestinationStorageDomainId()))); setStoragePoolId(newDiskImage.getStoragePoolId() != null ? newDiskImage.getStoragePoolId() : Guid.Empty); getParameters().setStoragePoolId(getStoragePoolId()); newDiskImage.setVolumeType(VolumeType.Sparse); newDiskImage.setVolumeFormat(VolumeFormat.COW); try { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = runVdsCommand( VDSCommandType.CreateSnapshot, new CreateSnapshotVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "")); if (vdsReturnValue != null && vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<>()); getParameters().getVdsmTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId(), getParameters().getDestinationImageId())); getReturnValue().getInternalVdsmTaskIdList().add(getParameters().getVdsmTaskIds().get(0)); if (getDestinationImageId().equals(Guid.Empty)) { throw new RuntimeException(); } return true; } } catch (Exception e) { log.error("Failed creating snapshot from image id '{}'", getImage().getImageId()); CommandCoordinatorUtil.logAndFailTaskOfCommandWithEmptyVdsmId(getAsyncTaskId(), "Create snapshot failed at VDSM. DB task ID is " + getAsyncTaskId()); throw new EngineException(EngineError.VolumeCreationError); } return false; }