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 1838413 - SLA that is passed during register with --auto-attach is ignored/not set on the system
Summary: SLA that is passed during register with --auto-attach is ignored/not set on t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 2215071
TreeView+ depends on / blocked
 
Reported: 2020-05-21 06:00 UTC by Shwetha Kallesh
Modified: 2023-06-14 16:09 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2215071 (view as bug list)
Environment:
Last Closed: 2020-11-04 01:39:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2250 0 None closed Reduced REST API calls during register, when SLA is set; ENT-2229 2020-09-03 19:17:23 UTC
Red Hat Product Errata RHBA-2020:4460 0 None None None 2020-11-04 01:39:30 UTC

Description Shwetha Kallesh 2020-05-21 06:00:15 UTC
Description of problem:
SLA that is passed during register with --auto-attach is ignored/not set on the system

Version-Release number of selected component (if applicable):
[root@kvm-06-guest05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 3.1.11-1
subscription management rules: 5.39
subscription-manager: 1.27.3


How reproducible:


Steps to Reproduce:

Register with auto-attach and provide service-level :

[root@kvm-06-guest05 ~]# subscription-manager register --username=stage_auto_syspurpose001 --password=redhat --autosubscribe --servicelevel=Dev-Enterprise --force
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 265b2007-2daa-4a56-9d75-ecd96cb3c603
The registered system name is: kvm-06-guest05.hv2.lab.eng.bos.redhat.com
Service level set to: Dev-Enterprise                            ----------------->> Observe the message , "Service level set to: Dev-Enterprise"
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@kvm-06-guest05 ~]# syspurpose show
{}
^^ no service-level is set 
[root@kvm-06-guest05 ~]# subscription-manager service-level --show
Service level preference not set
^^ again same message that service-level is not set

[root@kvm-06-guest05 ~]# curl -ik -u stage_auto_syspurpose001:redhat --request GET "https://candlepin.dist.stage.ext.phx2.redhat.com/candlepin/consumers/265b2007-2daa-4a56-9d75-ecd96cb3c603?include=serviceLevel" --header  "Content-Type: application/json"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
x-candlepin-request-uuid: 7793b33e-74f2-4190-87f7-e1332ba50c5d
X-Version: 3.1.11-1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Thu, 21 May 2020 05:41:59 GMT

{"serviceLevel":""}
^^ no value is set on candlepin server


Now lets set sla using syspurpose command :
[root@kvm-06-guest05 ~]# syspurpose set-sla foobar
service_level_agreement set to "foobar".

[root@kvm-06-guest05 ~]# subscription-manager service-level --show
Current service level: foobar
^^ observe that service-level is set to 'foobar'

[root@kvm-06-guest05 ~]# syspurpose show
{
  "service_level_agreement": "foobar"
}
^^ observe that service-level is set to 'foobar'

Now lets set the sla using subscription-manager service-level tool:

[root@kvm-06-guest05 ~]# subscription-manager service-level --set foo
service_level_agreement set to "foo".

[root@kvm-06-guest05 ~]# syspurpose show
{
  "service_level_agreement": "foo"
}
^^ observe that service-level is set to 'foo'


Now lets try to register again and set service-level while registering with --auto-attach:

[root@kvm-06-guest05 ~]# subscription-manager register --username=stage_auto_syspurpose001 --password=redhat --autosubscribe --servicelevel=Dev-Enterprise --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
The system with UUID 265b2007-2daa-4a56-9d75-ecd96cb3c603 has been unregistered
All local data removed
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 08f4cb58-b8f8-4aea-b174-972785e0f6f4
The registered system name is: kvm-06-guest05.hv2.lab.eng.bos.redhat.com
Service level set to: Dev-Enterprise
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@kvm-06-guest05 ~]# syspurpose show
{
  "service_level_agreement": "foo"
}
^^ sla remains unchanged , the sla value passed during register with --auto-attach is not considered




Actual results:


Expected results:


Additional info:

Comment 1 Jiri Hnidek 2020-05-26 13:44:47 UTC
Hi,
I consider this issue as fixed this in master branch:

[root@localhost subscription-manager]# PYTHONPATH=./src:./syspurpose/src python -m subscription_manager.scripts.subscription_manager register --username admin --password admin --org admin --auto-attach --servicelevel="Debug"
Registering to: svice:8443/candlepin
The system has been registered with ID: 7d623e4f-4d5c-445d-a18c-0edf9439cc2e
The registered system name is: localhost.localdomain
Service level set to: Debug <================================== The SLA is set to "Debug"
Installed Product Current Status:
Product Name: SP Additional bits
Status:       Subscribed

[root@localhost subscription-manager]# cat /etc/rhsm/syspurpose/syspurpose.json 
{
  "service_level_agreement": "Debug" <========================= The SLA is also set to "Debug" in syspurpose.json
}

[root@localhost subscription-manager]# syspurpose show
{
  "service_level_agreement": "Debug"
}

Comment 4 Archana Pandey 2020-07-01 08:27:34 UTC
Reproducing isuue on subscription-manager: 1.27.3

Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-01-vm-06 arp]# subscription-manager  version
server type: This system is currently not registered.
subscription management server: 2.9.27-1
subscription management rules: 5.39
subscription-manager: 1.27.3

Steps to Reproduce:
[root@ibm-x3650m4-01-vm-06 /]# subscription-manager register --username=archana-1840859 --auto-attach --servicelevel=Dev-Enterprise --force
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: 2545901c-8ada-4d18-bd7f-3e32c95faf9f
The registered system name is: ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
Service level set to: Dev-Enterprise
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@ibm-x3650m4-01-vm-06 /]# 
root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{}  			                  <<<<<<<<<<<<<<<< service-level is not set

