Bug 1694729

Summary: [RFE] System Purpose Status needs a list of reasons to explain why it is "Mismatched"
Product: Red Hat Satellite Reporter: Rich Jerrido <rjerrido>
Component: Hosts - ContentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Stephen Wadeley <swadeley>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5.0CC: asharvit, candlepin-bugs, igkioka, jsefler, ktordeur, qianzhan, rhsm-qe, rmullett, yanpliu
Target Milestone: UnspecifiedKeywords: FutureFeature
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1673662 Environment:
Last Closed: 2020-05-01 14:15:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1673662, 1723803    
Bug Blocks:    

Description Rich Jerrido 2019-04-01 13:34:10 UTC
+++ This bug was initially created as a clone of Bug #1673662 +++


In Satellite, since we expose System Purpose data on the 'content hosts' page, we'd want to expose any reasons for Mismatch there as well. 


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 3 qianzhan 2019-06-25 07:18:27 UTC
Verification on RHEL-8.1.0-20190619.2 against Satellite6.6-snapshot7.0:

subscription-manager-1.25.11-1.el8.x86_64
dnf-plugin-subscription-manager-1.25.11-1.el8.x86_64
subscription-manager-cockpit-1.25.11-1.el8.noarch
python3-subscription-manager-rhsm-1.25.11-1.el8.x86_64
subscription-manager-rhsm-certificates-1.25.11-1.el8.x86_64
tfm-rubygem-katello-3.12.0.1-11.master.el7sat.noarch
katello-3.12.0-0.5.master.el7sat.noarch
candlepin-2.6.6-1.el7sat.noarch

[root@hp-z220-06 ~]# syspurpose show
{
  "role": "HAHA",
  "service_level_agreement": "hahaha",
  "usage": "Production-haha"
}

[root@hp-z220-06 ~]# subscription-manager  status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- unsatisfied sla: hahaha
- unsatisfied usage: Production-haha
- unsatisfied role: HAHA

Comment 4 yanpliu 2019-06-26 03:21:17 UTC
RHEL-7.7-20190619.0 against Red Hat Satellite (build: 6.5.1) can reproduce this issue.


[root@cloud-qe-16-vm-05 ~]# syspurpose show
{}
System purpose successfully sent to subscription management server.

[root@cloud-qe-16-vm-05 ~]# syspurpose set-role 'Red Hat Enterprise Linux Server'
role set to Red Hat Enterprise Linux Server
System purpose successfully sent to subscription management server.

[root@cloud-qe-16-vm-05 ~]# syspurpose set-sla premium
service_level_agreement set to premium
System purpose successfully sent to subscription management server.

[root@cloud-qe-16-vm-05 ~]#  syspurpose set-usage 'Production'
usage set to Production
System purpose successfully sent to subscription management server.

[root@cloud-qe-16-vm-05 ~]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server", 
  "service_level_agreement": "premium", 
  "usage": "Production"
}
System purpose successfully sent to subscription management server.

[root@cloud-qe-16-vm-05 ~]# subscription-manager  status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched

Comment 5 qianzhan 2019-07-08 06:47:38 UTC
(In reply to qianzhan from comment #3)
> Verification on RHEL-8.1.0-20190619.2 against Satellite6.6-snapshot7.0:
> 
> subscription-manager-1.25.11-1.el8.x86_64
> dnf-plugin-subscription-manager-1.25.11-1.el8.x86_64
> subscription-manager-cockpit-1.25.11-1.el8.noarch
> python3-subscription-manager-rhsm-1.25.11-1.el8.x86_64
> subscription-manager-rhsm-certificates-1.25.11-1.el8.x86_64
> tfm-rubygem-katello-3.12.0.1-11.master.el7sat.noarch
> katello-3.12.0-0.5.master.el7sat.noarch
> candlepin-2.6.6-1.el7sat.noarch
> 
> [root@hp-z220-06 ~]# syspurpose show
> {
>   "role": "HAHA",
>   "service_level_agreement": "hahaha",
>   "usage": "Production-haha"
> }
> 
> [root@hp-z220-06 ~]# subscription-manager  status
> +-------------------------------------------+
>    System Status Details
> +-------------------------------------------+
> Overall Status: Current
> 
> System Purpose Status: Mismatched
> - unsatisfied sla: hahaha
> - unsatisfied usage: Production-haha
> - unsatisfied role: HAHA

As per comment 3, this bug can not be reproduced on RHEL-8.1.0-20190619.2 against Satellite6.6-snapshot7.0. But it still exists on RHEL-7.7-20190702.0 against Satellite6.6-snapshot10.0:

subscription-manager-1.24.13-1.el7.x86_64
package dnf-plugin-subscription-manager is not installed
subscription-manager-cockpit-1.24.13-1.el7.noarch
subscription-manager-rhsm-1.24.13-1.el7.x86_64
subscription-manager-rhsm-certificates-1.24.13-1.el7.x86_64
tfm-rubygem-katello-3.12.0.5-1.el7sat.noarch
katello-3.12.0-0.5.master.el7sat.noarch
candlepin-2.6.8-1.el7sat.noarch

[root@kvm-01-guest17 ~]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server", 
  "service_level_agreement": "self-support", 
  "usage": "production"
}
System purpose successfully sent to subscription management server.
[root@kvm-01-guest17 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched

Comment 6 qianzhan 2019-09-29 08:38:51 UTC
This bug does not exist on RHEL-7.8-20190927.1 against Satellite6.6-snapshot23.0:

subscription-manager-1.24.21-1.el7.x86_64
subscription-manager-rhsm-1.24.21-1.el7.x86_64
tfm-rubygem-katello-3.12.0.26-1.el7sat.noarch
katello-3.12.0-2.el7sat.noarch
candlepin-2.6.9-1.el7sat.noarch


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

System Purpose Status: Mismatched
- unsatisfied role: Red Hat Enterprise Linux Workstation
- unsatisfied usage: Disaster Recovery
- unsatisfied sla: badsla

Comment 7 Bryan Kearney 2020-05-01 14:15:21 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.