Bug 7845 - Productize DeploymentPlanner

The user concentrated pod heuristic should consider VMs for the given account that are in 'Running' or 'Stopped' state only.
This commit is contained in:
prachi 2011-02-28 15:43:35 -08:00
parent 37ad7069c2
commit 95c071e179
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
protected SearchBuilder<UserVmVO> 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);