RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1673662 - [RFE] System Purpose Status needs a list of reasons to explain why it is "Mismatched"
Summary: [RFE] System Purpose Status needs a list of reasons to explain why it is "Mis...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.1
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
Mariya Pershina
URL:
Whiteboard:
Depends On:
Blocks: 1694729 1723803
TreeView+ depends on / blocked
 
Reported: 2019-02-07 17:40 UTC by John Sefler
Modified: 2021-08-30 13:33 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
.System Purpose now informs the user when a bad system purpose value is set When installing RHEL 8 through the Anaconda GUI, there is a new system installation setting called "System Purpose". You can optionally choose a role, service-level, and usage for the system. These values are used during the registration and subscription attachment process to help entitle the system with a SKU that matches these system purpose values. If there are no subscriptions available to the registered system, a valid subscription may still be auto-attached, but `subscription-manager status` will report a "System Purpose Status" value of "Mismatched". This enhancement helps the customer understand the reasons for the mismatch. A query validates the available values, spotting typos or simply an unavailable system attribute value, informing the user when a bad system purpose value is set.
Clone Of:
: 1694729 1723803 (view as bug list)
Environment:
Last Closed: 2019-11-05 22:15:32 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 2346 0 'None' closed 1673662: Better reason messages for Mismatched syspurpose status; ENT-1247 2021-02-22 00:35:43 UTC
Github candlepin subscription-manager pull 2106 0 'None' closed 1673662: Print reasons, why syspurpose status is mismatch; ENT-1247 2021-02-22 00:35:43 UTC
Red Hat Knowledge Base (Solution) 3939071 0 Configure None [RFE] System Purpose Status needs a list of reasons to explain why it is "Mismatched" 2019-02-26 00:18:23 UTC
Red Hat Product Errata RHBA-2019:3561 0 None None None 2019-11-05 22:16:24 UTC

Description John Sefler 2019-02-07 17:40:14 UTC
Description of problem:
With the introduction of setting system purpose attributes, a new "System Purpose Status" value is reported by "subscription-manager status" as implemented by RFE Bug 1602847.

The possible values are...
  Matched
  Mismatched
  Not Specified

When "Mismatched" is reported, that means that the user has set a system purpose attribute value that for some unknown reason is not currently being satisfied.  The goal of this RFE is to help the user understand the reasons behind a "Mismatched" system purpose status. 


