CLOUDSTACK-3445: Observing the system alerts "unallocated Local Storage is low in cluster" when Primary storage is Local Storage

Available bytes was getting stored in the used bytes property of local storage pools. As a result of this, for newly added local pools Cloudstack thinks that there is no space available and generated alerts.
This commit is contained in:
Koushik Das 2013-07-15 15:20:28 +05:30
parent 47acf671d5
commit 396a13dd0b
2 changed files with 3 additions and 3 deletions

View File

@ -203,8 +203,8 @@ public class StoragePoolVO implements StoragePool {
return capacityBytes;
}
public void setUsedBytes(long available) {
usedBytes = available;
public void setUsedBytes(long usedBytes) {
this.usedBytes = usedBytes;
}
public void setCapacityBytes(long capacityBytes) {

View File

@ -113,7 +113,7 @@ public class PrimaryDataStoreHelper {
StoragePoolVO pool = this.dataStoreDao.findById(store.getId());
pool.setScope(scope.getScopeType());
pool.setUsedBytes(existingInfo.getAvailableBytes());
pool.setUsedBytes(existingInfo.getCapacityBytes() - existingInfo.getAvailableBytes());
pool.setCapacityBytes(existingInfo.getCapacityBytes());
pool.setStatus(StoragePoolStatus.Up);
this.dataStoreDao.update(pool.getId(), pool);