Bug 661109 - Flex Entitlements are not being consumed when registering a VM
Flex Entitlements are not being consumed when registering a VM
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI (Show other bugs)
540
All Linux
high Severity high
: ---
: ---
Assigned To: Justin Sherrill
Martin Minar
:
Depends On:
Blocks: sat54-errata 668004
  Show dependency treegraph
 
Reported: 2010-12-07 14:45 EST by Marcelo Moreira de Mello
Modified: 2016-07-03 20:55 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Previously, Satellite entitlement logic would allow a registered system to consume flex entitlement only for one channel at a time. Consequence: Registered systems would consume flex entitlements for their base channels only, child channels would consume regular entitlements. Fix: Entitlement logic allowing a flex guest to use correct entitlements for both base and child channels. Result: Registration of a flex guest capable system will use flex entitlements for both base and child channels.
Story Points: ---
Clone Of:
: 668004 (view as bug list)
Environment:
Last Closed: 2011-01-17 16:19:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Screenshots for the process used in Bugzilla (1.11 MB, application/x-gzip)
2010-12-07 14:45 EST, Marcelo Moreira de Mello
no flags Details
Screenshot for step 3 - Errata (110.29 KB, image/png)
2010-12-07 15:24 EST, Marcelo Moreira de Mello
no flags Details

  None (edit)
Description Marcelo Moreira de Mello 2010-12-07 14:45:03 EST
Created attachment 467287 [details]
Screenshots for the process used in Bugzilla

Description of problem:
When registering a fresh VM (matching the Flex Guests requirements), Virtualization Entitlements does not show the Flex usage properly.  

Manage RHN Satellite Organizations -> [Organization] -> Subscriptions -> Software Channel Entitlements
... then modify Flex Usage. Then navigate to "Alter Channel Subscriptions" for VM and check total available, this shows Regular Usage, not Flex Usage total. 

Version-Release number of selected component (if applicable):
Satellite 5.4
RHEL 5.5

How reproducible:
100%

Steps to Reproduce:

I created some screenshots (attached to the case) to help my understanding of the issue:  

1) Install a fresh guest RHEL5.5 using KVM/Xen/VMware (meeting the flex guests requirements)

2) Register the fresh guest in Satellite 5.4 (make sure that host is not registered in Satellite, to be treat as Flex Entitlement) 

3) Software Entitlement has consumed Flex Entitlement properly (see screenshot1 and screenshot2) as expected 

4) In Virtualization Entitlements, Red Hat Enterprise Linux 5 (core server) has consumed the flex entitlement properly (see screenshot5)

5) Still in Virtualization Entitlements, Red Hat Network Tools hasn't consumed a flex entitlement as expected (see screenshot 6) 

6) After convert the system (see screenshot7), the Virtualization Entitlements for Flex Guests shows system as expected (see screenshot8) 

7) In Software Entitlements, the RHEL 5 (core server) and RHN Tools (child channels) are kept the same (see screenshot9 and screenshot10), which seems that we are hitting a bug in Virtualization Entitlements page. 

  
Actual results:
Virtualization Entitlement's page only show Flex consumers usage correctly, after converting the child system.  

Expected results:
Virtualization Entitlement's page should show Flex consumers correctly, once the guest machine met all flex requirements.
Comment 1 Marcelo Moreira de Mello 2010-12-07 15:17:00 EST
Howdy team, 

Just a correction on items: 

3) Software Entitlement the VM has NOT consumed a Flex Entitlement

7) After convert the system, now RHN Tools (child channel) consumes a Flex Entitlement. 


Best, 
Marcelo
Comment 2 Marcelo Moreira de Mello 2010-12-07 15:23:03 EST
Attached screenshot for errata in step 3  mentioned in comment#1.
Comment 3 Marcelo Moreira de Mello 2010-12-07 15:24:47 EST
Created attachment 467301 [details]
Screenshot for step 3 - Errata
Comment 4 Justin Sherrill 2010-12-08 15:42:14 EST
Found the problem in rhn_channel  schema package:

rhn_channel.subscribe_server  calls rhn_channel.can_server_consume_fve

Within: rhn_channel.can_server_consume_fve


            SELECT 1
              FROM rhnVirtualInstance vi
             WHERE vi.virtual_system_id = server_id_in
             and not exists(select server_id from rhnServerChannel sc where
                            sc.server_id = vi.virtual_system_id
                            and  sc.is_fve='Y');

Here is it basically saying that if a system is already using a flex guest entitlement for any channels, it is no longer flex capable, which is wrong.  The whole " not exists (SUBQUERY)"  should really be removed.

This function is only used within rhn_channel.subscribe_server, so it's a low risk change.
Comment 5 Justin Sherrill 2010-12-08 15:46:23 EST
Also note that this doesn't have anything to do with activation keys in particular.  If you register a system normally and it uses a flex subscription for it's base channel, manually subscribing it to a  child channel will not use a flex when it should.

Basically the normal subscription methods can will only allow a system to use flex subscription for 1 system.
Comment 6 Justin Sherrill 2010-12-08 15:57:26 EST
fixed in spacewalk master:
01ee646ff576168258b8bef550f028bf2b6c3175

Note: this requires a schema change and thus cannot be released as a normal errata.  It can only be released in the next major version of Satellite.
Comment 7 Justin Sherrill 2010-12-08 16:36:01 EST
err a type in comment #5

"Basically the normal subscription methods can will only allow a system to use
flex subscription for 1 system."

Should be:

Basically the normal subscription methods can will only allow a system to use a
flex subscription for 1 channel at a time.
Comment 11 Marcelo Moreira de Mello 2010-12-09 17:05:33 EST
Howdy team, 

I tested the fixed in our labs and it works :) 

Thank you Justin for the fix. 

Kind Regards, 
Marcelo Moreira de Mello
Comment 14 Clifford Perry 2010-12-10 14:23:23 EST
Due to schema nature - this is not a candidate for 5.4.x bugfix. Moving to the sat600-triage tracker to align to future releases.

Cliff
Comment 23 Florian Nadge 2011-01-14 06:02:01 EST
Please be so kind and add a few key words to the Technical Notes of this
Bugzilla entry using the following structure:

Cause:

Consequence:

Fix:

Result:

For details, see:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes

Thanks
Comment 24 Florian Nadge 2011-01-14 06:02:55 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:

Consequence:

Fix:

Result:
Comment 25 Milan Zazrivec 2011-01-14 08:24:26 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1,8 @@
-Cause:
+Cause: Previously, Satellite entitlement logic would allow a registered system to consume flex entitlement only for one channel at a time.
 
-Consequence:
+Consequence: Registered systems would consume flex entitlements for their base channels only, child channels would consume regular entitlements.
 
-Fix:
+Fix: Entitlement logic allowing a flex guest to use correct entitlements for both base and child channels.
 
-Result:+Result: Registration of a flex guest capable system will use
+flex entitlements for both base and child channels.
Comment 27 errata-xmlrpc 2011-01-17 16:19:29 EST
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/RHBA-2011-0155.html

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