Warning message

Log in to add comments.

Subscription-manager for the former Red Hat Network User: Part 6 - understanding and improving the renewal experience

Rich Jerrido published on 2016-09-19T00:37:25+00:00, last updated 2016-09-20T17:04:13+00:00

Overview

Shipped in Red Hat Satellite 6.2.2 are a number of tools to improve the renewal experience.

Facts

  • Subscriptions are attached to systems.
  • Subscriptions grant access to content.
  • Without a valid subscription, a system cannot access content.

Renewals

What is a renewal?

A subscription renewal, for all effective purposes is when a subscription expires, and it is replaced with a new subscription. Renewals are at their core, a financial transaction between Red Hat and the customer, where the customer says "I would like quantity $X of THIS Red Hat product and quantity $Y of THAT Red Hat Product"

Co-terms

A Co-term is when a customer aligns their subscriptions to expires on the same date. This is generally done to:

  • To aid budgeting and procurement. It is easier in many cases to make one large purchase of Red Hat subscriptions than multiple purchases throughout the year.
  • Lower the number of operational changes. Since subscriptions grant access to content, support and various other Red Hat services, it is easier to have them all expire on the same date so that they are no unexpected surprises throughout the year.

These definitions are important and they influence how the tools behave.

Differences between Satellite 5 & 6 re: renewals

With Satellite 5, the expiration of the Satellite subscription governed the renewal behavior. Uploading an updated Satellite certificate was the only post-renewal step required. With Satellite 6, as subscriptions are directly attached to systems (and can expire independently of the Satellite subscription), we'd have to address each system (or groups of systems), when their subscriptions expire.

The renewal experience in Satellite 6.0 & 6.1

As I've noted above, in Satellite 6, subscriptions are attached to systems. This happens at a number of times:

  • At system registration interactively by the systems administrator.
  • At system registration via an Activation Key (a token that allows registration without a password)
  • via explicit action by the administrator.
  • via the auto-heal process, which aims to (re) attach a subscription to a system that does not currently have a valid subscription.

What happens when a subscription expires?

From a client perspective, when a system's subscription has expired, it no longer has access to content. How does this look at the client level?

We can simulate this by advancing the clock to a date after my subscription expires.

[root@crash-0001 ~]# service rhsmcertd stop
Redirecting to /bin/systemctl stop  rhsmcertd.service

[root@crash-0001 ~]# date -s "15 Sep 2017 00:00:00"
Fri Sep 15 00:00:00 UTC 2017

[root@crash-0001 ~]# date
Fri Sep 15 00:00:01 UTC 2017

[root@crash-0001 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)
Provides:            Red Hat Beta
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Container Images
                     Oracle Java (for RHEL Server)
                     Red Hat Container Images Beta
                     Red Hat Developer Toolset (for RHEL Server)
                     dotNET on RHEL (for RHEL Server)
                     dotNET on RHEL Beta (for RHEL Server)
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Software Collections Beta (for RHEL Server)
SKU:                 RH00004
Contract:            11002761
Account:             5699795
Serial:              6134168149732263852
Pool ID:             2c918093561eaa39015630f5b4f61685
Provides Management: No
Active:              False
Quantity Used:       1
Service Level:       Standard
Service Type:        L1-L3
Status Details:      Subscription is expired
Subscription Type:   Instance Based
Starts:              07/04/2016
Ends:                07/04/2017
System Type:         Physical

[root@crash-0001 ~]# yum repolist
Loaded plugins: product-id, subscription-manager
This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions.

*** WARNING ***
The subscription for following product(s) has expired:
  - Oracle Java (for RHEL Server)
  - Red Hat Beta
  - Red Hat Container Images
  - Red Hat Container Images Beta
  - Red Hat Developer Toolset (for RHEL Server)
  - Red Hat Enterprise Linux Atomic Host
  - Red Hat Enterprise Linux Atomic Host Beta
  - Red Hat Enterprise Linux Server
  - Red Hat Software Collections (for RHEL Server)
  - Red Hat Software Collections Beta (for RHEL Server)
  - dotNET on RHEL (for RHEL Server)
  - dotNET on RHEL Beta (for RHEL Server)
