mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	CLOUDSTACK-2946
CS-15158: Correcting the allocated size for local storage in listStoragePools
This commit is contained in:
		
							parent
							
								
									215b638e8e
								
							
						
					
					
						commit
						83fcba9ee6
					
				| @ -22,7 +22,9 @@ import java.util.List; | |||||||
| import javax.ejb.Local; | import javax.ejb.Local; | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
|  | import com.cloud.capacity.Capacity; | ||||||
| import org.apache.cloudstack.api.response.StoragePoolResponse; | import org.apache.cloudstack.api.response.StoragePoolResponse; | ||||||
|  | import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType; | ||||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||||
| 
 | 
 | ||||||
| @ -150,7 +152,8 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         long allocatedSize = pool.getUsedCapacity() +  pool.getReservedCapacity(); |         short capacityType = pool.getScope() == ScopeType.HOST ? Capacity.CAPACITY_TYPE_LOCAL_STORAGE : Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED; | ||||||
|  |         long allocatedSize = ApiDBUtils.getStorageCapacitybyPool(pool.getId(), capacityType); | ||||||
|         poolResponse.setDiskSizeTotal(pool.getCapacityBytes()); |         poolResponse.setDiskSizeTotal(pool.getCapacityBytes()); | ||||||
|         poolResponse.setDiskSizeAllocated(allocatedSize); |         poolResponse.setDiskSizeAllocated(allocatedSize); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user