Skip to content

Commit ef4ee96

Browse files
Srivastava, PiyushSrivastava, Piyush
authored andcommitted
feature/CSTACKEX-122: Comments resolution
1 parent 5c31c78 commit ef4ee96

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,7 @@ private void createManagedVolumeCopyTemplateAsync(VolumeInfo volumeInfo, Primary
13201320
details.put(PrimaryDataStore.STORAGE_HOST, primaryDataStore.getHostAddress());
13211321
details.put(PrimaryDataStore.STORAGE_PORT, String.valueOf(primaryDataStore.getPort()));
13221322
// for managed storage, the storage repository (XenServer) or datastore (ESX) name is based off of the iScsiName property of a volume
1323-
String managedStoreTarget = volumeInfo.get_iScsiName() != null ? volumeInfo.get_iScsiName() : volumeInfo.getUuid();
1324-
details.put(PrimaryDataStore.MANAGED_STORE_TARGET, managedStoreTarget);
1323+
details.put(PrimaryDataStore.MANAGED_STORE_TARGET, volumeInfo.get_iScsiName());
13251324
details.put(PrimaryDataStore.MANAGED_STORE_TARGET_ROOT_VOLUME, volumeInfo.getName());
13261325
details.put(PrimaryDataStore.VOLUME_SIZE, String.valueOf(volumeInfo.getSize()));
13271326
details.put(StorageManager.STORAGE_POOL_DISK_WAIT.toString(), String.valueOf(StorageManager.STORAGE_POOL_DISK_WAIT.valueIn(primaryDataStore.getId())));
@@ -1339,10 +1338,10 @@ private void createManagedVolumeCopyTemplateAsync(VolumeInfo volumeInfo, Primary
13391338

13401339
grantAccess(volumeInfo, destHost, primaryDataStore);
13411340
volumeInfo = volFactory.getVolume(volumeInfo.getId(), primaryDataStore);
1342-
managedStoreTarget = volumeInfo.get_iScsiName() != null ? volumeInfo.get_iScsiName() : volumeInfo.getUuid();
1341+
// For Netapp ONTAP iscsiName or Lun path is available only after grantAccess
1342+
String managedStoreTarget = volumeInfo.get_iScsiName() != null ? volumeInfo.get_iScsiName() : volumeInfo.getUuid();
13431343
details.put(PrimaryDataStore.MANAGED_STORE_TARGET, managedStoreTarget);
13441344
primaryDataStore.setDetails(details);
1345-
13461345
// Update destTemplateInfo with the iSCSI path from volumeInfo
13471346
if (destTemplateInfo instanceof TemplateObject) {
13481347
((TemplateObject)destTemplateInfo).setInstallPath(volumeInfo.getPath());

plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriverTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ void testRevokeAccess_NFSVolume_SkipsRevoke() {
448448
when(storagePoolDao.findById(1L)).thenReturn(storagePool);
449449
when(storagePool.getId()).thenReturn(1L);
450450
when(storagePool.getScope()).thenReturn(ScopeType.CLUSTER);
451-
when(storagePool.getUuid()).thenReturn("pool-uuid-123");
452451
when(storagePoolDetailsDao.listDetailsKeyPairs(1L)).thenReturn(storagePoolDetails);
453452
when(host.getName()).thenReturn("host1");
454453

@@ -478,7 +477,6 @@ void testRevokeAccess_ISCSIVolume_Success() {
478477
when(storagePoolDao.findById(1L)).thenReturn(storagePool);
479478
when(storagePool.getId()).thenReturn(1L);
480479
when(storagePool.getScope()).thenReturn(ScopeType.CLUSTER);
481-
when(storagePool.getUuid()).thenReturn("pool-uuid-123");
482480
when(storagePoolDetailsDao.listDetailsKeyPairs(1L)).thenReturn(storagePoolDetails);
483481

484482
when(host.getStorageUrl()).thenReturn("iqn.1993-08.org.debian:01:host1");

0 commit comments

Comments
 (0)