Skip to content

Commit 1f449a4

Browse files
CSTACKEX-198: Lun path needs to be in a pattern
1 parent 47f5aae commit 1f449a4

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,10 @@ public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCm
694694
if (lunUuid == null) {
695695
throw new CloudRuntimeException("LUN UUID not found for iSCSI volume " + volumeVO.getId());
696696
}
697+
String cloneLunPath = OntapStorageUtils.getLunName(
698+
poolDetails.get(OntapStorageConstants.VOLUME_NAME), cloneName);
697699
Lun cloneRequest = new Lun();
698-
cloneRequest.setName(cloneName);
700+
cloneRequest.setName(cloneLunPath);
699701
Svm svm = new Svm();
700702
svm.setName(poolDetails.get(OntapStorageConstants.SVM_NAME));
701703
cloneRequest.setSvm(svm);
@@ -727,8 +729,10 @@ public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCm
727729
}
728730

729731
if (ProtocolType.ISCSI.name().equalsIgnoreCase(protocol)) {
732+
String cloneLunPath = OntapStorageUtils.getLunName(
733+
poolDetails.get(OntapStorageConstants.VOLUME_NAME), cloneName);
730734
cloneId = resolveLunUuidByName(storageStrategy, authHeader,
731-
poolDetails.get(OntapStorageConstants.SVM_NAME), cloneName);
735+
poolDetails.get(OntapStorageConstants.SVM_NAME), cloneLunPath);
732736
}
733737

734738
snapshotObjectTo.setPath(OntapStorageConstants.ONTAP_CLONE_NAME + "=" + cloneName);

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/vmsnapshot/OntapVMSnapshotStrategy.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,10 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) {
409409
if (sourceLunUuid == null || sourceLunUuid.isEmpty()) {
410410
throw new CloudRuntimeException("Source LUN UUID missing for volume " + volumeId);
411411
}
412+
String cloneLunPath = OntapStorageUtils.getLunName(
413+
groupInfo.poolDetails.get(OntapStorageConstants.VOLUME_NAME), cloneName);
412414
org.apache.cloudstack.storage.feign.model.Lun cloneRequest = new org.apache.cloudstack.storage.feign.model.Lun();
413-
cloneRequest.setName(cloneName);
415+
cloneRequest.setName(cloneLunPath);
414416
org.apache.cloudstack.storage.feign.model.Svm svm = new org.apache.cloudstack.storage.feign.model.Svm();
415417
svm.setName(groupInfo.poolDetails.get(OntapStorageConstants.SVM_NAME));
416418
cloneRequest.setSvm(svm);
@@ -426,7 +428,8 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) {
426428
cloneRequest.setClone(clone);
427429
cloneRequest.setIsOverride(Boolean.FALSE);
428430
jobResponse = storageStrategy.getSanFeignClient().cloneLun(authHeader, cloneRequest);
429-
cloneUuid = resolveLunUuid(storageStrategy, authHeader, groupInfo.poolDetails.get(OntapStorageConstants.SVM_NAME), cloneName);
431+
cloneUuid = resolveLunUuid(storageStrategy, authHeader,
432+
groupInfo.poolDetails.get(OntapStorageConstants.SVM_NAME), cloneLunPath);
430433
} else {
431434
throw new CloudRuntimeException("Unsupported protocol for VM snapshot clone: " + protocol);
432435
}

0 commit comments

Comments
 (0)