From 65b0af0a9debfb7eb5aced2c1b18222ad7f52fe9 Mon Sep 17 00:00:00 2001 From: Nitin Date: Fri, 22 Jul 2011 19:14:47 +0530 Subject: [PATCH] bug 9452: listCapacity - when the hosts > 200 the host_id and storage_pool_id start colliding, to workaround that also compart the capacity type. --- server/src/com/cloud/api/ApiResponseHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 7166ac2bab4..fbc57cd3b8f 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1674,10 +1674,14 @@ public class ApiResponseHelper implements ResponseGenerator { // collect all the capacity types, sum allocated/used and sum total...get one capacity number for each 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; } - short capacityType = capacity.getCapacityType(); + String key = capacity.getCapacityType() + "_" + capacity.getDataCenterId(); String keyForPodTotal = key + "_-1";