You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ko...@apache.org on 2013/07/15 11:58:00 UTC

git commit: updated refs/heads/master to 396a13d

Updated Branches:
  refs/heads/master 47acf671d -> 396a13dd0


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.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/396a13dd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/396a13dd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/396a13dd

Branch: refs/heads/master
Commit: 396a13dd0b6483eb7a5715dc8efe04eada18b53b
Parents: 47acf67
Author: Koushik Das <ko...@citrix.com>
Authored: Mon Jul 15 15:20:28 2013 +0530
Committer: Koushik Das <ko...@citrix.com>
Committed: Mon Jul 15 15:20:28 2013 +0530

----------------------------------------------------------------------
 .../apache/cloudstack/storage/datastore/db/StoragePoolVO.java    | 4 ++--
 .../storage/volume/datastore/PrimaryDataStoreHelper.java         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/396a13dd/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
index a8c1e7f..941b952 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
@@ -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) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/396a13dd/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java b/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
index 53ead0b..4ea4cee 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/volume/datastore/PrimaryDataStoreHelper.java
@@ -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);