Skip to content
Merged
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 @@ -582,7 +582,7 @@ public Answer copyVolumeFromPrimaryToSecondary(final CopyCommand cmd) {
try {
final String volumeName = UUID.randomUUID().toString();

final String destVolumeName = volumeName + "." + destFormat.getFileExtension();
final String destVolumeName = volumeName + "." + ImageFormat.QCOW2.getFileExtension();
final KVMPhysicalDisk volume = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), srcVolumePath);
volume.setFormat(PhysicalDiskFormat.valueOf(srcFormat.toString()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import javax.inject.Inject;

import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand;
import com.cloud.agent.api.to.DataObjectType;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Upload;
import com.cloud.utils.StringUtils;
import org.apache.log4j.Logger;
Expand Down Expand Up @@ -74,7 +76,14 @@ private String createObjectNameForExtractUrl(String installPath, ImageFormat for
}

if (format != null) {
objectNameInUrl = objectNameInUrl + "." + format.getFileExtension();
if (dataObject.getTO() != null
&& DataObjectType.VOLUME.equals(dataObject.getTO().getObjectType())
&& HypervisorType.KVM.equals(dataObject.getTO().getHypervisorType())) {
// Fix: The format of KVM volumes on image store is qcow2
objectNameInUrl = objectNameInUrl + "." + ImageFormat.QCOW2.getFileExtension();
Comment thread
weizhouapache marked this conversation as resolved.
} else {
objectNameInUrl = objectNameInUrl + "." + format.getFileExtension();
}
} else if (installPath.lastIndexOf(".") != -1) {
objectNameInUrl = objectNameInUrl + "." + installPath.substring(installPath.lastIndexOf(".") + 1);
}
Expand Down
Loading