

# Manage Linux subscriptions in License Manager
<a name="linux-subscriptions"></a>

With AWS License Manager, you can view and manage commercial Linux subscriptions that your Amazon EC2 instances use. You can track utilization of your Linux subscriptions for the AWS Regions and accounts in AWS Organizations that you've defined in your settings. License Manager gives you a comprehensive view of your running instances that use Linux subscriptions. It also indicates when an instance has more than one subscription defined.

The data that License Manager discovers is aggregated and displayed in the License Manager console and in the Amazon CloudWatch dashboard. You can also access your subscription data through the AWS CLI and the License Manager Linux subscription API or associated SDKs.

Linux license subscriptions can come from the following sources:

**Subscription-included AMIs**
+ Red Hat Enterprise Linux (RHEL)
+ RHEL Bring Your Own Subscription model (BYOS) with the Red Hat Cloud Access Program
+ SUSE Linux Enterprise Server
+ Ubuntu Pro subscription-included AMI

**Third-party subscription providers**
+ RHEL subscription from Red Hat Subscription Manager (RHSM)

Linux subscription discovery uses the eventual consistency model. A consistency model determines the manner and timing in which data is loaded and presented in your Linux subscriptions view. With this model, License Manager ensures that your Linux subscription data is updated periodically from your resources. In the event that some data is not ingested during these intervals, the information is delivered at the next metric emission. This behavior can delay resources, such as newly launched EC2 commercial Linux instances, from displaying in the Linux subscriptions dashboard.

**Note**  
It can take up to 36 hours for the initial resource discovery to complete, and up to 12 hours for newly launched instances to be discovered and reported. Once your resources are discovered, Amazon CloudWatch metrics are emitted hourly for Linux subscriptions data.

If your accounts are in AWS Organizations, you can register a member account as the delegated administrator. For more information, see [Delegated administrator settings in License Manager](delegated-administrator.md).

**Duplicate subscriptions detected**  
When License Manager detects two Linux subscriptions on the same EC2 instance, it sets the duplicate subscription alert. You can view and filter Linux subscription data from the **Instances** page in the License Manager console.

**Red Hat Enterprise Linux 7 Extended Lifecycle Support (RHEL 7 ELS) instances:** When you launch an instance from a subscription-included AMI for RHEL 7 ELS, you should still register your instance with Red Hat and consume an entitlement. In this case, License Manager reports a duplicate subscription, but that's the expected behavior.

