mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	bug 9452: listCapacity - when the hosts > 200 the host_id and storage_pool_id start colliding, to workaround that also compart the capacity type.
This commit is contained in:
		
							parent
							
								
									52bbc5127a
								
							
						
					
					
						commit
						fb6a44d248
					
				@ -1713,10 +1713,14 @@ public class ApiResponseHelper implements ResponseGenerator {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        // collect all the capacity types, sum allocated/used and sum total...get one capacity number for each
 | 
					        // collect all the capacity types, sum allocated/used and sum total...get one capacity number for each
 | 
				
			||||||
        for (Capacity capacity : hostCapacities) {
 | 
					        for (Capacity capacity : hostCapacities) {
 | 
				
			||||||
            if (poolIdsToIgnore.contains(capacity.getHostOrPoolId())) {
 | 
					            short capacityType = capacity.getCapacityType();
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            //If local storage then ignore
 | 
				
			||||||
 | 
					            if ( (capacityType == Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED || capacityType == Capacity.CAPACITY_TYPE_STORAGE) 
 | 
				
			||||||
 | 
					            		&& poolIdsToIgnore.contains(capacity.getHostOrPoolId())) {
 | 
				
			||||||
                continue;
 | 
					                continue;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            short capacityType = capacity.getCapacityType();
 | 
					            
 | 
				
			||||||
            String key = capacity.getCapacityType() + "_" + capacity.getDataCenterId();
 | 
					            String key = capacity.getCapacityType() + "_" + capacity.getDataCenterId();
 | 
				
			||||||
            String keyForPodTotal = key + "_-1";
 | 
					            String keyForPodTotal = key + "_-1";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user