Prevent double counting storage pools (#5398)

* Prevent double counting storage pools

Currenly, getStoragePoolUsedStats fetch all pools
undepended if a pool have a parent. Therefore as soon
as a datastore cluster is used, the cluster and the storages it contains are calculated together
The change fetch all storages without cluster and all datastore cluster

* Update server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

Co-authored-by: DK101010 <dirk.klahre@itelligence.de>
Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
DK101010 2021-09-10 13:57:35 +02:00 committed by GitHub
parent f6073052aa
commit dc17cf4f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -2080,6 +2080,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
if (poolId != null) {
sc.addAnd("hostOrPoolId", SearchCriteria.Op.EQ, poolId);
}
sc.addAnd("parent", SearchCriteria.Op.EQ, 0L);
if (poolId != null) {
pools.add(_storagePoolDao.findById(poolId));
} else {