**Other Red Hat Linux instances:** We recommend that you search the subscription inventory in the [Red Hat Hybrid Cloud Console](https://console.redhat.com/) to find out which subscriptions your instance consumes.

**Topics**
+ [Configure Linux subscription discovery in License Manager](linux-subscriptions-manage-discovery.md)
+ [View discovered instance data in License Manager](linux-subscriptions-instances-view.md)
+ [Billing information for Linux subscriptions in License Manager](linux-subscriptions-billing-information.md)
+ [Manage Amazon CloudWatch alarms for Linux subscriptions in License Manager](linux-subscriptions-usage-alarms.md)

# Configure Linux subscription discovery in License Manager
<a name="linux-subscriptions-manage-discovery"></a>

You can configure discovery of Linux subscriptions through the License Manager console, the AWS CLI, the License Manager Linux subscription API, or the associated SDKs. When you activate discovery of Linux subscriptions for the AWS Regions you specify, you can optionally extend discovery to your accounts in AWS Organizations. If you no longer want to track subscription utilization, you can also deactivate discovery.

**Note**  
You can discover and display up to 5,000 resources per account per AWS Region by default. To request an increase to these limits, use the [limit increase form](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase).

**Topics**
+ [Configure Linux subscription discovery](#linux-subscriptions-configure-discovery)
+ [Activate Red Hat Subscription Manager subscription discovery](#rhsm-subscription-discovery)
+ [Resource discovery status reasons](#linux-subscriptions-status-reasons)
+ [Deactivate discovery of Linux subscriptions](#linux-subscriptions-disable-discovery)

## Configure Linux subscription discovery
<a name="linux-subscriptions-configure-discovery"></a>

To configure Linux subscription discovery from the **Settings** page in the License Manager console, follow these steps:

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the navigation pane, choose **Settings**. This opens the **Settings** page.

1. Open the **Linux subscriptions** tab, and choose **Configure**. This opens the **Configure Linux subscriptions settings** panel.

1. Select the **Source AWS Regions** where Linux subscription discovery should run.

1. To aggregate subscription data across your accounts in AWS Organizations, select **Link AWS Organizations**. This option only appears if AWS Organizations is configured for your account.

1. Review and acknowledge the option that grants AWS License Manager permission to create a service-linked role for Linux subscriptions.

1. Choose **Save configuration**.

## Activate Red Hat Subscription Manager subscription discovery
<a name="rhsm-subscription-discovery"></a>

To retrieve subscription information from Red Hat Subscription Manager (RHSM) on your behalf, License Manager must provide your Red Hat customer account API credentials.

### Prerequisites
<a name="rhsm-subscription-discovery-prereq"></a>

Before you activate subscription discovery, make sure that you've met the following prerequisites.
+ Default discovery for Linux subscriptions must be activated for your AWS account before you can configure RHSM subscription discovery. If default discovery is **Not activated**, see [Configure Linux subscription discovery](#linux-subscriptions-configure-discovery).
+ If you use a corporate Red Hat login provided by your Organization Administrator, ensure that your login ID has the following roles and permissions assigned:
  + **Role:** Manage your subscriptions
  + **Permissions:** `View All`, or `View/Edit All`

  If your login ID doesn't have the required roles and permissions, contact your Red Hat portal Organization Administrator and request to add them to your login. For more information about Red Hat roles and permissions, see [Roles and Permissions for Red Hat Customer Portal](https://access.redhat.com/articles/1757953). For more information about how to contact your Red Hat Portal Organization Administrator, see [How do I know who my Organization Administrator is?](https://access.redhat.com/articles/customer-service-accounts#OrgAdmin) in the *Red Hat Customer Portal Knowledgebase*.
+ To activate RHSM subscription discovery, you must provide the Red Hat customer account API offline token, or an AWS Secrets Manager secret that contains the offline token. To get your offline token, follow the steps described in [Generating a new offline token](https://docs.redhat.com/en/documentation/subscription_central/1-latest/html-single/using_apis_in_red_hat_subscription_management/index#using-rhsm-apis-con) on the *Red Hat Documentation* website.
**Important**  
Your security is important to us. Your Red Hat offline access token is stored securely in Secrets Manager. License Manager uses your secret to generate a temporary access token each time it requests subscription details from Red Hat.

### Activation
<a name="rhsm-subscription-discovery-activate"></a>

To activate RHSM discovery from the **Settings** page in the License Manager console, follow these steps:

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the navigation pane, choose **Settings**.

1. On the **Settings** page, open the **Linux subscriptions** tab.

1. Choose **Edit** to update your Linux subscription settings. This opens the **Configure Linux subscriptions discovery** page.

1. To begin the activation process, select the **Activate Red Hat Subscription Manager (RHSM) discovery** check box. This displays the **Link RHSM account** panel.

1. Select the **Secret (Token)** option that applies for your secret, and follow remaining steps that depend on which option you choose.

1. 

**Option: Create a new secret – *recommended***  
Provide the Red Hat offline access token and let License Manager create the access secret in Secrets Manager on your behalf.

   1. Enter a name for your secret in **Secret name**.

   1. Paste your Red Hat offline access token into the **Offline token** box. Make sure that there are no extra spaces or line breaks before or after your token value. You can generate your Red Hat offline access token on the [Red Hat Subscription Manager API Tokens](https://access.redhat.com/management/api) page.

**Option: Select a secret**  
Select an existing secret in Secrets Manager that contains your Red Hat offline access token.

1. (optional) Add tags for your secret.

1. Select the check box at the bottom of the page to acknowledge that by activating Red Hat Subscription Manager discovery, you grant access to the AWS License Manager service to collect data that relates to Red Hat subscriptions used on Amazon EC2 instances.

1. Choose **Activate**.

## Resource discovery status reasons
<a name="linux-subscriptions-status-reasons"></a>

 AWS License Manager will display a status and a corresponding status reason for each AWS Region you choose to enable discovery for Linux subscriptions. The status reason will vary if you have linked Linux subscriptions with AWS Organizations: 
+ In progress
+ Successful
+ Failed

The status reason that displays for each Region you choose will show up to two status reasons at a time. The following table provides more detail:


| Status reason action | Description | 
| --- | --- | 
|  Account-onboard  | Onboarding a single account. | 
|  Account-offboard  | Offboarding a single account. | 
|  Org-onboard  | Onboarding an entire organization. | 
|  Org-offboard  | Offboarding an entire organization. | 

You can call the `UpdateServiceSettings` API and subsequently call the `GetServiceSettings` API to monitor the progress of enabling Linux subscriptions. Each status and status reason can apply to multiple Regions at once. The follow table provides more detail on the status and status reason:

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-manage-discovery.html)

## Deactivate discovery of Linux subscriptions
<a name="linux-subscriptions-disable-discovery"></a>

You can deactivate discovery of Linux subscriptions from the AWS License Manager settings page. However, if you have activated discovery for 

**Warning**  
If you disable discovery, all of your data previously discovered for Linux subscriptions will be removed from AWS License Manager.

**To disable discovery for Linux subscriptions**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, choose **Settings**.

1. On the **Settings** page, choose the **Linux subscriptions** tab and choose **Disable Linux subscription discovery**.

1. Enter **Disable** and then choose **Disable** to confirm deactivation.

1. (Optional) Remove the service-linked role used for Linux subscriptions. For more information, see [Delete a service-linked role for License Manager](https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-role.html).

1. (Optional) Disable trusted access between License Manager and your organization. For more information, see [AWS License Manager and AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-license-manager.html).

# View discovered instance data in License Manager
<a name="linux-subscriptions-instances-view"></a>

After License Manager completes the initial resource discovery process in your selected AWS Regions, you can view the results in the console. If you chose to link AWS Organizations, License Manager aggregates data from accounts across your organization. To view a list of instances with subscriptions that meet your filter criteria, navigate to the **Instances** section of the AWS License Manager console. The list displays the following key fields.
+ **Instance ID** – The ID of the instance.
+ **Status** – The status of the instance.
+ **Instance type** – The type of instance.
+ **Subscription** – The name of the license subscription that the instance uses.
+ **Duplicates alert** – Indicates that you have two different license subscriptions for the same software on your instance.
+ **Account ID** – The ID of the account which owns the instance.
+ **Region** – The AWS Region in which the instance resides.
+ **AMI ID** – The ID of the AMI used to launch the instance.
+ **Usage operation** – The operation of the instance and the billing code that is associated with the AMI. For more information, see [Usage operation values](conversion-types-windows.md#usage-operation-values).
+ **Product code** – The product code associated with the AMI used to launch the instance. For more information, see [AMI product codes](https://docs.aws.amazon.com/marketplace/latest/userguide/ami-getting-started.html#ami-product-codes).
+ **LastUpdatedTime** – The time in which the last discovery updated the instance details.

**Topics**
+ [View data for all instances](#linux-subscriptions-instances-view-all)
+ [View data for instances by subscription](#linux-subscriptions-instances-view-subscription)

## View data for all instances
<a name="linux-subscriptions-instances-view-all"></a>

You can view and filter Linux subscription data that License Manager discovered for the instances in your account or AWS Organizations, as follows.

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, under Linux subscriptions, choose **Instances**. This displays a list of instances with Linux subscription data.

1. (Optional) You can use the following filters to streamline your results:
   + Account
   + AMI ID
   + Duplicate subscription
   + Instance ID
   + Region
   + Product code
   + Usage operation

1. (Optional) Choose **Export view to CSV** to export data for all of your instances as a comma-separated values file (CSV).

## View data for instances by subscription
<a name="linux-subscriptions-instances-view-subscription"></a>

You can view data for all instances has have been aggregated across accounts in your organization within the chosen Regions.

**To view discovered data for instances with a specific subscription**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, under Linux subscriptions, choose **Subscriptions**.

1. Under the **Subscription name** column, choose the subscription you would like to view data for.

1. Choose the **Instances** tab and review the data as needed in the console. You can filter the data by:
   + Instance ID
   + Account
   + Region
   + AMI ID
   + Usage operation
   + Product code

1. (Optional) Choose **Export view to CSV** to export data for your instances with this subscription as a comma-separated values file (CSV).

# Billing information for Linux subscriptions in License Manager
<a name="linux-subscriptions-billing-information"></a>

Each commercial Linux subscription running on Amazon EC2 has billing information associated with the Amazon Machine Image (AMI). Commercial Linux subscriptions have Amazon EC2 usage operation, AWS Marketplace product code, or a combination of both. For more information, see [AMI billing information fields](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/billing-info-fields.html) in the *Amazon Elastic Compute Cloud User Guide for Linux Instances* and [AMI product codes](https://docs.aws.amazon.com/marketplace/latest/userguide/ami-getting-started.html#ami-product-codes) in the *AWS Marketplace Seller Guide*.




| Subscription name | Amazon EC2 usage operation | AWS Marketplace product code | Subscription type | 
| --- | --- | --- | --- | 
| Red Hat Enterprise Linux Server BYOS | RunInstances:00g0 | ✗ | Bring Your Own Subscription model (BYOS) | 
| Red Hat Enterprise Linux Server | RunInstances:0010 | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux with High Availability Add-on | RunInstances:1010 | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux with SQL Server Standard and High Availability | RunInstances:1014 | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux with SQL Server Enterprise and High Availability | RunInstances:1110 | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux with SQL Server Standard | RunInstances:0014 | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux with SQL Server Web | RunInstances:0210 | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux with SQL Server Enterprise | RunInstances:0110 | ✗ | EC2 subscription-included | 
| SUSE Linux Enterprise Server | RunInstances:000g | ✗ | EC2 subscription-included | 
| Red Hat Enterprise Linux for SAP with High Availability and Update Services | RunInstances:0010 | ✓ | AWS Marketplace subscription ¹ | 
| SUSE Linux Enterprise Server with SAP | ✗ | ✓ | AWS Marketplace subscription | 
| Ubuntu Pro | RunInstances:0g00 | ✓ | AWS Marketplace subscription | 
| Red Hat Enterprise Linux Workstation | ✗ | ✓ | AWS Marketplace subscription | 

¹ This subscription has both an Amazon EC2 usage operation and AWS Marketplace product code.

## Usage metrics for Linux subscriptions
<a name="linux-subscriptions-usage-metrics"></a>

The following metrics and dimensions are available for Linux subscriptions:


| Metric | Description | 
| --- | --- | 
| RunningInstancesCount |  The total number of instances running in the current account that are grouped by the subscription name, or by subscription name and Region. Units: Count Dimensions: `SubscriptionName`: The name of the subscription. `Region`: The Region where the resource using a commercial Linux subscription was discovered.  | 

# Manage Amazon CloudWatch alarms for Linux subscriptions in License Manager
<a name="linux-subscriptions-usage-alarms"></a>

The **Linux subscriptions** list page in the License Manager console shows the following key details, including the Amazon CloudWatch alarms that you have configured for each Linux subscription that License Manager found on your instances.
+ Subscription name
+ Subscription type
+ Number of running instances per subscription
+ Configured Amazon CloudWatch alarms

When you choose a Linux subscription from the list page, the **Usage metrics and alarms** tab displays data for that subscription. In this tab, Amazon CloudWatch dashboards display for the chosen subscription within the License Manager console. You can adjust the dashboard to encompass a certain time frame, or *evaluation range,* in hours, days, or a week from a selected date.

In the **Usage metrics and alarms** tab, each subscription has an **Alarms** section with the following details:
+ **Alarm name** – The name of the alarm.
+ **State** – The state of the alarm.
+ **Dimension** – The dimensions of the alarm. The dimension will include the AWS Region and instance type that was defined.
+ **Condition** – The condition of the alarm. The condition will include the comparison operator and alarm threshold value that was defined.

You can create CloudWatch alarms using the dimensions and conditions you define to track and alert based on your current subscription utilization. The Linux subscriptions console displays a summary of the subscription names in use, the subscription types, amount of running instances for each, and the alarm status.

The following are possible CloudWatch alarm states:
+ **OK** – The metric or expression is within the defined threshold.
+ **ALARM** – The metric or expression is outside of the defined threshold.
+ **INSUFFICIENT\$1DATA** – The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.

**Topics**
+ [Create a CloudWatch alarm for Linux subscriptions](#linux-subscriptions-alarms-create)
+ [Modify a CloudWatch alarm for Linux subscriptions](#linux-subscriptions-alarms-modify)
+ [Delete a CloudWatch alarm for Linux subscriptions](#linux-subscriptions-alarms-delete)

## Create a CloudWatch alarm for Linux subscriptions
<a name="linux-subscriptions-alarms-create"></a>

You can create alarms for each commercial Linux subscription that you have discovered on your running EC2 instances. If necessary, you can create multiple alarms with different dimensions and conditions for each subscription.

**To create a CloudWatch alarm for Linux subscriptions from the console**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, under Linux subscriptions, choose **Subscriptions**.

1. Under the **Subscription name** column, choose the subscription to create an alarm for, then choose **Create alarm**.

1. Specify the following for the alarm: 
   + **Alarm name** – specify a name which resembles `AWS-LM-LS-AlarmName`.
   + Instance type – choose an instance type that will be using the subscription that was selected.
   + Usage Region – choose the Regions to create the alarms for.
   + Comparison operator – the comparison operator for the alarm threshold.
   + Alarm threshold value – the value for the alarm threshold.

1. Choose **Create** to create the alarm. 

## Modify a CloudWatch alarm for Linux subscriptions
<a name="linux-subscriptions-alarms-modify"></a>

You can modify existing CloudWatch alarms from the License Manager console to adapt to changing requirements.

**To modify a CloudWatch alarm for Linux subscriptions from the console**Modifying an alarm

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, under Linux subscriptions, choose **Subscriptions**.

1. Under the **Subscription name** column, choose the subscription to modify, then choose **Edit**.

1. Modify the defined values as required.

1. Choose **Edit** to modify the alarm.

## Delete a CloudWatch alarm for Linux subscriptions
<a name="linux-subscriptions-alarms-delete"></a>

You can delete existing CloudWatch alarms from the License Manager console to adapt to changing requirements.

**To delete a CloudWatch alarm for Linux subscriptions from the console**

1. Open the License Manager console at [https://console.aws.amazon.com/license-manager/](https://console.aws.amazon.com/license-manager/).

1. In the left navigation pane, under Linux subscriptions, choose **Subscriptions**.

1. Under the **Subscription name** column, choose the subscription to modify, then choose **Delete**.