Version-Release number of selected component (if applicable):
[root@kvm-01-guest03 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.12-1
subscription management rules: 5.30.1
subscription-manager: 1.23.8-19.el8


How reproducible:
easily

Steps to Reproduce:
1. After registration and auto-attaching with some syspurpose attributes set, I can easily get this "Mismatched" result...

[root@kvm-01-guest03 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched

[root@kvm-01-guest03 ~]# 



Actual results:
  above - no reasons to explain the "Mismatched"


Expected results:
  something like this...

+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
  The service level preference "Premium" is not provided by a currently consumed subscription.
  The requested role "Red Hat Enterprise Linux Server" is not provided by a currently consumed subscription.
  The requested usage preference "Production" is not provided by a currently consumed subscription.
  The requested add-on "High Availability" is not provided by a currently consumed subscription.


Additional Info:

Comment 1 Jiri Hnidek 2019-06-04 11:24:10 UTC
I will also try to create another PR for candlepin to change messages with reasons.

Comment 4 Shwetha Kallesh 2019-06-20 13:58:47 UTC
Rehana I see the following messages with following version of rhsm and candlepin

[root@kvm-01-guest17 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.7.1-1
subscription management rules: 5.37
subscription-manager: 1.25.11-1.el8


[root@kvm-01-guest17 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested usage preference "foobar" is not provided by a currently consumed subscription.
- The service level preference "Premium" is not provided by a currently consumed subscription.
- The requested role "foo" is not provided by a currently consumed subscription.

Comment 8 Rehana 2019-07-22 10:09:45 UTC
Verifying against stage server (2.7)

[root@kvm-01-guest05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.7.2-1
subscription management rules: 5.37
subscription-manager: 1.25.12-1.el8

[root@kvm-01-guest05 ~]# rpm -qa subscription-manager --changelog | grep 1673662
- 1673662: Print reasons, why syspurpose status is mismatch; ENT-1247

1) Mis-match message when no system purpose values are specified on the system 

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Invalid

Red Hat Enterprise Linux for x86_64 Beta:
- Not supported by a valid subscription.

System Purpose Status: Not Specified

# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Not Specified

^^ Notice no mis-match message are displayed  --> PASS

2) set role value to "Red Hat Enterprise Server"

# subscription-manager role --set "Red Hat Enterprise Server"
role set to "Red Hat Enterprise Server".

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested role "Red Hat Enterprise Server" is not provided by a currently consumed subscription.

^^ Displayed mismatch message for role value --> PASS

3)Set usage value and verify the status 

# syspurpose set-usage "Production"
usage set to "Production".
[root@kvm-01-guest05 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested usage preference "Production" is not provided by a currently consumed subscription.
- The requested role "Red Hat Enterprise Server" is not provided by a currently consumed subscription.

^^ Displayed mismatch message for role and usage value --> PASS

4. Set Addon values and check the status 

[root@kvm-01-guest05 ~]# syspurpose add-addons foo bar
Added foo to addons.
Added bar to addons.
addons updated.
[root@kvm-01-guest05 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested add-on "bar" is not provided by a currently consumed subscription.
- The requested usage preference "Production" is not provided by a currently consumed subscription.
- The requested role "Red Hat Enterprise Server" is not provided by a currently consumed subscription.
- The requested add-on "foo" is not provided by a currently consumed subscription.

^^ Notice message for addon value mis-match was displayed. A separate bug 1726626 has been reported to have a single  mis-match message for list attribute. 


5. Let's install a GA product cert and attach sku that satisfies some of these system purpose values and check the mis-match reasons again 


[root@kvm-01-guest05 ~]# ll /etc/pki/product*
/etc/pki/product:
total 0

/etc/pki/product-default:
total 4
-rw-r--r--. 1 root root 2171 Jul 22 06:01 479.pem


[root@kvm-01-guest05 ~]# subscription-manager remove --all ; subscription-manager attach --auto
1 local certificate has been deleted.
1 subscription removed at the server.
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

[root@kvm-01-guest05 ~]# subscription-manager list --consumed ; subscription-manager  status
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Workstation, Standard (Up to 4 Guests)
Provides:            Red Hat Beta
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Container Images
                     Red Hat Container Images Beta
                     Oracle Java (for RHEL Client)
                     dotNET on RHEL (for RHEL Workstation)
                     Oracle Java (for RHEL Workstation)
                     dotNET on RHEL Beta (for RHEL Workstation)
                     Red Hat Enterprise Linux for x86_64
                     dotNET on RHEL (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Workstation)
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Enterprise Linux Workstation
                     Red Hat Ansible Engine
SKU:                 RH0981731
Contract:            11887275
Account:             6215951
Serial:              231717871960498346
Pool ID:             8a99f9a66b091636016bdb5f82284653
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               Red Hat Enterprise Linux Workstation
Service Level:       Standard
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              Tuesday 09 July 2019
Ends:                Wednesday 08 July 2020
Entitlement Type:    Virtual

+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested add-on "bar" is not provided by a currently consumed subscription.
- The requested role "Red Hat Enterprise Server" is not provided by a currently consumed subscription.
- The requested add-on "foo" is not provided by a currently consumed subscription.


[root@kvm-01-guest05 ~]# syspurpose show
{
  "addons": [
    "bar",
    "foo"
  ],
  "role": "Red Hat Enterprise Server",
  "usage": "Production"
}

^^ Notice the "usage" value was matched on the attached sku and the same is not removed from the mis-match messages 


The above tests demonstrates the with server version (2.7) , complete mis-match messages are now displayed.

Comment 9 Rehana 2019-07-22 10:37:50 UTC
Based on the observations on comment 3 ( against server version 2.3) and comment 8 (against server version 2.7) . Marking the bug to Verified

Additional note against production verification : 
================================================
[root@kvm-01-guest05 ~]# subscription-manager config --list | grep hostname
   hostname = [subscription.rhsm.redhat.com]
   proxy_hostname = []

[root@kvm-01-guest05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.7.2-1
subscription management rules: 5.37
subscription-manager: 1.25.12-1.el8

[root@kvm-01-guest05 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat OpenShift Container Platform, Premium, 2-Core
Provides:            Red Hat OpenShift Container Platform
                     Red Hat Beta
                     Red Hat OpenShift Enterprise Application Node
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat CodeReady Linux Builder for x86_64
                     Oracle Java (for RHEL Server)
                     JBoss Enterprise Web Server
                     Red Hat OpenShift Enterprise Client Tools
                     Red Hat Container Native Virtualization
                     Red Hat Single Sign-On
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat OpenShift Service Mesh
                     Red Hat CodeReady Workspaces for OpenShift
                     dotNET on RHEL (for RHEL Server)
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Enterprise Linux Fast Datapath
                     Red Hat CoreOS
                     Red Hat Ansible Engine
                     Red Hat CoreOS Beta
                     Red Hat Enterprise Linux Server
SKU:                 MCT2735
Contract:            11819081
Account:             477931
Serial:              7575627871488202151
Pool ID:             8a85f9996b49869e016bd9c314693b20
Provides Management: Yes
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Premium
Usage:               
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Stackable
Starts:              Thursday 13 December 2018
Ends:                Thursday 12 December 2019
Entitlement Type:    Virtual

[root@kvm-01-guest05 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested add-on "bar" is not provided by a currently consumed subscription.
- The service level preference "Standard" is not provided by a currently consumed subscription.
- The requested role "Red Hat Enterprise Linux Workstation" is not provided by a currently consumed subscription.
- The requested usage preference "Disaster Recovery" is not provided by a currently consumed subscription.
- The requested add-on "foo" is not provided by a currently consumed subscription.

As shown , now both stage and production server has server version 2.7.2-1 and displays mis-match reasons . Based on these observations , moving the bug to verified.

Comment 14 errata-xmlrpc 2019-11-05 22:15:32 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.

https://access.redhat.com/errata/RHBA-2019:3561

Comment 15 Jiri Hnidek 2020-01-07 08:40:38 UTC
Hi Mariya,
the Doc Text is OK.

Thanks,

Jiri


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