Source:
protected boolean performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); newDiskImage = cloneDiskImage(getDestinationImageId()); newDiskImage.setId(Guid.newGuid()); Guid storagePoolID = newDiskImage.getStoragePoolId() != null ? newDiskImage .getStoragePoolId() : Guid.Empty; VDSReturnValue vdsReturnValue = null; if (isDataOperationsByHSM()) { CopyImageGroupWithDataCommandParameters p = new CopyImageGroupWithDataCommandParameters( storagePoolID, getParameters().getStorageDomainId(), getDestinationStorageDomainId(), getDiskImage().getId(), getImage().getImageId(), newDiskImage.getId(), getDestinationImageId(), newDiskImage.getVolumeFormat(), true); p.setParentParameters(getParameters()); p.setParentCommand(getActionType()); p.setEndProcedure(VdcActionParametersBase.EndProcedure.COMMAND_MANAGED); runInternalAction(VdcActionType.CopyImageGroupWithData, p); return true; } else { Guid taskId = persistAsyncTaskPlaceHolder(VdcActionType.AddVmFromTemplate); try { vdsReturnValue = runVdsCommand(VDSCommandType.CopyImage, PostZeroHandler.fixParametersWithPostZero( new CopyImageVDSCommandParameters(storagePoolID, getParameters().getStorageDomainId(), getVmTemplateId(), getDiskImage().getId(), getImage().getImageId(), newDiskImage.getId(), getDestinationImageId(), "", getDestinationStorageDomainId(), CopyVolumeType.LeafVol, newDiskImage.getVolumeFormat(), newDiskImage.getVolumeType(), getDiskImage().isWipeAfterDelete(), false))); } catch (EngineException e) { log.error("Failed creating snapshot from image id '{}'", getImage().getImageId()); throw e; } if (vdsReturnValue.getSucceeded()) { getTaskIdList().add( createTask(taskId, vdsReturnValue.getCreationInfo(), VdcActionType.AddVmFromTemplate, VdcObjectType.Storage, getParameters().getStorageDomainId(), getDestinationStorageDomainId())); } return vdsReturnValue.getSucceeded(); } }

Target:
protected boolean performImageVdsmOperation() { setDestinationImageId(Guid.newGuid()); newDiskImage = cloneDiskImage(getDestinationImageId()); newDiskImage.setId(Guid.newGuid()); Guid storagePoolID = newDiskImage.getStoragePoolId() != null ? newDiskImage .getStoragePoolId() : Guid.Empty; if (isDataOperationsByHSM()) { CopyImageGroupWithDataCommandParameters p = new CopyImageGroupWithDataCommandParameters( storagePoolID, getParameters().getStorageDomainId(), getDestinationStorageDomainId(), getDiskImage().getId(), getImage().getImageId(), newDiskImage.getId(), getDestinationImageId(), newDiskImage.getVolumeFormat(), true); p.setParentParameters(getParameters()); p.setParentCommand(getActionType()); p.setEndProcedure(VdcActionParametersBase.EndProcedure.COMMAND_MANAGED); runInternalAction(VdcActionType.CopyImageGroupWithData, p); return true; } else { Guid taskId = persistAsyncTaskPlaceHolder(VdcActionType.AddVmFromTemplate); VDSReturnValue vdsReturnValue; try { vdsReturnValue = runVdsCommand(VDSCommandType.CopyImage, PostZeroHandler.fixParametersWithPostZero( new CopyImageVDSCommandParameters(storagePoolID, getParameters().getStorageDomainId(), getVmTemplateId(), getDiskImage().getId(), getImage().getImageId(), newDiskImage.getId(), getDestinationImageId(), "", getDestinationStorageDomainId(), CopyVolumeType.LeafVol, newDiskImage.getVolumeFormat(), newDiskImage.getVolumeType(), getDiskImage().isWipeAfterDelete(), false))); } catch (EngineException e) { log.error("Failed creating snapshot from image id '{}'", getImage().getImageId()); throw e; } if (vdsReturnValue.getSucceeded()) { getTaskIdList().add( createTask(taskId, vdsReturnValue.getCreationInfo(), VdcActionType.AddVmFromTemplate, VdcObjectType.Storage, getParameters().getStorageDomainId(), getDestinationStorageDomainId())); } return vdsReturnValue.getSucceeded(); } }