File tree Expand file tree Collapse file tree
server/src/com/cloud/api/query/dao Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import javax .ejb .Local ;
2323import javax .inject .Inject ;
2424
25+ import com .cloud .capacity .Capacity ;
2526import org .apache .cloudstack .api .response .StoragePoolResponse ;
27+ import org .apache .cloudstack .engine .subsystem .api .storage .ScopeType ;
2628import org .apache .log4j .Logger ;
2729import org .springframework .stereotype .Component ;
2830
@@ -150,7 +152,8 @@ public StoragePoolResponse newStoragePoolForMigrationResponse(StoragePoolJoinVO
150152 }
151153
152154
153- long allocatedSize = pool .getUsedCapacity () + pool .getReservedCapacity ();
155+ short capacityType = pool .getScope () == ScopeType .HOST ? Capacity .CAPACITY_TYPE_LOCAL_STORAGE : Capacity .CAPACITY_TYPE_STORAGE_ALLOCATED ;
156+ long allocatedSize = ApiDBUtils .getStorageCapacitybyPool (pool .getId (), capacityType );
154157 poolResponse .setDiskSizeTotal (pool .getCapacityBytes ());
155158 poolResponse .setDiskSizeAllocated (allocatedSize );
156159
You can’t perform that action at this time.
0 commit comments