Github user koteswararavipati commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/865#discussion_r94215553
  
    --- Diff: server/src/com/cloud/server/ManagementServerImpl.java ---
    @@ -2488,6 +2479,23 @@ public int compare(final SummedCapacity arg0, final 
SummedCapacity arg1) {
                         final SummedCapacity summedCapacity = new 
SummedCapacity(capacity.getUsedCapacity(), capacity.getTotalCapacity(), 
capacity.getUsedPercentage(),
                                 capacity.getCapacityType(), 
capacity.getDataCenterId(), capacity.getPodId(), capacity.getClusterId());
                         list.add(summedCapacity);
    +                }
    +            } else {
    +                List<DataCenterVO> dcList = _dcDao.listEnabledZones();
    +                for (DataCenterVO dc : dcList) {
    +                    List<CapacityVO> capacities=new 
ArrayList<CapacityVO>();
    +                    
capacities.add(_storageMgr.getSecondaryStorageUsedStats(null, dc.getId()));
    +                    
capacities.add(_storageMgr.getStoragePoolUsedStats(null, null, null, 
dc.getId()));
    +                    for (CapacityVO capacity : capacities) {
    +                        if (capacity.getTotalCapacity() != 0) {
    +                            
capacity.setUsedPercentage((float)capacity.getUsedCapacity() / 
capacity.getTotalCapacity());
    +                        } else {
    +                            capacity.setUsedPercentage(0);
    +                        }
    +                        SummedCapacity summedCapacity = new 
SummedCapacity(capacity.getUsedCapacity(), capacity.getTotalCapacity(), 
capacity.getUsedPercentage(),
    +                                capacity.getCapacityType(), 
capacity.getDataCenterId(), capacity.getPodId(), capacity.getClusterId());
    +                        list.add(summedCapacity);
    +                    }
                     }// End of for
    --- End diff --
    
    I test this issue manually and looks good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to