Skip to content

Commit a9483c9

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
CSTACKEX-16 Map Cloned Lun
1 parent 7aefcec commit a9483c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public Map<String, String> getCapabilities() {
9696
// RAW managed initial implementation: snapshot features not yet supported
9797
// TODO Set it to false once we start supporting snapshot feature
9898
mapCapabilities.put(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString(), Boolean.TRUE.toString());
99-
mapCapabilities.put(DataStoreCapabilities.CAN_CREATE_VOLUME_FROM_SNAPSHOT.toString(), Boolean.TRUE.toString());
99+
//mapCapabilities.put(DataStoreCapabilities.CAN_CREATE_VOLUME_FROM_SNAPSHOT.toString(), Boolean.TRUE.toString());
100100
return mapCapabilities;
101101
}
102102

@@ -681,7 +681,11 @@ public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCm
681681
SnapshotObjectTO snapshotObjectTo = (SnapshotObjectTO)snapshot.getTO();
682682
CloudStackVolume snapshotCloudStackVolumeRequest = snapshotCloudStackVolumeRequestByProtocol(poolDetails, storagePool, cloudStackVolume, snapshot);
683683
CloudStackVolume clonedCloudStackVolume = storageStrategy.copyCloudStackVolume(snapshotCloudStackVolumeRequest);
684+
UnifiedSANStrategy sanStrategy = (UnifiedSANStrategy) Utility.getStrategyByStoragePoolDetails(poolDetails);
685+
String accessGroupName = Utility.getIgroupName(poolDetails.get(Constants.SVM_NAME), storagePool.getUuid());
684686

687+
// Map the snapshot's cloned LUN to the igroup
688+
sanStrategy.ensureLunMapped(poolDetails.get(Constants.SVM_NAME), clonedCloudStackVolume.getLun().getName(), accessGroupName);
685689
if (ProtocolType.ISCSI.name().equalsIgnoreCase(poolDetails.get(Constants.PROTOCOL))) {
686690
snapshotObjectTo.setPath(clonedCloudStackVolume.getLun().getName());
687691
snapshotId = clonedCloudStackVolume.getLun().getUuid();

0 commit comments

Comments
 (0)