From f352bb17bfe2d3a585e5283145c441491c2bcbab Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Fri, 31 Aug 2012 15:20:00 +0530 Subject: [PATCH] CS-15158: Correcting the allocated size for local storage in listStoragePools Reviewed-by: Kishan --- server/src/com/cloud/api/ApiResponseHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 74d1711b260..19b41c4373d 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1240,7 +1240,8 @@ public class ApiResponseHelper implements ResponseGenerator { } StorageStats stats = ApiDBUtils.getStoragePoolStatistics(pool.getId()); - long allocatedSize = ApiDBUtils.getStorageCapacitybyPool(pool.getId(), Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED); + short capacityType = pool.isShared() ? Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED : Capacity.CAPACITY_TYPE_LOCAL_STORAGE; + long allocatedSize = ApiDBUtils.getStorageCapacitybyPool(pool.getId(), capacityType); poolResponse.setDiskSizeTotal(pool.getCapacityBytes()); poolResponse.setDiskSizeAllocated(allocatedSize);