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.
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
Attached screenshot for errata in step 3 mentioned in comment#1.
Created attachment 467301 [details] Screenshot for step 3 - Errata
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.
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.
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.
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.
Howdy team, I tested the fixed in our labs and it works :) Thank you Justin for the fix. Kind Regards, Marcelo Moreira de Mello
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
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
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:
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.
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