diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java index 8a5cbb6a753c..6f7dc7a201bf 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java @@ -2293,7 +2293,9 @@ private CloudStackVolume createCloneFileFromSnapshotRequest(StoragePoolVO storag String flexVolName = details.get(OntapStorageConstants.VOLUME_NAME); FileInfo file = new FileInfo(); - file.setPath(OntapStorageUtils.toFlexVolRelativePath(sourceVolumePath, flexVolName)); + String relativeSourcePath = OntapStorageUtils.toFlexVolRelativePath(sourceVolumePath, flexVolName); + file.setPath(OntapStorageConstants.DOT + OntapStorageConstants.SNAPSHOT_PATH_SEGMENT + snapshotName + + OntapStorageConstants.SLASH + relativeSourcePath); CloudStackVolume request = new CloudStackVolume(); request.setDatastoreId(String.valueOf(storagePool.getId())); diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java index 1c8fae171b67..510fea5c6c75 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java @@ -176,8 +176,7 @@ public void deleteCloudStackVolume(CloudStackVolume cloudstackVolume) { * Clones a file inside the FlexVolume using ONTAP's file clone API. * *
The source is taken from {@code file.path} and the destination from - * {@code destinationPath}, both relative to the root of the FlexVolume backing the pool. - * When {@code snapshotName} is set, the source is read from that FlexVolume snapshot.
+ * {@code destinationPath}, both relative to the root of the FlexVolume backing the pool. */ @Override public CloudStackVolume cloneCloudStackVolume(CloudStackVolume cloudstackVolume) { @@ -203,7 +202,7 @@ public CloudStackVolume cloneCloudStackVolume(CloudStackVolume cloudstackVolume) logger.info("cloneCloudStackVolume: Cloning file [{}] to [{}] in FlexVol [{}] from snapshot [{}]", sourcePath, destinationPath, flexVolName, snapshotName); try { - FileCloneRequest request = new FileCloneRequest(flexVolUuid, flexVolName, sourcePath, destinationPath, snapshotName); + FileCloneRequest request = new FileCloneRequest(flexVolUuid, flexVolName, sourcePath, destinationPath); JobResponse jobResponse = nasFeignClient.cloneFile(getAuthHeader(), request); pollJobIfPresent(jobResponse, "clone file [" + sourcePath + "] to [" + destinationPath + "]"); diff --git a/plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriverTest.java b/plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriverTest.java index 12e5ff3faced..97642c5997e8 100644 --- a/plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriverTest.java +++ b/plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriverTest.java @@ -1108,7 +1108,7 @@ void testCreateAsync_VolumeClonedFromSnapshot_NfsSuccess() { ArgumentCaptor