Bug 743710

Summary: Subscription manager displays incorrect status for partially subscribed subscription
Product: Red Hat Enterprise Linux 6 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: bkearney, dgoodwin, jsefler, skallesh, spandey, syeghiay
Target Milestone: betaKeywords: Reopened
Target Release: 6.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:03:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 738066    
Attachments:
Description Flags
partial_subscription none

Description J.C. Molet 2011-10-05 19:17:05 UTC
Description of problem:
When you are subscribed to a non-multi-entitlement subscription partially, your status for that product is green (or valid, when it should be yellow or red.

Version-Release number of selected component (if applicable):
[root@mgmt5 candlepin]# git show
commit 5340dfd5b25440d227ee22940da712516a4989bb
 (this includes new healing feature)

python-rhsm-0.96.13-1.git.0.a237980.el6.noarch
subscription-manager-firstboot-0.96.13-1.git.0.b1b0502.el6.x86_64
subscription-manager-0.96.13-1.git.0.b1b0502.el6.x86_64
subscription-manager-gnome-0.96.13-1.git.0.b1b0502.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.  Populate candlepin with TESTDATA=1
2.  Copy over 27060.pem to your products folder (may be possible with other
products)
3.  Make sure your cpu sockets are 4.  In a /etc/rhsm/facts/override.facts you
can add: {"cpu.cpu_socket(s)":"4", "lscpu.cpu_socket(s)":"4"}
4.  Autosubscribe  (see Bug 743704 )
4a. OR instead of auto-subscribing, import the 'Awesome OS Workstation Bits' subscription  

Actual results:
[root@jmolet-vm0 product]# ls
27060_.pem
[root@jmolet-vm0 product]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:         Awesome OS Workstation Bits
Version:             6.1                      
Arch:                ALL                      
Status:              Not Subscribed           
Starts:                                       
Expires:                                      

[root@jmolet-vm0 product]# cd
[root@jmolet-vm0 ~]# subscription-manager facts --list | grep cpu_socket
cpu.cpu_socket(s): 4
lscpu.cpu_socket(s): 4
[root@jmolet-vm0 ~]# subscription-manager register --user testuser1 --pass
password --org admin
The system has been registered with id: b6aea3ae-e8a1-4eff-8f47-8b75da5cf708 

[root@jmolet-vm0 ~]# subscription-manager list --available | grep Workstation
-A 7
[root@jmolet-vm0 ~]# # ^^^ THIS TELLS ME I SHOULDN'T BE ABLE TO SUBSCRIBE TO
THIS WORKSTATION SUBSCRIPTION, Next command shows it is only a 2 socket sub: 

[root@jmolet-vm0 facts]# curl -k -u admin:admin
https://mgmt5.rhq.lab.eng.bos.redhat.com:8443/candlepin/pools/8a90f88f32d31d280132d31e09830675
| json_reformat | grep sockets -B 1 -A 1

      "productId": "awesomeos-workstation-basic",
      "name": "sockets",
      "value": "2",

[root@jmolet-vm0 ~]# subscription-manager list --available --all | grep
Workstation -A 7
ProductName:        Awesome OS Workstation Basic
ProductId:          awesomeos-workstation-basic
PoolId:             8a90f88f32d31d280132d31e095f0669
Quantity:           10                       
Multi-Entitlement:  No                       
Expires:            10/03/2012               
MachineType:        physical                 

--
ProductName:        Awesome OS Workstation Basic
ProductId:          awesomeos-workstation-basic
PoolId:             8a90f88f32d31d280132d31e09830675
Quantity:           5                        
Multi-Entitlement:  No                       
Expires:            10/03/2012               
MachineType:        physical  
Expected results:

[root@jmolet-vm0 ~]# subscription-manager subscribe --auto
Installed Product Current Status:

ProductName:          Awesome OS Workstation Bits
Status:                Subscribed               

                       ^^^^^^^^^^^ wut?

In the GUI, the icon shows as a green circle, and that your entitlement is fully valid.

Expected results:
The Status should report as partially subscribed, and in the GUI you should get a yellow triangle icon for this product.

Comment 4 Devan Goodwin 2011-11-07 16:32:46 UTC

*** This bug has been marked as a duplicate of bug 740377 ***

Comment 5 Devan Goodwin 2011-12-12 20:07:10 UTC
My mistake, didn't realize this was for a non-multi-entitlement subscription. Not a dupe.

Comment 6 Devan Goodwin 2011-12-13 19:57:13 UTC
It might be worth arguing this should be green.

The concept of you need x entitlements to cover your y sockets is only introduced via stacking, if the subscription *only* has multi-entitle, this is a different situation, originally for things like bulk transfer of entitlements to domains and such.

We definitely do not start comparing socket count to those provided by entitlements unless they are stacked, I'm not sure we should be.

So this situation I think should be green.

But, perhaps we should change the rules server side to flat out reject the entitlement if it's for too few sockets for your system, regardless if multi-entitle is on and how many you asked for. (as it's not a stacked subscription)

Comment 7 William Poteat 2011-12-15 14:24:44 UTC
rejecting this bind will stop us from fulfilling a bind across multiple pools [i.e. 3 from pool A then 3 from pool B]

Comment 9 Shwetha Kallesh 2012-03-15 10:40:07 UTC
Created attachment 570245 [details]
partial_subscription

Comment 10 Shwetha Kallesh 2012-03-15 10:43:59 UTC
Moving to verified

RPM used:
[root@dhcp201-162 facts]# rpm -qa | grep subscription-manager
subscription-manager-0.99.10-1.git.0.e9e8bf7.el6.x86_64
subscription-manager-migration-0.99.10-1.git.0.e9e8bf7.el6.x86_64
subscription-manager-firstboot-0.99.10-1.git.0.e9e8bf7.el6.x86_64
subscription-manager-migration-data-1.12.2-1.git.0.ede4958.el6.noarch
subscription-manager-gnome-0.99.10-1.git.0.e9e8bf7.el6.x86_64
subscription-manager-debuginfo-0.99.9-1.el6.x86_64

[root@dhcp201-162 pki]# subscription-manager import --certificate=/etc/pki/tmp/cert.pem 
Successfully imported certificate cert.pem


[root@dhcp201-162 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Awesome OS Workstation Bits
Version:              	6.1                      
Arch:                 	ALL                      
Status:               	Partially Subscribed     
Starts:               	None                     
Expires:              	None

Comment 12 spandey 2012-03-22 10:26:12 UTC
[root@localhost ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Awesome OS Workstation Bits
Product ID:           	27060                    
Version:              	6.1                      
Arch:                 	ALL                      
Status:               	Partially Subscribed     
Starts:               	                         
Expires:              	
[root@localhost ~]# cat  /etc/pki/entitlement/5354276907180864381.pem >> t1.pem
[root@localhost ~]# cat  /etc/pki/entitlement/5354276907180864381-key.pem >> t1.pem
[root@localhost ~]# subscription-manager unsubscribe --all
[root@localhost ~]# subscription-manager import --certificate=/root/t1.pem 
Successfully imported certificate t1.pem
[root@localhost ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:         	Awesome OS Workstation Bits
Product ID:           	27060                    
Version:              	6.1                      
Arch:                 	ALL                      
Status:               	Partially Subscribed     
Starts:               	                         
Expires:        

Awesome OS Workstation Bits is non multi entitlement cert.

Moving status to verified

Comment 14 errata-xmlrpc 2012-06-20 13:03:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0804.html