Bug 1650974

Summary: System Purpose interferes with registration and attaching entitlements
Product: Red Hat Enterprise Linux 8 Reporter: Terry Bowling <tbowling>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 8.0CC: bcourt, jgalipea, jsefler, jwboyer, khowell, kwalker, tbowling, tdeanton, toracat
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-29 15:59:44 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:
Embargoed:

Description Terry Bowling 2018-11-18 11:21:09 UTC
Description of problem:

  1. Cannot register with Developer Subscription when System Purpose choices were selected during installation.

  2. With Employee subscription, I can register, but auto attach fails.

Version-Release number of selected component (if applicable):

subscription-manager-1.23.8-1.el8.x86_64

Comment 2 Terry Bowling 2018-11-18 11:41:51 UTC
#### Testing with Developer Subscription

I chose the following System Purpose values during installation.

[root@rhel8beta syspurpose]# cat /etc/rhsm/syspurpose/syspurpose.json 
{
  "role": "Red Hat Enterprise Linux Server",
  "service_level_agreement": "Premium",
  "usage": "Production"


I then tried to register my personal Developer Sub with the following errors:

[root@rhel8beta ~]# subscription-manager register  --username=USERNAME
Registering to: subscription.rhsm.redhat.com:443/subscription
Password: 
HTTP error (400 - Bad Request): Service level "Premium" is not available to units of organization 1218496.
[root@rhel8beta ~]# 
[root@rhel8beta ~]# 
[root@rhel8beta ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown

System Purpose Status: Unknown

#### Unsetting all of the System Purpose fields allowed things to work as expected

[root@rhel8beta syspurpose]# subscription-manager role --unset
role unset.
[root@rhel8beta syspurpose]# subscription-manager usage --unset
usage unset.
[root@rhel8beta syspurpose]# subscription-manager service-level --unset
service_level_agreement unset.
[root@rhel8beta syspurpose]# subscription-manager register  --auto-attach  --username=USERNAME
Registering to: subscription.rhsm.redhat.com:443/subscription
Password: 
The system has been registered with ID: 6cf4607b-26a3-4834-b90f-9b5b6f25b466
The registered system name is: rhel8beta.localdomain
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@rhel8beta syspurpose]# yum repolist
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs)                                                    3.7 MB/s | 6.7 MB     00:01    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs)                                                       4.7 MB/s | 2.7 MB     00:00    
Last metadata expiration check: 0:00:01 ago on Sat 17 Nov 2018 04:09:06 PM EST.
repo id                                                  repo name                                                                         status
rhel-8-for-x86_64-appstream-beta-rpms                    Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs)                     4,594
rhel-8-for-x86_64-baseos-beta-rpms                       Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs)                        1,686

Comment 11 Kevin Howell 2018-11-29 15:59:44 UTC
Because we will soften SLA requirements in Candlepin, for Satellite 6.5 and forward, this will not be an issue. If the customer attempts to register with an SLA that they don't have access to on an older Satellite, their registration will be blocked. This is working as SLA was originally designed. If the customer wishes to use RHEL8 with an older Satellite, then they must either set SLA properly or not set 

For subscription-manager, the real issue is bug 1621783, which must be fixed in order to have RHEL8 SLA values match expected SLA values for older Satellite.

There is a related change in Candlepin (server-side) to tolerate mismatching SLA; this is a behavior change in newer version of Candlepin, and will be present in Satellite 6.5 and later (and will be deployed to hosted soon).

Please reach out if you need clarification on this.

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