Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
private static final List<StoragePoolType> SUPPORTED_POOL_TYPES_TO_BYPASS_SECONDARY_STORE = Arrays.asList(
StoragePoolType.NetworkFilesystem,
StoragePoolType.Filesystem,
StoragePoolType.RBD
StoragePoolType.RBD,
StoragePoolType.CLVM,
StoragePoolType.CLVM_NG
);

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3393,6 +3393,12 @@ public Answer handleDownloadTemplateToPrimaryStorage(DirectDownloadCommand cmd)
return new DirectDownloadAnswer(true, template.getSize(), template.getName());
}

/** CLVM and CLVM_NG volumes are named after the logical volume, without a file extension. */
protected String generateVolumeName(StoragePoolType poolType, ImageFormat format) {
String volumeName = UUID.randomUUID().toString();
return ClvmPoolManager.isClvmPoolType(poolType) ? volumeName : volumeName + "." + format.getFileExtension();
}

@Override
public Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd) {
final DataTO srcData = cmd.getSrcTO();
Expand Down Expand Up @@ -3446,8 +3452,7 @@ public Answer copyVolumeFromPrimaryToPrimary(CopyCommand cmd) {
} else {
PhysicalDiskFormat destPoolDefaultFormat = destPool.getDefaultFormat();
destFormat = getFormat(destPoolDefaultFormat);
final String volumeName = UUID.randomUUID().toString();
destVolumeName = volumeName + "." + destFormat.getFileExtension();
destVolumeName = generateVolumeName(destPrimaryStore.getPoolType(), destFormat);

// Update path in the command for reconciliation
if (StringUtils.isBlank(destVolumePath)) {
Expand Down