sureshanaparti commented on a change in pull request #4640:
URL: https://github.com/apache/cloudstack/pull/4640#discussion_r664228043



##########
File path: 
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/datastore/provider/DefaultHostListener.java
##########
@@ -100,9 +110,48 @@ public boolean hostConnect(long hostId, long poolId) 
throws StorageConflictExcep
         updateStoragePoolHostVOAndDetails(poolVO, hostId, mspAnswer);
 
         if (pool.getPoolType() == Storage.StoragePoolType.DatastoreCluster) {
+            for (ModifyStoragePoolAnswer childDataStoreAnswer : 
((ModifyStoragePoolAnswer) answer).getDatastoreClusterChildren()) {
+                StoragePoolInfo childStoragePoolInfo = 
childDataStoreAnswer.getPoolInfo();
+                StoragePoolVO dataStoreVO = 
primaryStoreDao.findPoolByUUID(childStoragePoolInfo.getUuid());
+                if (dataStoreVO != null) {
+                    continue;
+                }
+                dataStoreVO = new StoragePoolVO();
+                
dataStoreVO.setStorageProviderName(poolVO.getStorageProviderName());
+                dataStoreVO.setHostAddress(childStoragePoolInfo.getHost());
+                dataStoreVO.setPoolType(Storage.StoragePoolType.PreSetup);
+                dataStoreVO.setPath(childStoragePoolInfo.getHostPath());
+                dataStoreVO.setPort(poolVO.getPort());
+                dataStoreVO.setName(childStoragePoolInfo.getName());
+                dataStoreVO.setUuid(childStoragePoolInfo.getUuid());
+                dataStoreVO.setDataCenterId(poolVO.getDataCenterId());
+                dataStoreVO.setPodId(poolVO.getPodId());
+                dataStoreVO.setClusterId(poolVO.getClusterId());
+                dataStoreVO.setStatus(StoragePoolStatus.Up);
+                dataStoreVO.setUserInfo(poolVO.getUserInfo());
+                dataStoreVO.setManaged(poolVO.isManaged());
+                dataStoreVO.setCapacityIops(poolVO.getCapacityIops());
+                
dataStoreVO.setCapacityBytes(childDataStoreAnswer.getPoolInfo().getCapacityBytes());
+                
dataStoreVO.setUsedBytes(childDataStoreAnswer.getPoolInfo().getCapacityBytes() 
- childDataStoreAnswer.getPoolInfo().getAvailableBytes());
+                dataStoreVO.setHypervisor(poolVO.getHypervisor());
+                dataStoreVO.setScope(poolVO.getScope());
+                dataStoreVO.setParent(poolVO.getId());

Review comment:
       @Spaceman1984 it seems the changes here are not part of this PR, these 
might be related to datastore cluster storage support. Can you please check and 
resolve ? cc @harikrishna-patnala 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to