cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 1077f86
Date Sat, 05 Sep 2015 07:14:03 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 5881035e7 -> 1077f8614


CLOUDSTACK-8678: Reserve RAM for KVM host OS

Use host.reserved.ram.mb agent property to modify total system RAM
before reporting to management server.

Remove dom0ram variable and its min/max calculation. Just reserve a
default of 1GB, unless overridden by host.reserved.mem.mb property.


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

Branch: refs/heads/master
Commit: 99d20234d472b56d1780978317c1352d189e780b
Parents: dd9ba48
Author: Kevin McCormick <kevin.mccormick@intrinium.com>
Authored: Mon Aug 31 11:11:17 2015 -0700
Committer: Kevin McCormick <kevin.mccormick@intrinium.com>
Committed: Thu Sep 3 10:07:22 2015 -0700

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java      | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99d20234/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
old mode 100644
new mode 100755
index 343e45c..bc57c2c
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -263,7 +263,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
 
     private String _updateHostPasswdPath;
 
-    private int _dom0MinMem;
+    private long _dom0MinMem;
 
     protected boolean _disconnected = true;
     protected int _cmdsTimeout;
@@ -791,7 +791,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         _videoRam = NumbersUtil.parseInt(value, 0);
 
         value = (String)params.get("host.reserved.mem.mb");
-        _dom0MinMem = NumbersUtil.parseInt(value, 0) * 1024 * 1024;
+        // Reserve 1GB unless admin overrides
+        _dom0MinMem = NumbersUtil.parseInt(value, 1024) * 1024 * 1024L;
 
         value = (String) params.get("kvmclock.disable");
         if (Boolean.parseBoolean(value)) {
@@ -2605,16 +2606,13 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
 
         info.add((int)cpus);
         info.add(speed);
+        // Report system's RAM as actual RAM minus host OS reserved RAM
+        ram = ram - _dom0MinMem;
         info.add(ram);
         info.add(cap);
-        long dom0ram = Math.min(ram / 10, 768 * 1024 * 1024L);// save a maximum
-        // of 10% of
-        // system ram or
-        // 768M
-        dom0ram = Math.max(dom0ram, _dom0MinMem);
-        info.add(dom0ram);
+        info.add(_dom0MinMem);
         info.add(cpuSockets);
-        s_logger.debug("cpus=" + cpus + ", speed=" + speed + ", ram=" + ram + ", dom0ram="
+ dom0ram + ", cpu sockets=" + cpuSockets);
+        s_logger.debug("cpus=" + cpus + ", speed=" + speed + ", ram=" + ram + ", _dom0MinMem="
+ _dom0MinMem + ", cpu sockets=" + cpuSockets);
 
         return info;
     }


Mime
View raw message