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 1818769 - subscription-manager auto-attach with service-level is not attaching the subscriptions at the first attempt
Summary: subscription-manager auto-attach with service-level is not attaching the subs...
Keywords:
Status: CLOSED DUPLICATE of bug 1816926
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.9
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-30 10:30 UTC by Shwetha Kallesh
Modified: 2020-04-09 11:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-03 07:43:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2240 0 None closed 1816926: Fix "attach --auto" command; ENT-2242 2021-02-01 17:34:50 UTC

Description Shwetha Kallesh 2020-03-30 10:30:11 UTC
Description of problem:
subscription-manager auto-attach with service-level is not attaching the subscriptions

Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.9.21-1
subscription management rules: 5.37
subscription-manager: 1.24.29-1.el7


How reproducible:


Steps to Reproduce:

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager service-level --show
Service level preference not set

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager attach --auto --servicelevel=Standard
Service level set to: Standard
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.
[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager service-level --show
Current service level: Standard

^^ Observe the service-level is set

Now lets verify if there are any subscriptions available matching installed product with service-level standard

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager list --avail --match-installed --matches="Standard"
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Server (Disaster Recovery), Standard (Physical or Virtual Nodes)
Provides:            dotNET on RHEL Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Ansible Engine
                     Red Hat Container Images Beta
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Container Images
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Beta
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Developer Toolset (for RHEL Server)
                     dotNET on RHEL (for RHEL Server)
SKU:                 RH00014
Contract:            12034262
Pool ID:             8a99f9ae6e3a9cac016e3b6552970043
Provides Management: No
Available:           199
Suggested:           1
Service Type:        L1-L3
Roles:               Red Hat Enterprise Linux Server
Service Level:       Standard                               ------> Notice the service level
Usage:               Disaster Recovery
Add-ons:             
Subscription Type:   Instance Based
Starts:              11/05/2019
Ends:                11/04/2020
Entitlement Type:    Physical

Subscription Name:   Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)
Provides:            dotNET on RHEL Beta (for RHEL Server)
                     Oracle Java (for RHEL Server)
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Ansible Engine
                     Red Hat Container Images Beta
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Container Images
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Beta
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Developer Toolset (for RHEL Server)
                     dotNET on RHEL (for RHEL Server)
SKU:                 RH00004
Contract:            12034266
Pool ID:             8a99f9ae6e3a9cac016e3b6555a00048
Provides Management: No
Available:           199
Suggested:           1
Service Type:        L1-L3
Roles:               Red Hat Enterprise Linux Server
Service Level:       Standard
Usage:               Production
Add-ons:             
Subscription Type:   Instance Based
Starts:              11/05/2019
Ends:                11/04/2020
Entitlement Type:    Physical

^^ There are subscriptions with service-level standard , but auto-attach is ignoring them


Actual results:
No subscription is attached

Expected results:
Subscription matching the service-level or with no service-level should be attached

Additional info:

Comment 2 Shwetha Kallesh 2020-03-30 10:53:03 UTC
Now try to auto-attach again now with a different service-level,

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager service-level --show
Current service level: Standard

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager attach --auto --servicelevel=Premium
All installed products are covered by valid entitlements. No need to update subscriptions at this time.
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager service-level --show
Current service level: Standard
^^ Notice that service-level is still Standard and is not changed to Premium even though premium service-level was supplied during auto-attach

