bug CS-14156: While listing Pods Having Vms for an Account during userconcentratedpod_firstfit allocation look for starting and stopping states of vms as well.

Reviewed-by: Prachi
This commit is contained in:
Nitin Mehta 2012-06-06 20:24:10 +05:30
parent f19d8d0084
commit fc82d5fd64
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ 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 AND (state = 'Running' OR state = 'Stopped') " +
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 in ('Running', 'Stopped', 'Starting', 'Stopping')) " +
"GROUP BY pod_id HAVING count(id) > 0 ORDER BY count(id) DESC";
private static String VM_DETAILS = "select vm_instance.id, " +