From c4257acc41e00e63c9c6bac38c9b141c23a228ae Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Wed, 22 Aug 2012 17:36:19 +0530 Subject: [PATCH] CS-16118 : LoadTest - Average VM deployment time is still very high compared to 2.2.14. It is more than double the time it took during 2.2.14. Skipping threshold checks for cpu/memory in case the threshold values for cluster.cpu/memory.allocated.capacity.disablethreshold is set to 1. Reviewed-by: Nitin --- .../src/com/cloud/deploy/FirstFitPlanner.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java index 8133f4be763..85acb056fca 100755 --- a/server/src/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/com/cloud/deploy/FirstFitPlanner.java @@ -464,16 +464,18 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner { if (clusterListForVmAllocation == null || clusterListForVmAllocation.size() == 0){ return; } - - if (capacity == Capacity.CAPACITY_TYPE_CPU){ - clustersCrossingThreshold = _capacityDao.listClustersCrossingThreshold(Capacity.CAPACITY_TYPE_CPU, plan.getDataCenterId(), - capacityThresholdMap.get(capacity), cpu_requested, ApiDBUtils.getCpuOverprovisioningFactor()); - }else{ - clustersCrossingThreshold = _capacityDao.listClustersCrossingThreshold(capacity, plan.getDataCenterId(), - capacityThresholdMap.get(capacity), ram_requested, 1.0f);//Mem overprov not supported yet - } - + Float threshold = capacityThresholdMap.get(capacity); + if (threshold.floatValue() < 1.0f) { + if (capacity == Capacity.CAPACITY_TYPE_CPU){ + clustersCrossingThreshold = _capacityDao.listClustersCrossingThreshold(capacity, plan.getDataCenterId(), + threshold, cpu_requested, ApiDBUtils.getCpuOverprovisioningFactor()); + }else{ + clustersCrossingThreshold = _capacityDao.listClustersCrossingThreshold(capacity, plan.getDataCenterId(), + threshold, ram_requested, 1.0f);//Mem overprov not supported yet + } + } + if (clustersCrossingThreshold != null && clustersCrossingThreshold.size() != 0){ // addToAvoid Set avoid.addClusterList(clustersCrossingThreshold);