cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject git commit: refs/heads/4.1 - CLOUDSTACK-1761 - Available local storage disk capacity incorrectly reported in KVM to manager. This adds collection of available storage to KVM, not just used.
Date Fri, 22 Mar 2013 15:38:53 GMT
Updated Branches:
  refs/heads/4.1 6a7c41c70 -> fc121c2b8


CLOUDSTACK-1761 - Available local storage disk capacity incorrectly reported in
     KVM to manager. This adds collection of available storage to KVM, not
     just used.

Bugfix-for: 4.0.2, 4.1, master
Submitted-by: Ted Smith <darnoth@gmail.com>
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1363966235 -0600


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

Branch: refs/heads/4.1
Commit: fc121c2b81433ffdf68c537633dc2d03f5ceb2c9
Parents: 6a7c41c
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Fri Mar 22 09:30:35 2013 -0600
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Fri Mar 22 15:35:17 2013 +0000

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java     |    2 +-
 .../hypervisor/kvm/storage/KVMStoragePool.java     |    2 ++
 .../kvm/storage/LibvirtStorageAdaptor.java         |    2 ++
 .../hypervisor/kvm/storage/LibvirtStoragePool.java |   10 ++++++++++
 4 files changed, 15 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc121c2b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 8e8da9a..58abdc5 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -3475,7 +3475,7 @@ ServerResource {
                     localStoragePool.getUuid(), cmd.getPrivateIpAddress(),
                     _localStoragePath, _localStoragePath,
                     StoragePoolType.Filesystem, localStoragePool.getCapacity(),
-                    localStoragePool.getUsed());
+                    localStoragePool.getAvailable());
 
             sscmd = new StartupStorageCommand();
             sscmd.setPoolInfo(pi);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc121c2b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
index 5437e7c..d32a6fd 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java
@@ -39,6 +39,8 @@ public interface KVMStoragePool {
 
     public long getUsed();
 
+    public long getAvailable();
+
     public boolean refresh();
 
     public boolean isExternalSnapshot();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc121c2b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index d87c55c..52402f6 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -403,6 +403,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
             pool.refresh();
             pool.setCapacity(storage.getInfo().capacity);
             pool.setUsed(storage.getInfo().allocation);
+            pool.setAvailable(storage.getInfo().available);
 
             return pool;
         } catch (LibvirtException e) {
@@ -535,6 +536,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
 
             pool.setCapacity(sp.getInfo().capacity);
             pool.setUsed(sp.getInfo().allocation);
+            pool.setAvailable(sp.getInfo().available);
   
             return pool;
         } catch (LibvirtException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc121c2b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
index 32f8ce9..1396097 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
@@ -28,6 +28,7 @@ public class LibvirtStoragePool implements KVMStoragePool {
     protected String uri;
     protected long capacity;
     protected long used;
+    protected long available;
     protected String name;
     protected String localPath;
     protected PhysicalDiskFormat defaultFormat;
@@ -48,6 +49,7 @@ public class LibvirtStoragePool implements KVMStoragePool {
         this._storageAdaptor = adaptor;
         this.capacity = 0;
         this.used = 0;
+        this.available = 0;
         this._pool = pool;
 
     }
@@ -65,11 +67,19 @@ public class LibvirtStoragePool implements KVMStoragePool {
         this.used = used;
     }
 
+    public void setAvailable(long available) {
+        this.available = available;
+    }
+
     @Override
     public long getUsed() {
         return this.used;
     }
 
+    public long getAvailable() {
+        return this.available;
+    }
+
     public StoragePoolType getStoragePoolType() {
         return this.type;
     }


Mime
View raw message