cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: updated refs/heads/master to ed1f3d9
Date Thu, 05 Dec 2013 23:37:08 GMT
Updated Branches:
  refs/heads/master 98ee087d3 -> ed1f3d9ed


CLOUDSTACK-5391:
check for host cpu capability while stop starting a vm on the same host. Also changed the
FirstFitAllocator to use the same method.


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

Branch: refs/heads/master
Commit: ed1f3d9ed67cf805e14821d91fc6e612bd232555
Parents: 98ee087
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Thu Dec 5 15:37:01 2013 -0800
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Thu Dec 5 15:37:01 2013 -0800

----------------------------------------------------------------------
 .../agent/manager/allocator/impl/FirstFitAllocator.java  | 11 ++++-------
 .../com/cloud/deploy/DeploymentPlanningManagerImpl.java  |  3 ++-
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed1f3d9e/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
index 7150317..0bfe192 100755
--- a/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
+++ b/server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
@@ -286,8 +286,6 @@ public class FirstFitAllocator extends AdapterBase implements HostAllocator
{
                 continue;
             }
 
-            boolean numCpusGood = host.getCpus().intValue() >= offering.getCpu();
-            boolean cpuFreqGood = host.getSpeed().intValue() >= offering.getSpeed();
             int cpu_requested = offering.getCpu() * offering.getSpeed();
             long ram_requested = offering.getRamSize() * 1024L * 1024L;
             Cluster cluster = _clusterDao.findById(host.getClusterId());
@@ -296,19 +294,18 @@ public class FirstFitAllocator extends AdapterBase implements HostAllocator
{
             Float cpuOvercommitRatio = Float.parseFloat(clusterDetailsCpuOvercommit.getValue());
             Float memoryOvercommitRatio = Float.parseFloat(clusterDetailsRamOvercommmt.getValue());
 
-            boolean hostHasCapacity =
-                _capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested, ram_requested,
false, cpuOvercommitRatio, memoryOvercommitRatio,
+            boolean hostHasCpuCapability = _capacityMgr.checkIfHostHasCpuCapability(host.getId(),
offering.getCpu(), offering.getSpeed());
+            boolean hostHasCapacity = _capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested,
ram_requested, false, cpuOvercommitRatio, memoryOvercommitRatio,
                     considerReservedCapacity);
 
-            if (numCpusGood && cpuFreqGood && hostHasCapacity) {
+            if (hostHasCpuCapability && hostHasCapacity) {
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("Found a suitable host, adding to list: " + host.getId());
                 }
                 suitableHosts.add(host);
             } else {
                 if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Not using host " + host.getId() + "; numCpusGood: " +
numCpusGood + "; cpuFreqGood: " + cpuFreqGood + ", host has capacity?" +
-                        hostHasCapacity);
+                    s_logger.debug("Not using host " + host.getId() + "; host has cpu capability?
" + hostHasCpuCapability +  ", host has capacity?" + hostHasCapacity);
                 }
                 avoid.addHost(host.getId());
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ed1f3d9e/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index 8fad78c..471225f 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -361,7 +361,8 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
                     ClusterDetailsVO cluster_detail_ram = _clusterDetailsDao.findDetail(cluster_id,
"memoryOvercommitRatio");
                     Float cpuOvercommitRatio = Float.parseFloat(cluster_detail_cpu.getValue());
                     Float memoryOvercommitRatio = Float.parseFloat(cluster_detail_ram.getValue());
-                    if (_capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested,
ram_requested, true, cpuOvercommitRatio, memoryOvercommitRatio, true)) {
+                    if (_capacityMgr.checkIfHostHasCapacity(host.getId(), cpu_requested,
ram_requested, true, cpuOvercommitRatio, memoryOvercommitRatio, true)
+                            && _capacityMgr.checkIfHostHasCpuCapability(host.getId(),
offering.getCpu(), offering.getSpeed())) {
                         s_logger.debug("The last host of this VM is UP and has enough capacity");
                         s_logger.debug("Now checking for suitable pools under zone: " + host.getDataCenterId()
+ ", pod: " + host.getPodId() + ", cluster: " +
                             host.getClusterId());


Mime
View raw message