Bug 1995032

Summary: Subscription manager should accept multiple content views (Environment)
Product: Red Hat Enterprise Linux 9 Reporter: Rehana <redakkan>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: high Docs Contact:
Priority: high    
Version: 9.0CC: candlepin-bugs, cdonnell, jsefler, rhsm-qe
Target Milestone: betaKeywords: Triaged
Target Release: 9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.23-1.el9 Doc Type: Enhancement
Doc Text:
Feature: Multiple environments for use with a single consumer Reason: To give the administrator the ability to assign an ordered list of environments (content views) to a system at registration time and to change that list when it is deemed necessary. Result: For the Registration command, the option 'environment' will now be 'environments' and will support a comma-separated ordered list of environments. For the Environments command, there will be 3 new options: 'set', 'list-enabled', and 'list-disabled'. 'set' will allow an administrator to set a new list of environments for the system. 'list-enabled' will present an ordered list of environments currently assigned to the system. 'list-disabled' will present to an administrator a list of environments that belong to the organization but are not assigned to the system. For the identity command, the environments assigned to the system will be shown in the 'environments' field as a comma-separated ordered list.
Story Points: ---
Clone Of: 1994056 Environment:
Last Closed: 2022-05-17 15:58:12 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:
Bug Depends On: 1994056    
Bug Blocks:    

Comment 7 John Sefler 2022-02-01 22:39:48 UTC
Verifying subscription-manager-1.29.23-1.el9.x86_64 in RHEL compose RHEL-9.0.0-20220125.3...

**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
      Beaker Test information:
                         HOSTNAME=kvm-08-guest10.hv2.lab.eng.bos.redhat.com
                            JOBID=6229411
                         RECIPEID=11353064
                    RESULT_SERVER=
                           DISTRO=RHEL-9.0.0-20220125.3
                     ARCHITECTURE=x86_64
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
[root@kvm-08-guest10 ~]#
[root@kvm-08-guest10 ~]# rpm -q subscription-manager
subscription-manager-1.29.23-1.el9.x86_64
[root@kvm-08-guest10 ~]# rpm -q --changelog subscription-manager| grep 1995032
- 1995032: Use multiple environments (wpoteat)
- 1995032: Use multiple environments (wpoteat)
[root@kvm-08-guest10 ~]# 

Note: This new environments capability is visible in subscription-manager as a new "--environments" option in the register module (replacing the former "--environment" option)...

[root@kvm-08-guest10 ~]# subscription-manager register --help | grep "environment"
  --environments ENVIRONMENTS                                                 <=== NEW
                        register with a specific environment (single value) or
                        multiple environments (a comma-separated list) in the
                        environments is controlled by the entitlement server

Note: New options have also been added to the existing environments module...

[root@kvm-08-guest10 ~]# subscription-manager environments --help | grep environments -A1
usage: subscription-manager environments [OPTIONS]

Display the environments available for a user

--
  --set SET             set a comma-separated list of environments for this   <=== NEW
                        consumer
  --list                list all environments for the organization            <=== NEW
  --list-enabled        list the environments enabled for this consumer       <=== NEW
  --list-disabled       list the environments not enabled for this consumer   <=== NEW

Note: This new capability is dependent on the capabilities of the entitlement server which is not provided by the default hosted subscription.rhsm.redhat.com.

[root@kvm-08-guest10 ~]# subscription-manager register --environments="foo"
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: rhelentqe
Password: 
Error: Server does not support environments.
[root@kvm-08-guest10 ~]# 
[root@kvm-08-guest10 ~]# subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: rhelentqe
Password: 
The system has been registered with ID: 9f6750ca-be6f-427a-85d3-c1a4ff3be09f
The registered system name is: kvm-08-guest10.hv2.lab.eng.bos.redhat.com
[root@kvm-08-guest10 ~]# 
[root@kvm-08-guest10 ~]# subscription-manager environments --set="foo"
Error: Server does not support environments.
[root@kvm-08-guest10 ~]# 
[root@kvm-08-guest10 ~]# subscription-manager environments --list
Error: Server does not support environments.
[root@kvm-08-guest10 ~]# 
[root@kvm-08-guest10 ~]# subscription-manager environments --list-enabled
Error: Server does not support environments.
[root@kvm-08-guest10 ~]# 
[root@kvm-08-guest10 ~]# subscription-manager environments --list-disabled
Error: Server does not support environments.
[root@kvm-08-guest10 ~]# 

VERIFIED: For the sake of ON_QA verification, the RHEL composes targeting RHEL9.0 GA now include subscription-manager-1.29.23-1.el9 which includes support for multi-environment capable entitlement servers such as planned in the next release of Satellite.  More detailed testing comparable to comment 2 and comment 3 can occur against Satellite once it is updated with a "multi_environment" capable Candlepin server.

Comment 9 errata-xmlrpc 2022-05-17 15:58:12 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 (new packages: subscription-manager), 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-2022:3984