Skip to content

Commit 7f470fd

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
feature/CSTACKEX-122: Per host Igroup changes 2
1 parent 4781b3f commit 7f470fd

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,14 @@ private void createManagedVolumeCopyTemplateAsync(VolumeInfo volumeInfo, Primary
13371337
primaryDataStore.setDetails(details);
13381338

13391339
grantAccess(volumeInfo, destHost, primaryDataStore);
1340+
volumeInfo = volFactory.getVolume(volumeInfo.getId(), primaryDataStore);
1341+
details.put(PrimaryDataStore.MANAGED_STORE_TARGET, volumeInfo.get_iScsiName());
1342+
primaryDataStore.setDetails(details);
1343+
1344+
// Update destTemplateInfo with the iSCSI path from volumeInfo
1345+
if (destTemplateInfo instanceof TemplateObject) {
1346+
((TemplateObject)destTemplateInfo).setInstallPath(volumeInfo.getPath());
1347+
}
13401348

13411349
try {
13421350
motionSrv.copyAsync(srcTemplateInfo, destTemplateInfo, destHost, caller);

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,6 @@ public void createAsync(DataStore dataStore, DataObject dataObject, AsyncComplet
170170
volumeVO.set_iScsiName(null);
171171
volumeVO.setPath(null);
172172
createCmdResult = new CreateCmdResult(lunName, new Answer(null, true, null));
173-
174-
// // Create LUN-to-igroup mapping and retrieve the assigned LUN ID
175-
// UnifiedSANStrategy sanStrategy = (UnifiedSANStrategy) Utility.getStrategyByStoragePoolDetails(details);
176-
// String accessGroupName = Utility.getIgroupName(svmName, storagePoolUuid);
177-
// String lunNumber = sanStrategy.ensureLunMapped(svmName, lunName, accessGroupName);
178-
//
179-
// // Construct iSCSI path: /<iqn>/<lun_id> format for KVM/libvirt attachment
180-
// String iscsiPath = Constants.SLASH + storagePool.getPath() + Constants.SLASH + lunNumber;
181-
// volumeVO.set_iScsiName(iscsiPath);
182-
// volumeVO.setPath(iscsiPath);
183-
// s_logger.info("createAsync: Volume [{}] iSCSI path set to {}", volumeVO.getId(), iscsiPath);
184-
// createCmdResult = new CreateCmdResult(null, new Answer(null, true, null));
185-
186173
} else if (ProtocolType.NFS3.name().equalsIgnoreCase(details.get(Constants.PROTOCOL))) {
187174
createCmdResult = new CreateCmdResult(volInfo.getUuid(), new Answer(null, true, null));
188175
s_logger.info("createAsync: Managed NFS volume [{}] associated with pool {}",

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public DataStore initialize(Map<String, Object> dsInfos) {
120120
throw new CloudRuntimeException("Cluster Id or Pod Id is null, cannot create primary storage");
121121
}
122122

123-
if (podId == null && clusterId == null) {
123+
if (podId == null) {
124124
if (zoneId != null) {
125125
s_logger.info("Both Pod Id and Cluster Id are null, Primary storage pool will be associated with a Zone");
126126
} else {
@@ -231,7 +231,7 @@ public DataStore initialize(Map<String, Object> dsInfos) {
231231
path = Constants.SLASH + storagePoolName;
232232
port = Constants.NFS3_PORT;
233233
// Force NFSv3 for ONTAP managed storage to avoid NFSv4 ID mapping issues
234-
details.put("nfsmountopts", "vers=3");
234+
details.put(Constants.NFS_MOUNT_OPTIONS,Constants.NFS3_MOUNT_OPTIONS_VER_3);
235235
s_logger.info("Setting NFS path for storage pool: " + path + ", port: " + port + " with mount option: vers=3");
236236
break;
237237
case ISCSI:

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public class Constants {
4242
public static final String IS_DISAGGREGATED = "isDisaggregated";
4343
public static final String RUNNING = "running";
4444
public static final String EXPORT = "export";
45+
public static final String NFS_MOUNT_OPTIONS = "nfsmountopts";
46+
public static final String NFS3_MOUNT_OPTIONS_VER_3 = "vers=3";
4547

4648
public static final int ONTAP_PORT = 443;
4749

0 commit comments

Comments
 (0)