Source:
protected boolean performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); persistCommandIfNeeded(); 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(), "", getStoragePool().getCompatibilityVersion(), getDiskImage().getContentType())); 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; }

Target:
protected boolean performImageVdsmOperation() { setDestinationImageId(Guid.isNullOrEmpty(getParameters().getDestinationImageId()) ? Guid.newGuid() : getParameters().getDestinationImageId()); persistCommandIfNeeded(); 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(), "", getStoragePool().getCompatibilityVersion(), getDiskImage().getContentType())); 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; }