Chapter 3. Managing subscription usage

A system can be registered in three main ways:

  • On the local system
  • Through the Customer Portal, registered as an offline system
  • To an on-premise service such as Red Hat Satellite

3.1. Viewing available and used subscriptions in Red Hat Subscription Manager

To manage subscriptions, administrators need to know both what subscriptions are currently attached to a system and what subscriptions are available to the system. You can manage your usage from the Customer Portal from the Subscription Utilization page.

To manage subscriptions from the command line:

Table 3.1. Table 3.1 subscription-manager list Options

Command

Description

--installed (or nothing)

Lists all of the installed products on the system. If no option is given with 'list', it is the same as using the '--installed' argument.

--consumed

Lists all of the subscriptions attached to the system.

--available[-all]

Using '--available' alone lists all of the compatible, active subscriptions for the system. Using '--available --all' lists all options, even ones not compatible with the system.

sect-Red_Hat_Subscription_Management-Using_Red_Hat_Subscription_Management-Registering_and_Attaching_Subscriptions_Section_ --ondate=YYYY-MM-DD

Shows subscriptions which are active and available on the specified date. This is only used with the '--available' option. If this is not used, then the command uses the current date.

--installed

Lists all of the products that are installed on the system (and whether they have a subscription) and it lists all of the product subscriptions which are attached to the system (and whether those products are installed).

Example 3.1 'list' showing subscriptions consumed

[root@server1 ~]# subscription-manager list --consumed

+-------------------------------------------+
		Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	Red Hat Enterprise Linux Server
ContractNumber:     	1458961
SerialNumber:       	171286550006020205
Active:             	True
Begins:             	2009-01-01
Expires:            	2011-12-31

Example 3.2 'list' showing all available subscriptions

[root@server1 ~]# subscription-manager list --available --all

+-------------------------------------------+
		Available Subscriptions
+-------------------------------------------+


ProductName:            RHEL for Physical Servers
ProductId:              MKT-rhel-server
PoolId:                 ff8080812bc382e3012bc3845ca000cb
Quantity:               10
Expires:                2011-09-20


ProductName:            RHEL Workstation
ProductId:              MKT-rhel-workstation-mkt
PoolId:                 5e09a31f95885cc4
Quantity:               10
Expires:                2011-09-20

3.2. Stopping package list collection

The registration process automatically begins creating and maintaining a package list for the given subscription service. Since package lists are a core aspect of subscription maintenance, this data collection cannot be suspended. If it is necessary to prevent data collection on the system, then remove the system from the subscription management service.

  • Unregister the system.
  • Unregister the system and delete the entry from the Customer Portal.
  • Since package lists for systems registered in the portal are also stored in the portal subscription database, the entire system entry must be deleted for the information to be removed.
  • Unregister the system from the on-premise subscription service.

3.3. Using system purpose

System purpose is part of the subscription-manager family of command-line tools. As a system administrator, you use system purpose to record the intended use of a Red Hat Enterprise Linux (RHEL) system. Recording the intended use of your system ensures that the entitlement server automatically attaches the most appropriate subscription to your system and that the subscription service shows an accurate subscription utilization.

RHEL 8.6 and later enables you to manage and display system purpose attributes with only one tool by making the role, service-level, usage, and addons subcommands available under a single subscription-manager syspurpose command. The standalone syspurpose command is deprecated starting with RHEL 8.6. Starting with RHEL 9 Beta, the subscription-manager syspurpose command is the only way to use system purpose.

You can enter system purpose data in the following ways:

  • During composer image creation
  • During installation using the Anaconda GUI and Kickstart automation scripts
  • During runtime operations, such as using the command line

You can configure the system purpose role, usage, service-level, and addons attributes during or after the installation process. For more information, see Configuring system purpose in the RHEL guide Performing a standard RHEL installation.

3.3.1. Listing available values for system purpose attributes

As the root user, you can enter the subscription-manager syspurpose command and subcommand (role, usage, service-level, or addons) with the --list option to list available values for all system purpose attributes. To list the available values for a system purpose attribute, you must enter the command on a registered system or enter the command with authentication options on an unregistered system. The following examples show how to list the available system purposes values for the role attribute on registered and unregistered systems.

When the system is registered, enter the following command:

[root@localhost ~]# subscription-manager syspurpose role --list

When the system is unregistered, enter the following command with the --username, --password, --org, and --token authentication options, as required:

