Subscription-Manager for the former RHN user, part 13: System Purpose

Updated -

Subscription-Manager for the former RHN user, part 13: System Purpose (or how I learned to love subscriptions again).

What is system purpose and why should I care about it?

There are many ways to define how to create a Red Hat Subscription, but our team (the Subscription Management Experience team) defines it as such.

Red Hat combines technology with:

  • Technical use case information (RHEL used as a Server)
  • Business use case information (for Disaster Recovery purposes)
  • Operational use case information (Premium vs Standard, L3 only versus L1-L3).

Choosing the right subscription is a matter of matching the products you need with the three pieces of usage defined above, in the amount that you need. The definition is simple, and can be used to articulate what is included in every Red Hat Subscription.

Two of the challenges we have had over the years in the subscription experience have been:

  1. How do I ensure that I get the right entitlement attached to a system?
  2. How do I understand my subscription utilization at an account level?

System Purpose was created to help solve both of those issues by allowing the administrator to reflect those technical, business, and operational use-cases in a simple manner.

Requirements:

  • Red Hat Satellite 6.5 or newer
  • Red Hat Customer Portal
  • Red Hat Enterprise Linux 8.0+ or 7.7+

System purpose is part of the subscription-manager family of tools, and is also exposed via the redhat_subscription Ansible module, the Web Console in RHEL8, Satellite, and Red Hat Subscription Management.

Now that we understand what system purpose is, let’s dive into how to use it.

Getting started with system purpose.

System purpose allows you to set various parameters about how the system is being used, which are persistent and are used by the subscription tooling for inventory purposes and to better guide a system to a proper subscription. If you’ve ever had a scenario where ‘auto-attach grabbed the ‘wrong’ sub’, system purpose helps with that. And by providing those technical, business, and operational use-cases, the subscription tooling can make more informed decisions.

  • ROLE - What is the workload running on the system?
    • E.g. ‘Red Hat Enterprise Linux Server’
  • SLA - What is the expected service level for this system?
    • E.g. Self-Support, Standard (business hours), Premium
  • USAGE - What is the scope of support for this system?
    • E.g Development (assistance with design), Production (assistance with installation and runtime issues)

Let’s walk through setting up system purpose on a new RHEL 8.3 system.

syspurpose 1

For this system, I plan to use it as a Server, so I select ‘Red Hat Enterprise Linux Server’ as its ROLE. I want to tag this system as ‘Premium’ for its Service Level Agreement - SLA, and I want Production Support so I select ‘Production’ as my USAGE.

syspurpose 2

In RHEL 8.2 (and newer) , you can register to Red Hat Subscription Management during installation, but for this example, we are going to skip that step.

After login, let’s take a look at the system purpose that was set during installation and get the system registered.

Firstly, let’s take a look at the various options available:

# syspurpose --help
usage: syspurpose [-h]
                  {set,unset,add,remove,set-role,unset-role,add-addons,remove-addons,unset-addons,set-sla,unset-sla,set-usage,unset-usage,show}
                  ...

System Syspurpose Management Tool

positional arguments:
  {set,unset,add,remove,set-role,unset-role,add-addons,remove-addons,unset-addons,set-sla,unset-sla,set-usage,unset-usage,show}
                        sub-command help
    set                 Sets the value for the given property
    unset               Unsets (clears) the value for the given property
    add                 Adds the value(s) to the given property
    remove              Removes the value(s) from the given property
    set-role            Set the system role to the system syspurpose
    unset-role          Clear set role
    add-addons          Add addons to the system syspurpose
    remove-addons       Remove addons from the system syspurpose
    unset-addons        Clear set addons
    set-sla             Set the system sla
    unset-sla           Clear set sla
    set-usage           Set the system usage
    unset-usage         Clear set usage
    show                Show the current system syspurpose

optional arguments:
  -h, --help            show this help message and exit

Let’s confirm that System Purpose Attributes we set during installation are applied.

# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "service_level_agreement": "Premium",
  "usage": "Production"
}

With system purpose defined, let’s register the system

subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: 
Password:
The system has been registered with ID: f4cc3ae4-5077-4f33-a710-a3d374705183
The registered system name is: syspurpose.example.com

Let’s take a look at the subscriptions in my account

+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat OpenShift Container Platform Broker/Master Infrastructure
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 OpenShift Enterprise Infrastructure
                     Red Hat Enterprise Linux Fast Datapath
                     Red Hat CloudForms
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Beta
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
                     Red Hat OpenShift Container Platform
                     Red Hat OpenShift Service Mesh
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     dotNET on RHEL (for RHEL Server)
                     Red Hat OpenShift Enterprise Client Tools
                     Red Hat CloudForms Beta
SKU:                 MCT2741
Contract:            
Pool ID:             8a85f9926ed5daef016efae43853718e
Provides Management: Yes
Available:           88
Suggested:           1
Service Type:        L1-L3
Roles:               
Service Level:       Layered
Usage:               
Add-ons:             
Subscription Type:   Stackable
Starts:              12/12/2019
Ends:                12/11/2020
Entitlement Type:    Physical


