Bug 196680 - don't assume rhn_entitlements.can_entitle_server checks for available room in server groups
don't assume rhn_entitlements.can_entitle_server checks for available room in...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Other (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Shannon Hughes
Michael Mráka
:
Depends On:
Blocks: 472497
  Show dependency treegraph
 
Reported: 2006-06-26 09:22 EDT by Ken Ganong
Modified: 2009-09-10 14:24 EDT (History)
4 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 14:24:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ken Ganong 2006-06-26 09:22:45 EDT
The procedure can_entitle_server does not check that max_members of a server
group is greater than current_members, so if you have filled all of your
entitlement slots and therefore cannot entitle another server, the procedure
will still answer that you can.

It seems that the solution here would be to add an AND clause to
find_compatible_sg such that max_members > current_members.

When executing something like this:
if (rhn_entitlements.can_entitle_server)
    rhn_entitlements.entitle_server

It is possible that you will get a stacktrace like this:

ORA-20220: (servergroup_max_members) - Server group membership cannot exceed
maximum membership
ORA-06512: at "RHN.RHN_EXCEPTION", line 27
ORA-06512: at "RHN.RHN_SERVER", line 470
ORA-06512: at "RHN.RHN_ENTITLEMENTS", line 264
ORA-06512: at line 1
Comment 1 James Slagle 2006-12-11 11:10:13 EST
when i wrote can_entitle_server (at rnorwood's request) I wrote it so that it
intentionally didn't check for available slots.  Is there an actual bug in the
UI right now?  I don't see one.

I setup an account with 1 system slot and registered 2 systems.  The system
entitlements page always seems to do the right thing.

I would say, don't right code that uses the function incorrectly.
Comment 2 Ken Ganong 2006-12-11 12:03:02 EST
I guess I misjudged the purpose of this function then. There is a bug in some
'enable config management' wizardish code.

I guess I don't understand why not check for available slots. In what case would
you ask the question 'can entitle server for provisioning?' without wanting to
check for available provisioning slots?
Comment 3 James Slagle 2006-12-11 12:09:29 EST
i have no idea.  Robin asked for it when he was coding the system entitlements
page, so that's how i wrote it.  there may be ui elements on that page that make
use of the "compatibility" server with a system slot, and not if you actually
have slots left.
Comment 4 James Slagle 2006-12-12 16:30:04 EST
i would prefer not to change this procedure without knowing the implications on
the backend code (i haven't looked to be honest).  if there is code that assumes
can_entitle_server is checking for available slots, please change it not to
assume that.
Comment 5 Ken Ganong 2006-12-12 17:01:10 EST
This assumption is currently made in the SystemHandler.upgradeEntitlement xmlrpc
api call and the wizardish enable config management code.
Comment 6 Ken Ganong 2006-12-15 15:57:45 EST
Passing on my config management bugs to ggainey
Comment 7 Grant Gainey 2007-01-31 09:42:09 EST
Moved from ON_DEV to ON_QA with push #6
Comment 13 Michael Mráka 2009-06-09 09:09:22 EDT
Verified. Satellite-5.3.0-RHEL4-re20090529.0-x86_64

Enable Configuration Management Summary 

Configuration Management Enablement has been attempted on the following systems. To complete enablement on successful systems (indicated by the Status column below), perform the following two actions:

1. Run rhn_check to complete pending rhncfg-* package installs. 
2. Run the following command: rhn-actions-control --enable-all 
	1 - 1 of 1 	
Status	System Name	Error Condition
error 	 xen84-5 	Could not grant provisioning entitlement.
Comment 14 Milan Zazrivec 2009-09-08 09:16:02 EDT
Verified with final 5.3.0 iso, same results as in previous comment.
RELEASE_PENDING
Comment 15 Brandon Perkins 2009-09-10 14:24:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

Note You need to log in before you can comment on or make changes to this bug.