You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2011/10/24 21:25:35 UTC

svn commit: r1188318 - /incubator/vcl/trunk/web/.ht-inc/utils.php

Author: jfthomps
Date: Mon Oct 24 19:25:34 2011
New Revision: 1188318

URL: http://svn.apache.org/viewvc?rev=1188318&view=rev
Log:
VCL-482
scheduler does not order VMs properly when no VMs are preloaded with the selected image

utils.php - modified isAvailable - copied ORDER BY clause from main query to VMhostCheck query

Modified:
    incubator/vcl/trunk/web/.ht-inc/utils.php

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=1188318&r1=1188317&r2=1188318&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Mon Oct 24 19:25:34 2011
@@ -3924,7 +3924,10 @@ function isAvailable($images, $imageid, 
 			       . "LEFT JOIN computer c ON (v.vmhostid = c.vmhostid) "
 			       . "LEFT JOIN image i ON (c.currentimageid = i.id) "
 			       . "WHERE c.id IN ($inids) AND "
-			       .       "(v.allocRAM - i.minram + {$images[$imageid]['minram']}) < v.RAM";
+			       .       "(v.allocRAM - i.minram + {$images[$imageid]['minram']}) < v.RAM "
+			       . "ORDER BY (c.procspeed * c.procnumber) DESC, "
+			       .          "c.RAM DESC, "
+			       .          "c.network DESC";
 			$qh = doQuery($query, 101);
 			$newcompids = array();
 			while($row = mysql_fetch_assoc($qh))