Source:
protected VDSReturnValue performImageVdsmOperation() { setDestinationImageId(Guid.NewGuid()); mNewCreatedDiskImage = cloneDiskImage(getDestinationImageId()); mNewCreatedDiskImage.setStorageIds(new ArrayList<Guid>(Arrays.asList(getDestinationStorageDomainId()))); setStoragePoolId(mNewCreatedDiskImage.getStoragePoolId() != null ? mNewCreatedDiskImage.getStoragePoolId() .getValue() : Guid.Empty); getParameters().setStoragePoolId(getStoragePoolId().getValue()); mNewCreatedDiskImage.setVolumeType(VolumeType.Sparse); mNewCreatedDiskImage.setvolumeFormat(VolumeFormat.COW); VDSReturnValue vdsReturnValue = null; try { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); getReturnValue().getTaskPlaceHolderIdList().add(taskId); vdsReturnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.CreateSnapshot, new CreateSnapshotVDSCommandParameters(getStoragePoolId().getValue(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), mNewCreatedDiskImage.getVolumeType(), mNewCreatedDiskImage.getVolumeFormat(), getDiskImage().getimage_group_id().getValue(), getDestinationImageId(), "", getStoragePool().getcompatibility_version().toString())); if (vdsReturnValue.getSucceeded()) { getParameters().setTaskIds(new java.util.ArrayList<Guid>()); getParameters().getTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId(), getParameters().getDestinationImageId())); getReturnValue().getInternalTaskIdList().add(getParameters().getTaskIds().get(0)); if (getDestinationImageId().equals(Guid.Empty)) { throw new RuntimeException(); } } } catch (java.lang.Exception e) { log.errorFormat( "CreateSnapshotCommand::CreateSnapshotInIrsServer::Failed creating snapshot from image id -'{0}'", getImage().getImageId()); throw new VdcBLLException(VdcBllErrors.VolumeCreationError); } return vdsReturnValue; }

Target:
protected VDSReturnValue performImageVdsmOperation() { setDestinationImageId(Guid.NewGuid()); mNewCreatedDiskImage = cloneDiskImage(getDestinationImageId()); mNewCreatedDiskImage.setStorageIds(new ArrayList<Guid>(Arrays.asList(getDestinationStorageDomainId()))); setStoragePoolId(mNewCreatedDiskImage.getStoragePoolId() != null ? mNewCreatedDiskImage.getStoragePoolId() .getValue() : Guid.Empty); getParameters().setStoragePoolId(getStoragePoolId().getValue()); mNewCreatedDiskImage.setVolumeType(VolumeType.Sparse); mNewCreatedDiskImage.setvolumeFormat(VolumeFormat.COW); VDSReturnValue vdsReturnValue = null; try { Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); vdsReturnValue = Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.CreateSnapshot, new CreateSnapshotVDSCommandParameters(getStoragePoolId().getValue(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), mNewCreatedDiskImage.getVolumeType(), mNewCreatedDiskImage.getVolumeFormat(), getDiskImage().getimage_group_id().getValue(), getDestinationImageId(), "", getStoragePool().getcompatibility_version().toString())); if (vdsReturnValue.getSucceeded()) { getParameters().setTaskIds(new java.util.ArrayList<Guid>()); getParameters().getTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId(), getParameters().getDestinationImageId())); getReturnValue().getInternalTaskIdList().add(getParameters().getTaskIds().get(0)); if (getDestinationImageId().equals(Guid.Empty)) { throw new RuntimeException(); } } } catch (java.lang.Exception e) { log.errorFormat( "CreateSnapshotCommand::CreateSnapshotInIrsServer::Failed creating snapshot from image id -'{0}'", getImage().getImageId()); throw new VdcBLLException(VdcBllErrors.VolumeCreationError); } return vdsReturnValue; }