|
36 | 36 | import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; |
37 | 37 | import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; |
38 | 38 | import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities; |
| 39 | +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore; |
39 | 40 | import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; |
40 | 41 | import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; |
41 | 42 | import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo; |
|
45 | 46 | import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; |
46 | 47 | import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao; |
47 | 48 | import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; |
| 49 | +import org.apache.cloudstack.storage.to.PrimaryDataStoreTO; |
48 | 50 | import org.apache.cloudstack.storage.feign.model.OntapStorage; |
49 | 51 | import org.apache.cloudstack.storage.provider.StorageProviderFactory; |
50 | 52 | import org.apache.cloudstack.storage.service.StorageStrategy; |
@@ -84,7 +86,30 @@ public DataTO getTO(DataObject data) { |
84 | 86 |
|
85 | 87 | @Override |
86 | 88 | public DataStoreTO getStoreTO(DataStore store) { |
87 | | - return null; |
| 89 | + // Load storage pool details from database (includes "mountpoint" added during pool creation) |
| 90 | + Map<String, String> poolDetails = storagePoolDetailsDao.listDetailsKeyPairs(store.getId()); |
| 91 | + |
| 92 | + // Set details on the store before creating PrimaryDataStoreTO |
| 93 | + // This ensures PrimaryDataStoreTO constructor gets the details from database |
| 94 | + PrimaryDataStore primaryStore = (PrimaryDataStore) store; |
| 95 | + if (poolDetails != null && !poolDetails.isEmpty()) { |
| 96 | + // Merge existing details (if any) with database details |
| 97 | + Map<String, String> existingDetails = primaryStore.getDetails(); |
| 98 | + if (existingDetails == null) { |
| 99 | + primaryStore.setDetails(poolDetails); |
| 100 | + } else { |
| 101 | + // Merge: database details take precedence |
| 102 | + Map<String, String> mergedDetails = new HashMap<>(existingDetails); |
| 103 | + mergedDetails.putAll(poolDetails); |
| 104 | + primaryStore.setDetails(mergedDetails); |
| 105 | + } |
| 106 | + } |
| 107 | + |
| 108 | + // Now create PrimaryDataStoreTO - it will get details from primaryStore.getDetails() |
| 109 | + PrimaryDataStoreTO storeTO = new PrimaryDataStoreTO(primaryStore); |
| 110 | + |
| 111 | + s_logger.debug("OntapPrimaryDatastoreDriver: getStoreTO: Created PrimaryDataStoreTO with details from storage_pool_details table"); |
| 112 | + return storeTO; |
88 | 113 | } |
89 | 114 |
|
90 | 115 | @Override |
|
0 commit comments