Bug 1401787

Summary: Subscription Type should be cached (for list --consumed)
Product: Red Hat Enterprise Linux 6 Reporter: Wei Liu <weiliu>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: low    
Version: 6.9CC: csnyder, jhnidek, khowell, qianzhan, redakkan, skallesh
Target Milestone: alphaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.20.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-14 20:21:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
the rhsm.log none

Description Wei Liu 2016-12-06 05:39:03 UTC
Description of problem:
After changing the server hostname configuration to a bad value and effectively loose connection with the server,then try to list the consumed information(list --consumed),the "Subscription Type:  "is blank,not consistent with as listed before disconnection

Version-Release number of selected component (if applicable):
RHEL-6.9-20161201.0:
subscription-manager-firstboot-1.18.5-1.el6.x86_64
subscription-manager-1.18.5-1.el6.x86_64
python-rhsm-certificates-1.18.5-1.el6.x86_64
subscription-manager-gui-1.18.5-1.el6.x86_64
python-rhsm-1.18.5-1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.Install build RHEL-6.9-20161201.0
2.Register system and auto-attach
[root@dhcp-128-6 rhsm]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: new_test
Password: 
The system has been registered with ID: 3d0bddda-a8c1-4b58-b5fc-ce733661ec39 
[root@dhcp-128-6 rhsm]# subscription-manager attach --auto
3.list the consumed information before changing server hostname
[root@dhcp-128-6 rhsm]# subscription-manager list --co
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to
                     4 guests)
Provides:            Oracle Java (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Beta
                     dotNET on RHEL Beta (for RHEL Server)
                     dotNET on RHEL (for RHEL Server)
SKU:                 RH0103708
Contract:            10998331
Account:             5699758
Serial:              7350778274457587890
Pool ID:             8a99f983553a7d2f01554dc5613a6389
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard   <<<<<<<<<  show the right value
Starts:              05/28/2016
Ends:                05/27/2017
System Type:         Virtual
4 change the server hostname to lose connection 
#subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com1
5 list the consumed information again
[root@dhcp-128-6 rhsm]# subscription-manager list --co
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to
                     4 guests)
