Source:
protected VDSReturnValue performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); newDiskImage = cloneDiskImage(getDestinationImageId()); newDiskImage.setStorageIds(new ArrayList<Guid>(Arrays.asList(getDestinationStorageDomainId()))); setStoragePoolId(newDiskImage.getStoragePoolId() != null ? newDiskImage.getStoragePoolId() : Guid.Empty); getParameters().setStoragePoolId(getStoragePoolId()); newDiskImage.setVolumeType(VolumeType.Sparse); newDiskImage.setvolumeFormat(VolumeFormat.COW); VDSReturnValue vdsReturnValue = null; try { Guid taskId = getAsyncTaskId(); vdsReturnValue = runVdsCommand( VDSCommandType.CreateSnapshot, new CreateSnapshotVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "")); if (vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<Guid>()); 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 VdcBLLException(VdcBllErrors.VolumeCreationError); } return vdsReturnValue; }

Target:
protected VDSReturnValue performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); newDiskImage = cloneDiskImage(getDestinationImageId()); newDiskImage.setStorageIds(new ArrayList<Guid>(Arrays.asList(getDestinationStorageDomainId()))); setStoragePoolId(newDiskImage.getStoragePoolId() != null ? newDiskImage.getStoragePoolId() : Guid.Empty); getParameters().setStoragePoolId(getStoragePoolId()); newDiskImage.setVolumeType(VolumeType.Sparse); newDiskImage.setvolumeFormat(VolumeFormat.COW); VDSReturnValue vdsReturnValue = null; try { Guid taskId = getAsyncTaskId(); vdsReturnValue = runVdsCommand( VDSCommandType.CreateSnapshot, new CreateSnapshotVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "")); if (vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<Guid>()); 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 VdcBLLException(VdcBllErrors.VolumeCreationError); } return vdsReturnValue; }