Author: jfthomps
Date: Fri Aug  6 16:46:19 2010
New Revision: 983049

URL: http://svn.apache.org/viewvc?rev=983049&view=rev
Log:
VCL-320
random selection of computer for reservations

conf.php: added SCHEDULER_ALLOCATE_RANDOM_COMPUTER - set to 1 to randomly 
allocate a computer from those available; set to 0 to assign computer with best 
specs

utils.php: modified allocComputer - if SCHEDULER_ALLOCATE_RANDOM_COMPUTER is 
set to 1, call shuffle for $blockids, $currentids, $computerids

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

Modified: incubator/vcl/trunk/web/.ht-inc/conf.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/conf.php?rev=983049&r1=983048&r2=983049&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/conf.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/conf.php Fri Aug  6 16:46:19 2010
@@ -67,6 +67,9 @@ define("DEFAULT_AFFILID", 1);
 define("DAYSAHEAD", 4);       // number of days after today that can be 
scheduled
 define("DEFAULT_PRIVNODE", 2);
 define("MAXVMLIMIT", 100);
+define("SCHEDULER_ALLOCATE_RANDOM_COMPUTER", 0); // set this to 1 to have the 
scheduler assign a randomly allocated
+                                                 // computer of those 
available; set to 0 to assign the computer with
+                                                 // the best combination of 
specs
 define("PRIV_CACHE_TIMEOUT", 15); // time (in minutes) that we cache 
privileges in a session before reloading them
 /// defines the min number of block request machines
 define("MIN_BLOCK_MACHINES", 5);

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=983049&r1=983048&r2=983049&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Fri Aug  6 16:46:19 2010
@@ -3700,6 +3700,11 @@ function RPCisAvailable($imageid, $start
 function allocComputer($blockids, $currentids, $computerids, $start,
                        $nowfuture) {
        $ret = array();
+       if(SCHEDULER_ALLOCATE_RANDOM_COMPUTER) {
+               shuffle($blockids);
+               shuffle($currentids);
+               shuffle($computerids);
+       }
        foreach($blockids as $compid) {
                $mgmtnodeid = findManagementNode($compid, $start, $nowfuture);
                if($mgmtnodeid == 0)


Reply via email to