From fc82d5fd641d0c7b04dae1d6f4276064d6e46bec Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Wed, 6 Jun 2012 20:24:10 +0530 Subject: [PATCH] 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 --- server/src/com/cloud/vm/dao/UserVmDaoImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/vm/dao/UserVmDaoImpl.java b/server/src/com/cloud/vm/dao/UserVmDaoImpl.java index 5f91426bb71..e57d8a82a34 100755 --- a/server/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/server/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -66,7 +66,7 @@ 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 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, " +