Bug 853902 - Show the consumed subscriptions via CLI failed after subscribing via SAM webUI
Summary: Show the consumed subscriptions via CLI failed after subscribing via SAM webUI
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Devan Goodwin
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 771748
TreeView+ depends on / blocked
 
Reported: 2012-09-03 09:45 UTC by lzhuang
Modified: 2012-09-24 11:43 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-24 11:43:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description lzhuang 2012-09-03 09:45:22 UTC
Description of problem:
If the system is subscribed on SAM web UI, then show the subscriptions being consumed with command "subscription-manager list --available" will fail.

Version-Release number of selected component (if applicable):
subscription-manager-firstboot-1.0.14-1.el5
subscription-manager-1.0.14-1.el5
subscription-manager-gui-1.0.14-1.el5
python-rhsm-1.0.6-1.el5

How reproducible:
100%

Steps to Reproduce:
1. the host is registered to a SAM server, do subscribe on SAM web UI.
Subscription 	SLA 	Contract 	Quantity 	Start 	End
Red Hat Employee Subscription 	None 	2596950 	1 	2011-10-08 	2022-01-01



2. show the consumed subscription in the host via CLI command: 
[root@dhRHEL5 pki]# subscription-manager list --consumed
No consumed subscription pools to list
^^^^^^^^
 
  

3. show the available subscriptions in the host via CLI command:
[root@dhRHEL5 pki]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:      60 Day Supported CloudForms Evaluation
SKU:                    SER0408
Pool Id:                8ac28c0b39000efb0139007efd3c00d4
Quantity:               22
Service Level:          Premium
Service Type:           L1-L3
Multi-Entitlement:      No
Ends:                   01/01/2013
Machine Type:           physical

The subscription which host subscribed to is no longer in the available list.
                                             ^^^^^^^^^



4. show the available subscriptions in the guest via CLI command:
[root@localhost pki]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:      60 Day Supported CloudForms Evaluation
SKU:                    SER0408
Pool Id:                8ac28c0b39000efb0139007efd3c00d4
Quantity:               22
Service Level:          Premium
Service Type:           L1-L3
Multi-Entitlement:      No
Ends:                   01/01/2013
Machine Type:           physical

Subscription Name:      Red Hat Employee Subscription
SKU:                    SYS0395
Pool Id:                8ac28c0b396b676e01398a1914100755
Quantity:               unlimited
Service Level:          None
Service Type:           None
Multi-Entitlement:      No
Ends:                   01/01/2022
Machine Type:           virtual

Subscription Name:      Red Hat Employee Subscription
SKU:                    SYS0395
Pool Id:                8ac28c0b39000efb0139007efb4f0080
Quantity:               27
Service Level:          None
Service Type:           None
Multi-Entitlement:      No
Ends:                   01/01/2022
Machine Type:           physical

Both the physical subscription which the host subscribed to and the bonus virtual subscription is in the available list.



5. do refresh on the host via CLI command:
[root@dhRHEL5 pki]# subscription-manager refresh
All local data refreshed



6. show the consumed subscription in the host via CLI command again:
[root@dhRHEL5 pki]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

Subscription Name:      Red Hat Employee Subscription
Provides:               Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
                        Red Hat Enterprise Linux Server
                        Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                        Red Hat Beta
                        Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                        Red Hat Enterprise Linux High Availability (for RHEL Server)
                        Red Hat Enterprise Linux Workstation
SKU:                    SYS0395
Contract:               2596950
Account:                477931
Serial Number:          8254364344800698133
Active:                 True
Quantity Used:          1
Service Level:          None
Service Type:           None
Starts:                 10/08/2011
Ends:                   01/01/2022

The output shows the correct information now.
                     ^^^^^^^^^^^^^^^^^^


Actual results:
See above.

Expected results:
For step2, the output of CLI command should be the same as step6, subscription-manager should show the correct information.

Additional info:

Comment 1 RHEL Program Management 2012-09-03 10:08:29 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 ndong 2012-09-18 06:29:11 UTC
remove the entitlement certs failed after unregister via SAM webUI

Description of problem:
the entitlement certs can't be removed after unregister via SAM webUI

