Skip to content

Commit 1c3a8f9

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
Commit 24
1 parent 448d17b commit 1c3a8f9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/OntapNfsStorageAdaptor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,10 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk srcDisk, String name, KV
472472
try {
473473
// Get mount point for destination volume (handles junction path properly)
474474
String destMountPoint = getMountPointForVolume(name);
475-
String destPath = destMountPoint + "/" + name;
475+
// Extract volume UUID from name (remove leading slash if present)
476+
String volumeUuid = name.startsWith("/") ? name.substring(name.lastIndexOf('_') + 1).replace("_", "-") : name;
477+
String destPath = destMountPoint + "/" + volumeUuid + ".qcow2";
478+
logger.info("Destination mount point: " + destMountPoint + ", file: " + volumeUuid + ".qcow2");
476479
// Ensure destination volume is mounted
477480
if (!isMounted(destMountPoint)) {
478481
throw new CloudRuntimeException("Destination ONTAP volume not mounted: " + name);
@@ -485,8 +488,8 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk srcDisk, String name, KV
485488
// For encrypted volumes, use options map instead
486489
qemuImg.convert(srcFile, destFile);
487490
logger.info("Successfully copied disk to: " + destPath);
488-
// Return destination disk
489-
KVMPhysicalDisk destDisk = new KVMPhysicalDisk(destPath, name, destPool);
491+
// Return destination disk with correct volume UUID as name
492+
KVMPhysicalDisk destDisk = new KVMPhysicalDisk(destPath, volumeUuid, destPool);
490493
destDisk.setFormat(srcDisk.getFormat());
491494
destDisk.setSize(srcDisk.getSize());
492495
destDisk.setVirtualSize(srcDisk.getVirtualSize());

0 commit comments

Comments
 (0)