[root@localhost ~]# subscription-manager syspurpose role --list --username=<username> --password=<password> --org=<organization_ID> --token=<token>

where: The --username option specifies the name of a user with organization administrator authority in your Red Hat account. The --password option specifies the associated password. The --org option specifies the organization ID number. The --token option specifies the token of the virt-who service account.

Note

Specifying the organization ID is only required if you have multiple organizations and need to specify a particular organization.

Note

Specifying the token is only required if you have configured virt-who to connect to OpenShift Virtualization.

When you enter the command on a registered system or on an unregistered system with authentication options, the expected output is the list of available values for the role attribute:

+-------------------------------------------+
               Available role
+-------------------------------------------+
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node

System purpose addons are specific to your organization and do not appear in the list of available values. If you try to list available system purpose addons with the --list option on a registered system or on an unregistered system with authentication options, subscription-manager displays a warning message. For example:

# subscription-manager syspurpose addons --list
There are no available values for the system purpose "addons" from the available subscriptions in this organization.

3.3.2. Setting custom values for system purpose attributes

If the value you want to set is not included in the list of valid values for the account, you can enter a custom system purpose value with the --set option. To set a custom value, you must enter the command on a registered system or enter the command with authentication options on an unregistered system.

The following examples show how to set a custom value of “foo” for the system purpose role attribute on registered and unregistered systems.

When the system is registered, enter the following command:

[root@localhost ~]# subscription-manager syspurpose role --set=”foo”

When the system is unregistered, enter the following command with the --username, --password, --org, and --token authentication options, as required:

[root@localhost ~]# subscription-manager syspurpose role --set=”foo” --username=<username> --password=<password> --org=<organization_ID> --token=<token>

where: The --username option specifies the name of a user with organization administrator authority in your Red Hat account. The --password option specifies the associated password. The --org option specifies the organization ID number. The --token option specifies the token of the virt-who service account.

Note

Specifying the organization ID is only required if you have multiple organizations and need to specify a particular organization.

Note

Specifying the token is only required if you have configured virt-who to connect to OpenShift Virtualization.

When you set a custom value on a registered system or on an unregistered system with authentication options, the expected output displays a warning message because the custom value is considered invalid. However, the output also displays a confirmation message because subscription-manager sets the custom value despite the warning.

Warning: Provided value "foo" is not included in the list of valid values
 - Red Hat Enterprise Linux Workstation
 - Red Hat Enterprise Linux Server
 - Red Hat Enterprise Linux Compute Node
role set to "foo".
Important

Subscription-manager will only display the warning message when the system is registered or when you enter authentication credentials on an unregistered system. If your system is unregistered and you do not provide authentication options, subscription-manager will set the custom value without displaying the warning message.

3.4. Using module streams

Modules are a package organization mechanism which enables the user to choose from multiple versions of package sets. Modules combine features of groups and repositories. For example, it would allow a network to more frequently update some systems with the most recent version of one piece of software while keeping the version consistent on others.

The Anaconda installer can enable module streams and install module profiles.

3.4.1. Installing module profiles

Install module profiles to enable the module and stream combination and install multiple packages at once. Use the @module:stream/profile syntax in place of a package in the %packages section.

  • When a module has a default stream specified, you can leave it out. When the default stream is not specified, you must specify it.
  • When a module stream has a default profile specified, you can leave it out. When the default profile is not specified, you must specify it.
  • Installing a module multiple times with different streams is not possible.
  • Installing multiple profiles of the same module and stream is possible.

    When a module and a package group exist with the same name, the module takes precedence.
    The following values are possible in the _%packages_ section after introduction of modules:
    ----
    %packages

@^an_environment @a_group @module_with_default_stream @module_without_default_stream:stream_name @some_module:some_stream_name/profile_1 @some_module:some_stream_name/profile_2 a_package

3.4.1.1. %end

In Red Hat Enterprise Linux 8, modules are present only in the Application Stream repository. To list available modules, use the yum module list command on an installed Red Hat Enterprise Linux 8 system.

3.4.2. Enabling module streams

You can also enable modules and streams with a command.

Procedure

To enable a package module stream within kickstart script, use the module command:

module --name=NAME [--stream=STREAM]

In the command:

  • --name= Specifies a name of the module to enable. Replace NAME with the actual name.
  • --stream= Specifies a name of the module stream to enable. Replace STREAM with the actual name.