After some testing, the fix is to change the '>=' comparison to just '>', so 
that the sum of normal reservations and block reservations can equal the max 
concurrent limit for an image. So line 3895 (your number may vary as I've added 
in some other mod code) in utils.php should look like:

if(($usagecnt + $row['currentusage'] - $decforedit) > 
$images[$imageid]['maxconcurrent']) {

It's near the end of the isAvailable function.

Mike

From: Waldron, Michael H
Sent: Thursday, February 06, 2014 3:05 PM
To: '[email protected]'
Subject: RE: Block allocation problem

I think I may have traced it to this section of code in utils.php, in the 
'isAvailable' function where It checks the max concurrent usage. If I'm 
following the logic correctly (BIG if), the equation near the end of the 
function around line 3895 is the kicker.

if(($usagecnt + $row['currentusage'] - $decforedit) >= 
$images[$imageid]['maxconcurrent']) {
                                semUnlock();
                                return -1;

In my case, $usagecnt is 0  (no current reservations), $decforedit is 0, 
currentusage  is 4 (block computers with the image and not already used), and 
maxconcurrent is 4. So the statement resolves to 0+4-0 >= 4. Thus it returns -1 
saying that max concurrent usage has been reached, even with none of the 
sessions in use.

Mike

----------------------------------------------------------------------------------------------------------------------------------------
Subject:               Re: Block allocation problem       permalink
From:    Dmitri Chebotarov ([email protected])
Date:     Feb 6, 2014 11:42:50 am
List:        org.apache.incubator.vcl-dev

What a coincidence! :) Just ran into exactly the same issue last night. Have 16 
max computers and 16 in block allocations - users in the right group cannot 
make reservation.

-- Thank you,

Dmitri Chebotarov VCL Sys Eng, Engineering & Architectural Support, TSD - Ent 
Servers & Messaging 223 Aquia Building, Ffx, MSN: 1B5 Phone: (703) 993-6175 | 
Fax: (703) 993-3404

---------------------------------------------------------------------------------------------------------------------------------
On 2/6/14, 13:38 , "Waldron, Michael H" <[email protected]> wrote:

We had a block allocation for an image that is limited to 4 concurrent 
sessions. When the allocation time arrived, users who were in the user group 
for the allocation trying to make a reservation received a message stating that 
the environment is limited in the number of concurrent sessions, and that no 
further reservations could be made during this time. There were NO active 
reservations for the image at the time.

By increasing the concurrent limit on the image, these users were then able to 
make a reservation. I verified that the users were indeed in the user group. It 
was if it wasn't honoring their group membership for the allocation, although 
when I increased the limit and they successfully made a reservation, I could 
see that they were getting the reserved machines.

Why wouldn't it allow any reservations for a block allocation that matched the 
concurrent use limit??

Mike Waldron Systems Specialist ITS - Research Computing Center University of 
North Carolina at Chapel Hill

Reply via email to