[root@ibm-x3650m4-02-vm-06 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux, Standard Support (128 Sockets, NFR, Partner Only)
Provides:            Red Hat Enterprise Linux High Availability - Update Services for SAP Solutions
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Container Images
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Container Images Beta
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Developer Tools (for RHEL Workstation)
                     Red Hat Developer Tools Beta (for RHEL Workstation)
                     Red Hat Enterprise Linux for Power, little endian
                     Red Hat Enterprise Linux for IBM System z (Structure A)
                     dotNET on RHEL (for RHEL Server)
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Certification (for RHEL Server)
                     Red Hat Enterprise Linux for Real Time
                     Red Hat Directory Server
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Software Collections (for RHEL Client)
                     RHEL for SAP - Extended Update Support
                     Red Hat Software Collections (for RHEL Workstation)
                     Red Hat Enterprise Linux Server - Extended Life Cycle Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Software Collections Beta (for RHEL Client)
                     Red Hat Software Collections Beta (for RHEL Workstation)
                     Red Hat Enterprise Linux Desktop
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise Linux for Power, little endian - Extended Update Support
                     MRG Realtime
                     Red Hat Enterprise Linux High Performance Networking (for RHEL for IBM POWER)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL for IBM POWER) - Extended Update Support
                     Red Hat Enterprise Linux Scalable File System (for RHEL Compute Node)
                     Red Hat Developer Toolset (for RHEL Server)
                     RHEL for SAP Applications for Power BE
                     Red Hat Enterprise Linux Resilient Storage for IBM z Systems
                     RHEL for SAP Applications for Power BE EUS
                     Red Hat Developer Toolset (for RHEL Workstation)
                     Red Hat Enterprise Linux for SAP Applications for Power, little endian
                     RHEL for SAP Applications for Power LE EUS
                     Red Hat Enterprise Linux for SAP Applications for IBM z Systems
                     Red Hat Certificate System
                     RHEL for SAP Applications for System Z EUS
                     Red Hat Enterprise Linux for SAP HANA for Power, little endian
                     RHEL for SAP HANA for Power LE EUS
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Workstation
                     Red Hat Enterprise Linux for IBM z Systems
                     Red Hat Enterprise Linux for IBM z Systems - Extended Update Support
                     Red Hat Enterprise Linux for Power, big endian
                     Red Hat Enterprise Linux for Power, big endian - Extended Update Support
                     Red Hat Enterprise Linux for Scientific Computing
                     Red Hat Beta
                     Red Hat EUCJP Support (for RHEL Server)
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux High Availability (for IBM z Systems) - Extended Update Support
                     Red Hat Enterprise Linux Resilient Storage for IBM z Systems - Extended Update Support
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat CodeReady Linux Builder for Power, little endian - Extended Update Support
                     Red Hat Enterprise Linux High Availability for x86_64
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Developer Toolset (for RHEL Server EUS)
                     Red Hat CodeReady Linux Builder for IBM z Systems - Extended Update Support
                     Red Hat Developer Toolset (for RHEL for IBM POWER)
                     RHEL for SAP for Power, little endian - Extended Update Support
                     RHEL for SAP for IBM z Systems - Extended Update Support
                     RHEL for SAP HANA for Power, little endian - Extended Update Support
                     Red Hat Software Collections (for RHEL Server for ARM)
                     Red Hat Software Collections Beta (for RHEL Server for ARM)
                     Red Hat Hardware Certification Test Suite
                     Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
                     Red Hat Software Collections (for RHEL Server for IBM Power)
                     Red Hat Software Collections Beta (for RHEL Server for IBM Power)
                     Red Hat Software Collections (for RHEL Server for IBM Power LE)
                     Red Hat Software Collections Beta (for RHEL Server for IBM Power LE)
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Software Collections (for RHEL Server for System Z)
                     Red Hat Enterprise Linux Resilient Storage for x86_64
                     Red Hat Software Collections Beta (for RHEL Server for System Z)
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Scalable File System (for RHEL Workstation)
                     Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux for SAP HANA for x86_64
                     Oracle Java (for RHEL Client)
                     Oracle Java (for RHEL Compute Node)
                     Oracle Java (for RHEL Workstation)
                     Oracle Java (for RHEL Compute Node) - Extended Update Support
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Developer Tools (for RHEL Server for ARM)
                     Red Hat S-JIS Support (for RHEL Server)
                     Red Hat Developer Tools Beta (for RHEL Server for ARM)
                     RHEL for SAP HANA - Extended Update Support
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
                     Red Hat Developer Tools (for RHEL Server for IBM Power)
                     Red Hat Software Test Suite 5 (for RHEL Server)
                     Red Hat Developer Tools Beta (for RHEL Server for IBM Power)
                     Red Hat Developer Tools (for RHEL Server for IBM Power LE)
                     Red Hat Developer Tools Beta (for RHEL Server for IBM Power LE)
                     Red Hat Developer Tools (for RHEL Server for System Z)
                     Red Hat Developer Tools Beta (for RHEL Server for System Z)
                     Red Hat Ansible Engine
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat CodeReady Linux Builder for Power, little endian
                     Red Hat Enterprise Linux Server - Extended Life Cycle Support (for IBM z Systems)
                     Red Hat CodeReady Linux Builder for IBM z Systems
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Resilient Storage for Power, little endian
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
                     Red Hat Enterprise Linux Resilient Storage for IBM Power LE - Extended Update Support
                     Oracle Java (for RHEL Server) - AUS
                     Red Hat Enterprise Linux High Availability for Power, little endian
                     Red Hat Enterprise Linux High Availability (for IBM Power LE) - Extended Update Support
                     Red Hat Enterprise Linux Server (for IBM Power LE) - Update Services for SAP Solutions
                     RHEL for SAP (for IBM Power LE) - Update Services for SAP Solutions
                     RHEL for SAP HANA (for IBM Power LE) - Update Services for SAP Solutions
                     Red Hat Enterprise Linux High Availability (for IBM Power LE) - Update Services for SAP Solutions
                     Red Hat Enterprise Linux Server - Update Services for SAP Solutions
                     Red Hat Enterprise Linux for Power 9
                     Red Hat Enterprise Linux for SAP Applications for x86_64
                     Red Hat Enterprise Linux High Availability for IBM z Systems
                     RHEL for SAP - Update Services for SAP Solutions
                     RHEL for SAP HANA - Update Services for SAP Solutions
SKU:                 RH3310120
Contract:            12034259
Account:             6320620
Serial:              3133770948037449855
Pool ID:             8a99f9ae6e3a9cac016e3b67523c0075
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Standard                                                        -----------------------> Notice that service-level of the subscription attached is also Standard 
Usage:               
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              11/05/2019
Ends:                11/04/2020
Entitlement Type:    Virtual

So when you try auto-attach with --service-level option , 
1) it doesnot attach at the first go 
2) If you provide a different service-level during second attempt , the service-level is not considered


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