You no longer have access to the repositories that provide these products.  It is important that you apply an active subscription in order to resume access to security and other critical updates. If you don't have other active subscriptions, you can renew the expired subscription.  
repolist: 0

Attaching a new subscription can be done via subscription-manager, or via the UI. That's pretty straightforward at the single system level. Renewals can be challenging because making this change (attaching a new, valid subscription) on a large number of systems has been challenging workflow-wise. And if my subscriptions are co-termed (thus most/all of them expire at the same time), AND I have a rather diverse product mix, I may have a large amount of work to do.

Attaching subscriptions post renewal:

After my subscriptions are renewed (or my new subscriptions become active) there are a few things that I must usually do:

  • Import a new subscription manifest.
  • (re)attach subscriptions to each host, one by one via the UI.
  • (re)attach subscriptions to each activation key via the UI or Hammer (Satellite's CLI)

If you have a few systems which require a new subscription, this workflow is palatable. If you have a large number of systems, this was very painful. And since subscriptions provide access to content, you generally want to get subscriptions attached post-renewal as quickly as possible.

Sidebar: Auto-attach and you.

Understanding that there may be times where the system has invalid or expired subscriptions, clients are configured to periodically (every 24h by default) attempt to replace expired subscriptions. This process for many users, especially those with a fairly homogenous product mix, may be sufficient to attach a proper subscription to a system. Auto-attach uses heuristics such as the following to determine a proper subscription:

  • System Facts:
    • Number of sockets / cores.
    • Is the system physical or virtual, etc. I.e., let's try to attach a 2-socket sub to a 2-socket system. These are viewable via subscription-manager facts
    • On which hypervisor does a system run.
  • SLA - Service Level Agreement (which can be specified interactively OR via the subscription management system (Satellite 6.x/SAM/RHSM)
  • Product Certificate - Auto-attach uses the installed Product Certificates (which describe the product you have installed) and will select a subscription that matches.

Think of the auto-attach process as 'give me a subscription which covers this system from a Terms & Conditions perspective'. Auto-attach does not inherently know WHY a subscription was purchased for a specific system.
Something to note:

  • Assuming virt-who is properly configured (which for a renewing Satellite 6 customer it would be - because otherwise, how did you use subscriptions that required virt-who [like vDC]), a virtual guest, when auto-attaching a subscription will preferentially bind a subscription that covers both the hypervisor it resides on and itself. Thus the likelihood that a virtual machine (and its hypervisor) get subscriptions that cover them are pretty high.

For some customers who have large numbers of the same or similar subscriptions (or those who don't really care which system gets WHAT subscription, as long as it is valid) auto-attach can be rather useful. For example, a customer had:

  • ~ 75 Red Hat Enterprise Linux Virtual Datacenter Subscriptions.
  • ~ 300 Red Hat Enterprise Linux Physical or Virtual Subscriptions.

Post renewal, they did not have to do any manual work, as the vDC subscriptions were attached to the hypervisors, and the Physical or Virtual subscriptions were attached to their physical systems.

Not every customer has quite a simplistic product mix, so we still need tools to better guide systems to subscriptions.

Tools included with Satellite 6.2.2

Included in Satellite 6.2.2 are a number of tools to make working with subscriptions (and thus handling renewals) easier. 6.2.2 provides:

  • The ability to attach sub iteratively (via hammer host subscription attach)
  • The ability to bulk attach subs via the UI
  • The ability to attach subs via csv import (via hammer csv) *NOTE: pre-renewal action required as export needs to be taken before expiration

This tools are designed to allow the user to make large(r), more easily automated changes to the subscriptions that systems consume. Let's look at each of these:

The ability to attach sub iteratively via hammer

Previously, hammer (the Satellite CLI) did not have the ability to attach a subscription to a host directly. 6.2.2 extends the hammer host command with additional functionality

Firstly, lets see what subscriptions I have available.

hammer --output json subscription list --organization example
[
{
  "ID": 190,
  "UUID": "2c918093561eaa39015630f5ccc21d04",
  "Name": "Red Hat Enterprise Linux for Virtual Datacenters, Standard",
  "Contract": 11223344,
  "Account": 123456,
  "Support": "Standard",
  "Quantity": 100,
  "Consumed": 0,
  "End Date": "2017-05-28T03:59:59.000+0000",
  "Attached": 0
},
{
  "ID": 192,
  "UUID": "2c918093561eaa39015630f5cd841d56",
  "Name": "Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)",
  "Contract": 11223344,
  "Account": 123456,
  "Support": "Premium",
  "Quantity": 100,
  "Consumed": 1,
  "End Date": "2017-06-13T03:59:59.000+0000",
  "Attached": 1
}]

And lets search for systems that are invalid (not having a proper sub)

hammer host list --search "subscription_status = invalid"
---|------------------------------|------------------|----------------|--------------|------------------
ID | NAME                         | OPERATING SYSTEM | HOST GROUP     | IP           | MAC              
---|------------------------------|------------------|----------------|--------------|------------------
45 | cloudforms.Example.com       | RedHat 7.2       | Infrastructure | 172.17.0.6   | 00:50:56:90:1f:66
84 | devnode-146.example.com      | RedHat 7.2       | Wordpress      | 172.17.3.146 | 00:1a:4a:11:00:09
82 | virt-testing.example.com     | RedHat 7.1       | Development    | 172.17.3.106 | 00:50:56:90:60:7f
---|------------------------------|------------------|----------------|--------------|------------------

Attach a subscription

hammer host subscription attach --host devnode-146.example.com --quantity 2 --subscription-id 192
Subscription attached to the host successfully

And confirm that the subs were in fact attached.

hammer host list --search "subscription_status = invalid"
---|------------------------------|------------------|----------------|--------------|------------------
ID | NAME                         | OPERATING SYSTEM | HOST GROUP     | IP           | MAC              
---|------------------------------|------------------|----------------|--------------|------------------
45 | cloudforms.example.com       | RedHat 7.2       | Infrastructure | 172.17.0.6   | 00:50:56:90:1f:66
82 | virt-testing.example.com     | RedHat 7.1       | Development    | 172.17.3.106 | 00:50:56:90:60:7f
---|------------------------------|------------------|----------------|--------------|------------------

hammer host subscription can be used to iteratively attach subscriptions to systems, allowing the customer to easily attach subscriptions via the CLI, which can be automated however desired.

The ability to bulk attach subs via the UI.

In addition to the CLI tools mentioned above, the UI now has the ability to apply subscriptions to multiple systems at once. Again, much of the pain around renewals is that a large number of systems are without valid subscriptions AND it takes a long time to reattach them. Let's take an example:

  • I have 50 systems which require a RH00004 - Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes) subscription to be attached. Using the UI in Satellite 6.2.1 and earlier, I would need to:
  1. In the UI click on Hosts->Content Hosts.
  2. select the host in question.
  3. select the subscriptions tab.
  4. select the subscriptions option.
  5. select the add tab.
  6. select the subscriptions that I desire.
  7. select the add selected button.
  8. repeat steps 2-6 for every host.

Thus from end-to-end, I have a grand total of 301 clicks in the UI (1 to go to the content hosts page; 6 per host * 50) to accomplish this task. I'd have more steps if I had additional subscriptions to attach, or if I had more systems.

To accomplish this with Satellite 6.2.2's new UI tooling, I'd have to

  1. In the UI click on Hosts->Content Hosts.
  2. select the checkbox next to each host. (This is the 'long' way. You can more easily select large number of hosts by)
    • selecting all of the hosts using the checkbox at the top-left.
    • using a host collection to search for a subset of your systems, and then using select all Example
    • using any other search criteria to find hosts. Example, I want to find any host in my Infrastructure lifecycle environment that does not have a valid sub. I can use 'subscription_status = invalid && lifecycle_environment = Infrastructure ' as my search criteria Example
    1. Select 'bulk actions'
    2. select the 'subscriptions' tab
    3. select the desired subscription.
    4. select 'add selected'

The absolute worst case scenario is that I have 55 clicks in the UI to accomplish the task of attaching the subscription in question. NOTE: most users will have some type of search criteria that groups their systems, which would make the number of UI clicks significantly smaller, but to have an 'apples to apples' comparison between the two methods, I wanted to illustrate the worst case. Most normal cases would be between 8-10 clicks to attach a sub (or multiple subs) to a group of systems.

You can see a demo of the Bulk Subscription Attach functionality via this Youtube Video by Mike McCune from the Satellite engineering team.

The ability to attach subs via csv export / import

The last tool included with Satellite 6.2.2 is the ability to import/export via the hammer csv command. The new hammer command allows the user to export (pre-renewal or at any time) the state of the systems & activation keys (and their attached subscriptions).

This is useful in multiple ways:

  • Activation keys, which are used at registration time need to have the new subscriptions attached. It is useful to understand which subscriptions were previously attached.
  • I am a customer who is very particular about which systems get which subscriptions. In lieu of building custom automation (via the API or using the hammer functionality above), I can import the mapping of system to subscription via CSV (and edit via any spreadsheet tool [Google Sheets, LibreOffice Calc, Excel, etc] )

Firstly, I want to export the state of my systems and their attached subscriptions. I MUST do this pre-renewal, as I'd want to capture the subscription state prior to the subscriptions expire.

Ideally, this can be put into a cron job and run periodically

# hammer csv content-hosts --export --file content-hosts-export.csv --itemized-subscriptions --organization example

Next, let's take a look at an example system's output

#  grep devnode-137.example.com content-hosts-export.csv
devnode-137.example.com,example,Library,Wordpress View,"",Yes,,Red Hat Enterprise Linux Server 7.2,x86_64,1,1882236,1,"",69|Red Hat Enterprise Linux Server,"Red Hat Enterprise Linux Server with Smart Management, Standard (Physical or Virtual Nodes)",Red Hat,1,RH00009,11223344,123456,07/04/2016,07/04/2017

Now, I can edit this CSV to reflect my new subscriptions. I can replace old subs with new ones, change contract numbers, etc.

Let's remove its subscriptions to simulate a subscription expiration.

# hammer host subscription remove --host devnode-137.example.com --subscription-id 144
Subscription removed from the host successfully

Let's confirm that the subscription is removed

# hammer host list --search 'subscription_status = invalid'
----|------------------------------|------------------|----------------|--------------|------------------
ID  | NAME                         | OPERATING SYSTEM | HOST GROUP     | IP           | MAC              
----|------------------------------|------------------|----------------|--------------|------------------
41  | auth01.example.com           | RedHat 7.2       | Infrastructure | 172.17.0.2   | 52:54:00:cb:90:e6
42  | auth02.example.com           | RedHat 7.2       | Infrastructure | 172.17.0.4   | 52:54:00:9f:be:bf
45  | cloudforms.example.com       | RedHat 7.2       | Infrastructure | 172.17.0.6   | 00:50:56:90:1f:66
109 | crash-0001.example.com       | RedHat 7.1       | Development    | 172.17.0.115 | 00:1a:4a:16:01:5b
14  | devnode-102.example.com      | RHEL Server 6.7  | Cluster        | 172.17.3.102 | 00:1a:4a:11:00:ab
83  | devnode-137.example.com      | RedHat 7.2       | Wordpress      | 172.17.3.137 | 00:1a:4a:11:00:07
82  | virt-testing.example.com     | RedHat 7.1       | Development    | 172.17.3.106 | 00:50:56:90:60:7f
----|------------------------------|------------------|----------------|--------------|------------------

and now, let's go ahead and re-import the association of subscriptions to hosts. Note: this is the same command we ran above, minus the --export switch.

# hammer csv content-hosts --file content-hosts-export.csv --itemized-subscriptions --organization example

'Red Hat Cloud Infrastructure with Smart Management, Premium (2-sockets)' already attached...
'Red Hat Enterprise Linux Server, Premium (1-2 sockets) (Unlimited guests) with Smart Management' already attached...
'Red Hat Cloud Infrastructure, Premium (2-sockets)' already attached...
'Red Hat Enterprise Linux for Virtual Datacenters, Premium' already attached...
'Red Hat Satellite Capsule Server' already attached...
'Red Hat Enterprise Linux Server with Smart Management, Standard (Physical or Virtual Nodes)' already attached...
'Red Hat Satellite' already attached...
'Red Hat Satellite - Add-Ons for Providers' already attached...
'Red Hat Enterprise Linux Server with Smart Management, Standard (Physical or Virtual Nodes)' already attached...
'Red Hat Satellite - Add-Ons for Providers' already attached...
'Red Hat Satellite - Add-Ons for Providers' already attached...
'Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes)' already attached...
'Red Hat Enterprise Linux Server, Premium (1-2 sockets) (Unlimited guests) with Smart Management' already attached...
'Red Hat Cloud Infrastructure with Smart Management, Premium (2-sockets)' already attached...
'Red Hat Cloud Infrastructure with Smart Management, Premium (2-sockets)' already attached...
'Red Hat Cloud Infrastructure with Smart Management, Premium (2-sockets)' already attached...
'Red Hat Cloud Infrastructure, Premium (2-sockets)' already attached...
'Red Hat Enterprise Linux for Virtual Datacenters, Premium' already attached...

And see if the system is showing up with an invalid sub. It is not :)

# hammer host list --search 'subscription_status = invalid'
----|------------------------------|------------------|----------------|--------------|------------------
ID  | NAME                         | OPERATING SYSTEM | HOST GROUP     | IP           | MAC              
----|------------------------------|------------------|----------------|--------------|------------------
41  | auth01.example.com           | RedHat 7.2       | Infrastructure | 172.17.0.2   | 52:54:00:cb:90:e6
42  | auth02.example.com           | RedHat 7.2       | Infrastructure | 172.17.0.4   | 52:54:00:9f:be:bf
45  | cloudforms.example.com       | RedHat 7.2       | Infrastructure | 172.17.0.6   | 00:50:56:90:1f:66
109 | crash-0001.example.com       | RedHat 7.1       | Development    | 172.17.0.115 | 00:1a:4a:16:01:5b
14  | devnode-102.example.com      | RHEL Server 6.7  | Cluster        | 172.17.3.102 | 00:1a:4a:11:00:ab
82  | virt-testing.example.com     | RedHat 7.1       | Development    | 172.17.3.106 | 00:50:56:90:60:7f
----|------------------------------|------------------|----------------|--------------|------------------

You can see a demo of the CLI tools for Bulk Subscription Attach functionality via this Youtube Video by Mike McCune from the Satellite engineering team.

Notes / Tips:

  • Install hammer on a workstation / server with a UI (or at the least use a shared mountpoint/disk), this makes it easier to make changes in rapid succession.
  • hammer csv (activation-key|settings|subscriptions) can export info on Activation Keys, Settings & Subscriptions respectively.

Conclusion

With Satellite 6.2.2 there are a number of tools that help the end user with managing their subscriptions, both pre and post renewal. Depending on the use case / level of comfort, you can use one or more of these tools.

Further Reading

English

About The Author

richjerrido's picture

Rich Jerrido

Rich Jerrido, Red Hat Product Manager, is a “doer-of-all-things Red Hat Satellite,” including training, integration, enablement, documentation, and helping to identify product requirements. He serves as a technology expert, frequently speaking in web seminars and at industry events. With mor...
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.