Version-Release number of selected component (if applicable):
subscription-manager-firstboot-1.0.17-1.el5
subscription-manager-1.0.17-1.el5
subscription-manager-gui-1.0.17-1.el5
python-rhsm-1.0.6-1.el5

How reproducible:
100%

Steps to Reproduce:
1. register the mechine to sam server and consume one subscription
#subscription-manager register
#subscription-manager register --pool=$poolid

2.check the entilement cert in the mechine
#ls /etc/pki/entitlement
3441464648497984340-key.pem
3441464648497984340.pem

3.unregister the mechine via SAM webUI
the mechine has be unregistered successfully.

4.refresh the date in the mechine
#subscription-manager refresh
Consumer f1971222-92bb-4ef2-80ac-467ecbbca407 has been deleted

5.check the entitlement cert in mechine
#ls /etc/pki/entitlement
3441464648497984340-key.pem
3441464648497984340.pem            

Actual results:
See above.

Expected results:
For step5, there are no entitlement cert desplayed

Additional info:

Comment 3 Devan Goodwin 2012-09-21 14:22:56 UTC
(In reply to comment #2)
> remove the entitlement certs failed after unregister via SAM webUI
> 
> Description of problem:
> the entitlement certs can't be removed after unregister via SAM webUI
> 
> Version-Release number of selected component (if applicable):
> subscription-manager-firstboot-1.0.17-1.el5
> subscription-manager-1.0.17-1.el5
> subscription-manager-gui-1.0.17-1.el5
> python-rhsm-1.0.6-1.el5
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. register the mechine to sam server and consume one subscription
> #subscription-manager register
> #subscription-manager register --pool=$poolid
> 
> 2.check the entilement cert in the mechine
> #ls /etc/pki/entitlement
> 3441464648497984340-key.pem
> 3441464648497984340.pem
> 
> 3.unregister the mechine via SAM webUI
> the mechine has be unregistered successfully.
> 
> 4.refresh the date in the mechine
> #subscription-manager refresh
> Consumer f1971222-92bb-4ef2-80ac-467ecbbca407 has been deleted
> 
> 5.check the entitlement cert in mechine
> #ls /etc/pki/entitlement
> 3441464648497984340-key.pem
> 3441464648497984340.pem            
> 
> Actual results:
> See above.
> 
> Expected results:
> For step5, there are no entitlement cert desplayed
> 
> Additional info:

ndong could you file this as a separate bugzilla, not related to the issue in this ticket. Thanks!

Comment 4 Devan Goodwin 2012-09-21 17:34:36 UTC
(In reply to comment #0)
> Description of problem:
> If the system is subscribed on SAM web UI, then show the subscriptions being
> consumed with command "subscription-manager list --available" will fail.

Assuming this is a typo, the command to list subscriptions being consumed uses --consumed rather than --available, but based on the below I think this is just a typo.

> 
> Version-Release number of selected component (if applicable):
> subscription-manager-firstboot-1.0.14-1.el5
> subscription-manager-1.0.14-1.el5
> subscription-manager-gui-1.0.14-1.el5
> python-rhsm-1.0.6-1.el5
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. the host is registered to a SAM server, do subscribe on SAM web UI.
> Subscription 	SLA 	Contract 	Quantity 	Start 	End
> Red Hat Employee Subscription 	None 	2596950 	1 	2011-10-08 	2022-01-01
> 
> 
> 
> 2. show the consumed subscription in the host via CLI command: 
> [root@dhRHEL5 pki]# subscription-manager list --consumed
> No consumed subscription pools to list
> ^^^^^^^^

This is because the client doesn't yet know it has the entitlement, this will not happen until the rhsmcertd job runs (every 4 hours by default), or the user manually runs "subscription-manager refresh". This behaviour seems correct so far.

>  
>   
> 
> 3. show the available subscriptions in the host via CLI command:
> [root@dhRHEL5 pki]# subscription-manager list --available
> +-------------------------------------------+
>     Available Subscriptions
> +-------------------------------------------+
> Subscription Name:      60 Day Supported CloudForms Evaluation
> SKU:                    SER0408
> Pool Id:                8ac28c0b39000efb0139007efd3c00d4
> Quantity:               22
> Service Level:          Premium
> Service Type:           L1-L3
> Multi-Entitlement:      No
> Ends:                   01/01/2013
> Machine Type:           physical
> 
> The subscription which host subscribed to is no longer in the available list.
>                                              ^^^^^^^^^
> 

So here we're requesting from the server the pools which are suitable for this system. The server knows it already has an entitlement from the pool, and that it cannot have two, so it is excluding that pool from the list.

> 
> 
> 4. show the available subscriptions in the guest via CLI command:
> [root@localhost pki]# subscription-manager list --available
> +-------------------------------------------+
>     Available Subscriptions
> +-------------------------------------------+
> Subscription Name:      60 Day Supported CloudForms Evaluation
> SKU:                    SER0408
> Pool Id:                8ac28c0b39000efb0139007efd3c00d4
> Quantity:               22
> Service Level:          Premium
> Service Type:           L1-L3
> Multi-Entitlement:      No
> Ends:                   01/01/2013
> Machine Type:           physical
> 
> Subscription Name:      Red Hat Employee Subscription
> SKU:                    SYS0395
> Pool Id:                8ac28c0b396b676e01398a1914100755
> Quantity:               unlimited
> Service Level:          None
> Service Type:           None
> Multi-Entitlement:      No
> Ends:                   01/01/2022
> Machine Type:           virtual
> 
> Subscription Name:      Red Hat Employee Subscription
> SKU:                    SYS0395
> Pool Id:                8ac28c0b39000efb0139007efb4f0080
> Quantity:               27
> Service Level:          None
> Service Type:           None
> Multi-Entitlement:      No
> Ends:                   01/01/2022
> Machine Type:           physical
> 
> Both the physical subscription which the host subscribed to and the bonus
> virtual subscription is in the available list.
> 
> 
> 
> 5. do refresh on the host via CLI command:
> [root@dhRHEL5 pki]# subscription-manager refresh
> All local data refreshed
> 
> 
> 
> 6. show the consumed subscription in the host via CLI command again:
> [root@dhRHEL5 pki]# subscription-manager list --consumed
> +-------------------------------------------+
>    Consumed Subscriptions
> +-------------------------------------------+
> 
> Subscription Name:      Red Hat Employee Subscription
> Provides:               Red Hat Enterprise Linux Resilient Storage (for RHEL
> Server)
>                         Red Hat Enterprise Linux Server
>                         Red Hat Enterprise Linux Scalable File System (for
> RHEL Server)
>                         Red Hat Beta
>                         Red Hat Enterprise Linux Load Balancer (for RHEL
> Server)
>                         Red Hat Enterprise Linux High Availability (for RHEL
> Server)
>                         Red Hat Enterprise Linux Workstation
> SKU:                    SYS0395
> Contract:               2596950
> Account:                477931
> Serial Number:          8254364344800698133
> Active:                 True
> Quantity Used:          1
> Service Level:          None
> Service Type:           None
> Starts:                 10/08/2011
> Ends:                   01/01/2022
> 
> The output shows the correct information now.
>                      ^^^^^^^^^^^^^^^^^^
> 
> 
> Actual results:
> See above.
> 
> Expected results:
> For step2, the output of CLI command should be the same as step6,
> subscription-manager should show the correct information.
> 
> Additional info:

This is a known limitation of how the system works, server side entitlements can take time to trickle down to the systems (until rhsmcertd runs), and the refresh command is there for anyone who wishes to force an update right now.

We discussed options but we can't do much to change this, the refresh operation can be slow, upwards of 30 seconds in some cases. Doing this automatically here probably also implies we should do it during list --available, when the GUI starts up, and potentially any time we do *anything* which requires current entitlement data. 

We're reaching out to documentation to make sure we cover the fact that entitlement data is refreshed by the daemon or the explicit command.

Comment 5 Devan Goodwin 2012-09-24 11:43:28 UTC
Spoken to docs, this behaviour is documented for SAM and they're opening a bug to document for the hosted portal as well.


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