Provides:            Oracle Java (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Beta
                     dotNET on RHEL Beta (for RHEL Server)
                     dotNET on RHEL (for RHEL Server)
SKU:                 RH0103708
Contract:            10998331
Account:             5699758
Serial:              7350778274457587890
Pool ID:             8a99f983553a7d2f01554dc5613a6389
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:                  <<<<<<<< no value
Starts:              05/28/2016
Ends:                05/27/2017
System Type:         Virtual


Actual results:
the "Subscription Type:  "is blank,not consistent with as listed before disconnection

Expected results:
should report the same compliance as listed prior to the disconnection from the server


Additional info:

Comment 1 Wei Liu 2016-12-06 05:40:42 UTC
Created attachment 1228287 [details]
the rhsm.log

Comment 5 Jiri Hnidek 2017-05-01 15:13:26 UTC
I'm able to reproduce this bug.

Comment 7 Shwetha Kallesh 2017-10-11 06:55:19 UTC
Reproducer:

[root@intel-e31225-8-3 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.18.9-1.el6
python-rhsm: 1.18.6-1.el6


[root@intel-e31225-8-3 ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com
Proxy connection failed, please check your settings.
[root@intel-e31225-8-3 ~]# vi /etc/rhsm/rhsm.conf
[root@intel-e31225-8-3 ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_tier1_test
Password: 

The system has been registered with ID: 3c65be69-5edd-4b07-b154-20ba7352949d 
[root@intel-e31225-8-3 ~]# subscription-manager attach --auto


Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@intel-e31225-8-3 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Ceph Storage, Premium (Physical Node)
Provides:            Red Hat Software Collections (for RHEL Server)
                     Red Hat Ceph Storage OSD
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Storage Console
                     Red Hat Storage Console Node
SKU:                 RS00014
Contract:            11486100
Account:             6114661
Serial:              3372039413747183291
Pool ID:             8a99f9875ea4b859015ea4bfe64d0038
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              09/21/2017
Ends:                09/20/2018
System Type:         Physical

[root@intel-e31225-8-3 ~]# subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com1
[root@intel-e31225-8-3 ~]# subscription-manager list --co
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Ceph Storage, Premium (Physical Node)
Provides:            Red Hat Software Collections (for RHEL Server)
                     Red Hat Ceph Storage OSD
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Storage Console
                     Red Hat Storage Console Node
SKU:                 RS00014
Contract:            11486100
Account:             6114661
Serial:              3372039413747183291
Pool ID:             8a99f9875ea4b859015ea4bfe64d0038
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   
Starts:              09/21/2017
Ends:                09/20/2018
System Type:         Physical

Comment 8 Shwetha Kallesh 2017-10-11 07:03:44 UTC
Preliminary Verification:
[root@hp-dl160g8-1 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.20.2-1.el7
python-rhsm: 1.20.2-1.el7

[root@hp-dl160g8-1 ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com:443/subscription
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: shwetha_tier1_test
Password: 
The system has been registered with ID: f0c56ce7-07fd-403c-b297-5acfe06a923f
The registered system name is: hp-dl160g8-1.gsslab.pek2.redhat.com
[root@hp-dl160g8-1 ~]# subscription-manager attach --auto

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@hp-dl160g8-1 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Ceph Storage, Premium (Physical Node)
Provides:            Red Hat Software Collections (for RHEL Server)
                     Red Hat Ceph Storage OSD
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Storage Console
                     Red Hat Storage Console Node
SKU:                 RS00014
Contract:            11486100
Account:             6114661
Serial:              7473259900550276462
Pool ID:             8a99f9875ea4b859015ea4bfe64d0038
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              09/21/2017
Ends:                09/20/2018
System Type:         Physical

[root@hp-dl160g8-1 ~]# subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com1
[root@hp-dl160g8-1 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Ceph Storage, Premium (Physical Node)
Provides:            Red Hat Software Collections (for RHEL Server)
                     Red Hat Ceph Storage OSD
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Storage Console
                     Red Hat Storage Console Node
SKU:                 RS00014
Contract:            11486100
Account:             6114661
Serial:              7473259900550276462
Pool ID:             8a99f9875ea4b859015ea4bfe64d0038
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              09/21/2017
Ends:                09/20/2018
System Type:         Physical

Comment 9 qianzhan 2017-12-04 09:41:14 UTC
Verification on RHEL-7.5-Alpha-1.0(RHEL-7.5-20171130.0):

[root@localhost ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.20.7-1.el7

[root@localhost ~]# subscription-manager register --serverurl subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: rnew_test
Password: 
The system has been registered with ID: 48f347bd-3641-4a31-ae59-cf1bd94f0dc4
The registered system name is: localhost.localdomain
[root@localhost ~]# subscription-manager attach
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@localhost ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux, Standard (up to 2 sockets)
Provides:            Red Hat Beta
                     Red Hat Software Collections Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux Server
SKU:                 MCT0346
Contract:            11506161
Account:             6119775
Serial:              2854178458443868185
Pool ID:             8a99f9875f9e597c015f9e79c9e90244
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              11/09/2017
Ends:                11/09/2018
System Type:         Virtual

[root@localhost ~]# subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com1
[root@localhost ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux, Standard (up to 2 sockets)
Provides:            Red Hat Beta
                     Red Hat Software Collections Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux Server
SKU:                 MCT0346
Contract:            11506161
Account:             6119775
Serial:              2854178458443868185
Pool ID:             8a99f9875f9e597c015f9e79c9e90244
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              11/09/2017
Ends:                11/09/2018
System Type:         Virtual


Will moving this bug to VERIFIED, when it is moved to ON_QA.