From 95c071e179727d01b37685012cefd85ab8f69153 Mon Sep 17 00:00:00 2001 From: prachi Date: Mon, 28 Feb 2011 15:43:35 -0800 Subject: [PATCH] Bug 7845 - Productize DeploymentPlanner The user concentrated pod heuristic should consider VMs for the given account that are in 'Running' or 'Stopped' state only. --- server/src/com/cloud/vm/dao/UserVmDaoImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/vm/dao/UserVmDaoImpl.java b/server/src/com/cloud/vm/dao/UserVmDaoImpl.java index db9ae67bc64..e360eb91746 100755 --- a/server/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/server/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -72,7 +72,8 @@ public class UserVmDaoImpl extends GenericDaoBase implements Use protected SearchBuilder UserVmSearch; protected final Attribute _updateTimeAttr; - private static final String LIST_PODS_HAVING_VMS_FOR_ACCOUNT = "SELECT pod_id FROM cloud.vm_instance WHERE data_center_id = ? AND account_id = ? AND pod_id IS NOT NULL GROUP BY pod_id HAVING count(id) > 0 ORDER BY count(id) DESC"; + private static final String LIST_PODS_HAVING_VMS_FOR_ACCOUNT = "SELECT pod_id FROM cloud.vm_instance WHERE data_center_id = ? AND account_id = ? AND pod_id IS NOT NULL AND state = 'Running' OR state = 'Stopped' " + + "GROUP BY pod_id HAVING count(id) > 0 ORDER BY count(id) DESC"; protected final UserVmDetailsDaoImpl _detailsDao = ComponentLocator.inject(UserVmDetailsDaoImpl.class);