@@ -415,6 +415,20 @@ private boolean validateProtocolSupportAndFetchHostsIdentifier(List<HostVO> host
415415 hostIdentifiers .add (host .getStorageUrl ());
416416 }
417417 break ;
418+ case NFS3 :
419+ String ip = "" ;
420+ for (HostVO host : hosts ) {
421+ if (host != null ) {
422+ ip = host .getStorageIpAddress () != null ? host .getStorageIpAddress ().trim () : "" ;
423+ if (ip .isEmpty () && host .getPrivateIpAddress () != null || host .getPrivateIpAddress ().trim ().isEmpty ()) {
424+ return false ;
425+ } else {
426+ ip = ip .isEmpty () ? host .getPrivateIpAddress ().trim () : ip ;
427+ }
428+ }
429+ hostIdentifiers .add (ip );
430+ }
431+ break ;
418432 default :
419433 throw new CloudRuntimeException ("validateProtocolSupportAndFetchHostsIdentifier : Unsupported protocol: " + protocolType .name ());
420434 }
@@ -471,15 +485,6 @@ public boolean deleteDataStore(DataStore store) {
471485 PrimaryDataStoreInfo primaryDataStoreInfo = (PrimaryDataStoreInfo ) store ;
472486 primaryDataStoreInfo .setDetails (details );
473487
474- // Create AccessGroup object with PrimaryDataStoreInfo
475- AccessGroup accessGroup = new AccessGroup ();
476- accessGroup .setPrimaryDataStoreInfo (primaryDataStoreInfo );
477-
478- // Call deleteAccessGroup - it will figure out scope, protocol, and all details internally
479- storageStrategy .deleteAccessGroup (accessGroup );
480-
481- s_logger .info ("deleteDataStore: Successfully deleted access groups for storage pool '{}'" , storagePool .getName ());
482-
483488 // Call deleteStorageVolume to delete the underlying ONTAP volume
484489 s_logger .info ("deleteDataStore: Deleting ONTAP volume for storage pool '{}'" , storagePool .getName ());
485490 Volume volume = new Volume ();
@@ -497,6 +502,11 @@ public boolean deleteDataStore(DataStore store) {
497502 s_logger .error ("deleteDataStore: Exception while retrieving volume UUID for storage pool id: {}. Error: {}" ,
498503 storagePoolId , e .getMessage (), e );
499504 }
505+ AccessGroup accessGroup = new AccessGroup ();
506+ accessGroup .setPrimaryDataStoreInfo (primaryDataStoreInfo );
507+ // Delete access groups associated with this storage pool
508+ storageStrategy .deleteAccessGroup (accessGroup );
509+ s_logger .info ("deleteDataStore: Successfully deleted access groups for storage pool '{}'" , storagePool .getName ());
500510
501511 } catch (Exception e ) {
502512 s_logger .error ("deleteDataStore: Failed to delete access groups for storage pool id: {}. Error: {}" ,
0 commit comments