Subscription Name:   Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)
Provides:            dotNET on RHEL Beta (for RHEL Server)
                     Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Ansible Engine
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     Red Hat Container Images Beta
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Container Images
                     Red Hat Beta
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     dotNET on RHEL (for RHEL Server)
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Oracle Java (for RHEL Server)
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Developer Tools (for RHEL Server)
                     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 Enterprise Linux for x86_64 - Extended Update Support
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
SKU:                 RH00003
Contract:            12166233
Pool ID:             8a85f99970d04f150171086a1c483ad5
Provides Management: No
Available:           28
Suggested:           0
Service Type:        L1-L3
Roles:               Red Hat Enterprise Linux Server
Service Level:       Premium
Usage:               Production
Add-ons:             
Subscription Type:   Instance Based
Starts:              03/23/2020
Ends:                03/22/2021
Entitlement Type:    Physical

In this account, you can see that there are two subscriptions, and highlighted is each subscription’s system purpose parameters (ROLE, SLA, USAGE). These parameters are used, in addition to the system facts (sockets, cores, am I physical or virtual, etc, to guide a matching subscription to the system.

Now, let’s attach a subscription. When system purpose is defined, subscriptions which match the defined purpose attributes are STRONGLY preferred to others.

[root@syspurpose ~]# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

And check which subscription was attached.

subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)
Provides:            Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Container Images
                     Red Hat Container Images Beta
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
                     dotNET on RHEL (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Beta
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     Oracle Java (for RHEL Server)
                     Red Hat Software Collections (for RHEL Server)
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Red Hat Ansible Engine
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Server
SKU:                 RH00003
Contract:            12166233
Account:             5644938
Serial:              3955053163637465727
Pool ID:             8a85f99970d04f150171086a1c483ad5
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               Red Hat Enterprise Linux Server
Service Level:       Premium
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Instance Based
Starts:              03/23/2020
Ends:                03/22/2021
Entitlement Type:    Physical

Note how the subscription that was attached matches the system purpose attributes. We can confirm this with subscription-manager.

subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Matched

If you do not have a subscription which matches your requested system purpose attributes, a subscription which otherwise matches your system facts and installed products would still be attached to the system. However, the System Purpose Status for the system would be set to Mismatched

Lets’ see this in action.

Firstly, let’s remove any attached subscriptions:

subscription-manager remove --all
1 local certificate has been deleted.
1 subscription removed at the server.

Next, let’s set a USAGE value that neither of my subscriptions provide. In this example, I’ll set my USAGE to “Development/Test” to signify that I want Development Support

syspurpose set-usage "Development/Test"
usage set to "Development/Test".

Now, to (re) attach a subscription.

subscription-manager attach --auto
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

And let’s view the attached subscription:

subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)
Provides:            Red Hat CodeReady Linux Builder for x86_64
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Developer Tools (for RHEL Server)
                     Red Hat Container Images
                     Red Hat Container Images Beta
                     Red Hat Developer Tools Beta (for RHEL Server)
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended
                     Update Support
                     Red Hat Enterprise Linux for x86_64
                     Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
                     Red Hat Enterprise Linux for x86_64 - Extended Update Support
                     dotNET on RHEL (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update
                     Support
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Beta
                     Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
                     Oracle Java (for RHEL Server)
                     Red Hat Software Collections (for RHEL Server)
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
                     Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
                     Red Hat Ansible Engine
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Server
SKU:                 RH00003
Contract:            12166233
Account:             5644938
Serial:              6080372749607279725
Pool ID:             8a85f99970d04f150171086a1c483ad5
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               Red Hat Enterprise Linux Server
Service Level:       Premium
Usage:               Production
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   Instance Based
Starts:              03/23/2020
Ends:                03/22/2021
Entitlement Type:    Physical

While the same subscription was attached, let’s take a look at the system’s subscription status:

subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current

System Purpose Status: Mismatched
- The requested usage preference "Development/Test" is not provided by a currently consumed subscription.

So while the system has a valid subscription which provides access to content, its System Purpose Status is set to Mismatched, as there was not a subscription which matched the system purpose preference.

This is not only exposed in the CLI tooling, but also is exposed via the UI in RHSM and Satellite

syspurpose 3

System Purpose allows you to provide more information about how the system is being used to better guide our subscription tools to a matching subscription.

System Purpose and Subscription Watch:

In addition to the capabilities it provides in the realm of attaching subscriptions, System Purpose data is used by Subscription Watch to help our clients understand their aggregate subscription consumption.

For example, in Subscription Watch, the ability to filter via SLA is driven by the system purpose attributes which are set on hosts (via the CLI, Satellite or RHSM). It is key, if you wish to filter per SLA (and in the future USAGE, ROLE, and SERVICE TYPE), it is critical to set the system purpose attributes.

syspurpose 4

System Purpose and Simple Content Access

If Simple Content Access is in use, System Purpose Status is set to disabled, as in Simple Content Access mode, subscriptions are not attached to hosts.

subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Disabled
Content Access Mode is set to Organization/Environment Access. This host has access to content, regardless of subscription status.

System Purpose Status: Disabled

While the ‘better guide the system to a matching subscription’ part of system purpose is unused, it is still important to set those system purpose attributes as they are part of the inventory attributes which are sent to Subscription Watch, and will help you better understand your usage of Red Hat technologies.

Hopefully, this post has helped you to understand what System Purpose is, and how it helps to improve your subscription experience.

Comments