@@ -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