[root@ibm-x3650m4-01-vm-06 /]# subscription-manager service-level --show
Service level preference not set      	  <<<<<<<<<<<<<<<<  service-level is not set
[root@ibm-x3650m4-01-vm-06 /]# 
[root@ibm-x3650m4-01-vm-06 /]# curl -ik -u archana-1840859 --request GET "https://subscription.rhsm.stage.redhat.com/candlepin/consumers/2545901c-8ada-4d18-bd7f-3e32c95faf9f?include=serviceLevel" --header  "Content-Type: application/json"
Enter host password for user 'archana-1840859':
HTTP/1.1 200 OK
Server: openresty/1.15.8.3
Date: Wed, 01 Jul 2020 07:12:52 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
x-candlepin-request-uuid: fb006f95-f99a-4d22-bb2e-26ea77198cc4
X-Version: 3.1.14-1

{"serviceLevel":""}      	         <<<<<<<<<<<<<<  no value is set on candlepin server

setting sla using syspurpose command :

[root@ibm-x3650m4-01-vm-06 /]# syspurpose set-sla foobar
service_level_agreement set to "foobar".
[root@ibm-x3650m4-01-vm-06 /]# subscription-manager service-level --show
Current service level: foobar
[root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{
  "service_level_agreement": "foobar"
}

setting sla using subscription-manager service-level tool:

[root@ibm-x3650m4-01-vm-06 /]#  subscription-manager service-level --set foo
service_level_agreement set to "foo".
[root@ibm-x3650m4-01-vm-06 /]# 
[root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{
  "service_level_agreement": "foo"       <<<<<<<<<<<<<<<<   service-level is set to given value ‘foo’
}		

registering again and setting service-level while registering with –auto-attach:

[root@ibm-x3650m4-01-vm-06 /]# subscription-manager register --username=archana-1840859 --auto-attach --servicelevel=Dev-Enterprise --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
The system with UUID 2545901c-8ada-4d18-bd7f-3e32c95faf9f has been unregistered
All local data removed
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: 0dbae53e-82a1-41da-8cee-29250ec96938
The registered system name is: ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
Service level set to: Dev-Enterprise
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@ibm-x3650m4-01-vm-06 /]# syspurpose show

{
  "service_level_agreement": "foo"
}		 		^^^sla remains unchanged, the sla value passed during register with --auto-attach is not considered

===================================================================================================================================================================================


Verifying bug against subscription-manager-1.27.9-1.el8.x86_64

Version-Release number of selected component (if applicable):
Beaker Test information:
                         HOSTNAME=ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
                            JOBID=4393112
                         RECIPEID=8503882
                    RESULT_SERVER=
                           DISTRO=RHEL-8.3.0-20200630.n.0
                     ARCHITECTURE=x86_64

[root@ibm-x3650m4-01-vm-06 /]# subscription-manager  version
server type: This system is currently not registered.
subscription management server: 3.1.14-1
subscription management rules: 5.40
subscription-manager: 1.27.9-1.el8
[root@ibm-x3650m4-01-vm-06 /]# 

Steps for verification:

[root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{}
[root@ibm-x3650m4-01-vm-06 /]# subscription-manager register --username=archana-1840859 --auto-attach --servicelevel=Dev-Enterprise --force
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: ade01995-8bb7-441c-9a86-dde188b679b0
The registered system name is: ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
Service level set to: Dev-Enterprise
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{
  "service_level_agreement": "Dev-Enterprise"	<<<<<<<<<<<<  service-level is set to given value
}
[root@ibm-x3650m4-01-vm-06 /]# subscription-manager service-level --show
Current service level: Dev-Enterprise		<<<<<<<<<<<<  service-level is set to given value

[root@ibm-x3650m4-01-vm-06 /]# curl -ik -u archana-1840859 --request GET "https://subscription.rhsm.stage.redhat.com/candlepin/consumers/ade01995-8bb7-441c-9a86-dde188b679b0?include=serviceLevel" --header  "Content-Type: application/json"
Enter host password for user 'archana-1840859':
HTTP/1.1 200 OK
Server: openresty/1.15.8.3
Date: Wed, 01 Jul 2020 08:11:05 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
x-candlepin-request-uuid: e5c572ee-043e-459a-8ead-781c8bf0caeb
X-Version: 3.1.14-1

{"serviceLevel":"Dev-Enterprise"}		<<<<<<<<<<<<  service-level is set to given value
[root@ibm-x3650m4-01-vm-06 /]# 

setting sla using syspurpose command :

[root@ibm-x3650m4-01-vm-06 /]# syspurpose set-sla foobar
service_level_agreement set to "foobar".
[root@ibm-x3650m4-01-vm-06 /]# subscription-manager service-level --show
Current service level: foobar
[root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{
  "service_level_agreement": "foobar"
}

registering again and setting service-level while registering with –auto-attach:

[root@ibm-x3650m4-01-vm-06 /]# subscription-manager register --username=archana-1840859 --auto-attach --servicelevel=Dev-Enterprise --force
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
The system with UUID ade01995-8bb7-441c-9a86-dde188b679b0 has been unregistered
All local data removed
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: c11c166a-9385-438b-88c0-d917858460be
The registered system name is: ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
Service level set to: Dev-Enterprise
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@ibm-x3650m4-01-vm-06 /]# syspurpose show
{
  "service_level_agreement": "Dev-Enterprise"	<<<<<<<<<<<<  service-level is set to given value
}
[root@ibm-x3650m4-01-vm-06 /]# 


Actual results:
the sla value passed during register with --auto-attach is working as expected

Expected results:
the sla value passed during register with --auto-attach should set sla

Comment 7 errata-xmlrpc 2020-11-04 01:39:09 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 (subscription-manager bug fix and enhancement update), 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-2020:4460


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