subscription-manager(8) Subscription Management subscription-manager(8)NAMEsubscription-manager - Registers systems to a subscription management
service and then attaches and manages subscriptions for software prod‐
ucts.
SYNOPSISsubscription-manager command [options]
DESCRIPTIONsubscription-manager is a client program that registers a system with a
subscription management service such as the Customer Portal Subscrip‐
tion Management service or on-premise Subscription Asset Manager.
Red Hat provides content updates and support by issuing subscriptions
for its products. These subscriptions are applied to systems; once a
subscription for a product is attached to a system, that system allowed
to install, update, and receive support for that software product. IT
administrators need to track these subscriptions and how they are
attached. This subscription management is a feature available for Red
Hat platforms version 5.7 (and later) and version 6.1 (and later).
For RHEL systems, content is delivered through the Red Hat Customer
Portal. Subscriptions and systems are managed globally through the Red
Hat subscription management service, which is integrated with the Cus‐
tomer Portal. Subscriptions are managed for the local system by using
the Red Hat Subscription Manager tool. Subscription Manager is a local
client which connects a system with the subscription management ser‐
vice.
subscription-manager is the command-line based client for the Red Hat
Subscription Manager tool.
Subscription Manager performs several key operations:
* It registers systems to the Red Hat subscription management
service and adds the system to the inventory. Once a system is
registered, it can receive updates based on its subscriptions to
any kind of software products.
* It lists both available and used subscriptions.
* It allows administrators to both attach specific subscriptions
to a system and remove those subscriptions.
Subscription Manager can be used to autoattach subscriptions to a sys‐
tem, as well. The subscription-manager command can even be invoked as
part of a kickstart process.
Available subscriptions are based on the specific information about the
system's architecture. A subscription is only considered available if
the platform and hardware can support that specific product.
Subscription Manager also collects and summarizes system facts related
to its hardware, operating system, and other characteristics. These
facts can be edited in the Subscription Manager configuration and dis‐
played through Subscription Manager.
There is also a Subscription Manager GUI, which can be invoked simply
by running subscription-manager-gui from the command line.
Subscription management is only available for RHEL 5.7/6.1 and later
systems. Older systems should register to Red Hat Network Classic using
the rhn_register command.
COMMANDS AND OPTIONSsubscription-manager has specific options available for each command,
depending on what operation is being performed. Subscription Manager
commands are related to the different subscription operations:
1. register
2. unregister
3. attach
4. auto-attach
5.remove
6. release
7. service-level
8. import
9. redeem
10. list
11. refresh
12. environments
13. repos
14. orgs
15. plugins
16. identity
17. facts
18. clean
19. config
20. version
21. status
COMMON OPTIONS
-h, --help
Prints the specific help information for the given command.
--proxy=PROXY
Uses an HTTP proxy. The PROXY name has the format hostname:port.
--proxyuser=PROXYUSERNAME
Gives the username to use to authenticate to the HTTP proxy.
--proxypass=PROXYPASSWORD
Gives the password to use to authenticate to the HTTP proxy.
REGISTER OPTIONS
The register command registers a new system to the subscription manage‐
ment service.
--username=USERNAME
Gives the username for the account which is registering the sys‐
tem; this user account is usually tied to the user account for
the content delivery system which supplies the content.
Optional, for user-based authentication.
--password=PASSWORD
Gives the user account password. This is required.
--serverurl=SERVER_HOSTNAME
Passes the name of the subscription service to register the sys‐
tem with. The default value, if this is not given, is the Cus‐
tomer Portal Subscription Management service, subscrip‐
tion.rhn.redhat.com. If there is an on-premise subscription
service such as Subscription Asset Manager, this parameter can
be used to submit the hostname of the subscription service. For
Subscription Asset Manager, if the Subscription Manager tool is
configured with the Subscription Asset Manager RPM, then the
default value for the --serverurl parameter is for the on-
premise Subscription Asset Manager server.
--baseurl=https://CONTENT_SERVICE:PORT/PREFIX
Passes the name of the content delivery service to configure the
yum service to use to pull down packages. If there is an on-
premise subscription service such as Subscription Asset Manager
or CloudForms System Engine, this parameter can be used to sub‐
mit the URL of the content repository, in the form
https://server_name:port/prefix. For example, https://sam.exam‐
ple.com:8088/sam.
--name=SYSTEM_NAME
Sets the name of the system to register. This defaults to the
hostname.
--consumerid=CONSUMERID
References an existing system inventory ID to reregister a sys‐
tem. The ID is used as an inventory number for the system in the
subscription management service database. If the subscriptions
data are lost or corrupted, reregistering the system restores
it.
--activationkey=KEYS
Gives a comma-separated list of product keys to use to redeem or
apply specific subscriptions to the system. This is used for
preconfigured systems, which may already have products installed
and subscriptions attached to that system. Activation keys are
issued by an on-premise subscription management service, such as
Subscription Asset Manager.
When the --activationkey option is used, it is not necessary to
use the --username and --password options, because the authenti‐
cation information is implicit in the activation key.
For example:
subscription-manager register --org="IT Dept" --activationkey=1234abcd
--auto-attach
Automatically attaches the best-matched, compatible subscrip‐
tions to this system.
--servicelevel=LEVEL
Sets the preferred service level to use with subscriptions added
to the system. Service levels are commonly premium, standard,
and none, though other levels may be available depending on the
product and the contract. This preference can only be used in
conjunction with the --auto-attach option, and then it is used
as one of the factors for matching subscriptions.
--force
Registers the system even if it is already registered. Normally,
any register operations will fail if the system is already reg‐
istered. With --force, the existing system entry is unregistered
first, all of its subscriptions are returned to the pool, and
then the system is registered as a new entry.
--org=ORG
Assigns the system to an organization. Infrastructures which are
managed on-site may be multi-tenant, meaning that there are mul‐
tiple organizations within one customer unit. A system may be
assigned manually to one of these suborganizations. When a sys‐
tem is registered with the Customer Portal, this is not
required. When a system is registered with an on-premise appli‐
cation such as Subscription Asset Manager, this argument is
required, even if there is only a single organization config‐
ured.
--environment=ENV
Registers the system to an environment within an organization.
--type=CONSUMERTYPE
Sets the type of unit to register. Most units in the inventory
will use the default value of system. For development or test
systems, this can be person , which indicates a personal
(rather than organizational) subscription. Other systems can be
candlepin for a local content service or domain for an IP
domain.
UNREGISTER OPTIONS
The unregister command removes a system's subscriptions and removes it
from the subscription management service.
This command has no options.
ATTACH OPTIONS
The attach command applies a specific subscription to the system.
--pool=POOLID
Gives the ID for the subscriptions pool (collection of products)
to attach to the system. This option is required, unless --auto
is used.
--quantity=NUMBER
Attaches a specified number of subscriptions to the system. Sub‐
scriptions may have certain limits on them, like the number of
sockets on the system or the number of allowed virtual guests.
It is possible to attach multiple subscriptions (or stacking
subscriptions) to cover the number of sockets, guests, or other
characteristics.
--auto Automatically attaches the best-matched compatible subscription
or subscriptions to the system.
--servicelevel=LEVEL
Sets the preferred service level to use with subscriptions
attached to the system. Service levels are commonly premium,
standard, and none, though other levels may be available depend‐
ing on the product and the contract. This preference can only be
used in conjunction with the --auto option, and then it is used
as one of the factors for matching subscriptions.
AUTO-ATTACH OPTIONS
The auto-attach command sets whether the ability to check, attach, and
update subscriptions occurs automatically on the system. Auto-attaching
subscriptions checks the currently-installed products, attached sub‐
scriptions, and any changes in available subscriptions every four hours
using the rhsmcertd daemon.
--enable
Enables the auto-attach option for the system. If there is any
change in the subscriptions for the system, any subscriptions
expire, or any new products are installed, then subscription-
manager detects the changes and automatically attaches the
appropriate subscriptions so that the system remains covered.
--disable
Disables the auto-attach option for the system. If auto-attach
is disabled, then any changes in installed products or subscrip‐
tions for the system (including expirations) must be addressed
manually by the administrator.
--show Shows whetehr auto-attach is enabled on the systems.
REMOVE OPTIONS
The remove command removes a subscription from the system. (This does
not uninstall the associated products.)
--serial=SERIALNUMBER
Gives the serial number of the subscription certificate for the
specific product to remove from the system. Subscription cer‐
tificates attached to a system are in a certificate, in
/etc/pki/entitlement/<serial_number>.pem. To remove multiple
subscriptions, use the --serial option multiple times.
--all Removes all of the subscriptions attached to a system.
RELEASE OPTIONS
The release command sets a sticky OS version to use when installing or
updating packages. This sets a preference for the minor version of the
OS, such as 6.2 or 6.3. This can prevent unplanned or unsupported oper‐
ating system version upgrades when an IT environment must maintain a
certified configuration.
--list Lists the available OS versions. If a release preference is not
set, then there is a message saying it is not set.
--set=RELEASE
Sets the minor (Y-stream) release version to use, such as 6.3.
--unset
Removes any previously set release version preference.
SERVICE-LEVEL OPTIONS
The service-level command displays the current configured service level
preference for products installed on the system. For example, if the
service level preference is standard, then a subscription with a stan‐
dard service level is selected when autoattaching subscriptions to the
system.
The service-level command does not set the service level for the
system; it only shows its current setting or available settings.
The service level preference must be set in the Subscription
Manager GUI.
--list Lists the available service levels.
--show Shows the system's current service-level preference. If a ser‐
vice level is not set, then there is a message saying it is not
set.
--unset
Removes any previously set service level preference.
IMPORT OPTIONS
The import command imports and applies a subscription certificate for
the system which was generated externally, such as in the Customer Por‐
tal, and then copied over to the system. Importing can be necessary if
a system is pre-configured in the subscription management service or if
it is offline or unable to access the subscription management service
but it have the proper, relevant subscriptions attached to the system.
--certificate=CERTIFICATE_FILE
Points to a certificate PEM file which contains the subscription
certificate. This can be used multiple times to import multiple
subscription certificates.
REDEEM OPTIONS
The redeem command is used for systems that are purchased from third-
party vendors that include a subscription. The redemption process
essentially autoattaches the pre-selected subscription that the vendor
supplied to the system.
--email=EMAIL
Gives the email account to send the redemption notification mes‐
sage to.
--locale=LOCALE
Sets the locale to use for the message. If none is given, then
it defaults to the local system's locale.
--org=ORG
Identifies the organization which issued the subscription being
redeemed.
LIST OPTIONS
The list command lists all of the subscriptions that are compatible
with a system. The options allow the list to be filtered by subscrip‐
tions that are used by the system or unused subscriptions that are
available to the system.
--all Lists all possible subscriptions that have been purchased, even
if they don't match the architecture of the system. This is used
with the --available option.
--available
Lists available subscriptions which are not yet attached to the
system.
--consumed
Lists all of the subscriptions currently attached to the system.
--installed
Lists products which are currently installed on the system which
may (or may not) have subscriptions associated with them, as
well as products with attached subscriptions which may (or may
not) be installed.
--ondate=YYYY-MM-DD
Sets the date to use to search for active and available sub‐
scriptions. The default (if not explicitly passed) is today's
date; using a later date looks for subscriptions which will be
active then. This is only used with the --available option.
--servicelevel
Displays the current preferred service level for the system.
Service levels commonly are none, standard, or premium. If a
service level is not set, then there is a message saying it is
not set.
REFRESH OPTIONS
The refresh command pulls the latest subscription data from the server.
Normally, the system polls the subscription management service at a set
interval (4 hours by default) to check for any changes in the available
subscriptions. The refresh command checks with the subscription manage‐
ment service right then, outside the normal interval.
This command has no options.
ENVIRONMENTS OPTIONS
The environments command lists all of the environments that have been
configured for an organization. This command is only used for organiza‐
tions which have a locally-hosted subscription or content service of
some kind, like Subscription Asset Manager. The concept of environments
-- and therefore this command -- have no meaning for environments which
use the Customer Portal Subscription Management services.
--username=USERNAME
Gives the username for the account to use to connect to the
organization account.
--password=PASSWORD
Gives the user account password. This is required.
--org=ORG
Identifies the organization for which to list the configured
environments.
REPOS OPTIONS
The repos command lists all of the repositories that are available to a
system. This command is only used for organizations which have a
locally-hosted content service of some kind, like Subscription Asset
Manager. With Red Hat's hosted content service, there is only one cen‐
tral repository.
--list Lists all of the repositories that are provided by the content
service used by the system.
--enable=REPO_ID
Enables the specified repository, which is made available by the
content sources identified in the system subscriptions. To
enable multiple repositories, use this argument multiple times.
--disable=REPO_ID
Disables the specified repository, which is made available by
the content sources identified in the system subscriptions. To
disable multiple repositories, use this argument multiple times.
ORGS OPTIONS
The orgs command lists all of the organizations which are available to
the specified user account. A multi-tenant infrastructure may have mul‐
tiple organizations within a single customer, and users may be
restricted to access only a subset of the total number of organiza‐
tions.
--username=USERNAME
Gives the username for the account to use to connect to the
organization account.
--password=PASSWORD
Gives the user account password. This is required.
--serverurl=SERVER_HOSTNAME
Passes the name of the subscription service to use to list all
available organizations. The orgs command will list all organi‐
zations for the specified service for which the user account is
granted access. The default value, if this is not given, is the
Customer Portal Subscription Management service, https://sub‐
scription.rhn.redhat.com:443. If there is an on-premise sub‐
scription service such as Subscription Asset Manager, this
parameter can be used to submit the hostname of the subscription
service, in the form [protocol://]servername[:port][/prefix].
For Subscription Asset Manager, if the Subscription Manager tool
is configured with the Subscription Asset Manager RPM, then the
default value for the --serverurl parameter is for the on-
premise Subscription Asset Manager server.
PLUGIN OPTIONS
The plugins command list the available subscription-manager plugins.
--list List the available subscription-manager plugins.
--listslots
List the available plugin slots
--listhooks
List the available plugin slots and the hooks that handle them.
--verbose
Show additional info about the plugins, such as the plugin con‐
figuration values.
IDENTITY OPTIONS
The identity command handles the UUID of a system, which identifies the
system to the subscription management service after registration. This
command can simply return the UUID or it can be used to restore the
registration of a previously-registered system to the subscription man‐
agement service.
--regenerate
Requests that the subscription management service issue a new
identity certificate for the system, using an existing UUID in
the original identity certificate. If this is used alone, then
the identity command also uses the original identity certificate
to bind to the subscription management service, using certifi‐
cate-based authentication.
--username=USERNAME
Gives the username for the account which is registering the sys‐
tem; this user account is usually tied to the user account for
the content delivery system which supplies the content.
Optional, for user-based authentication.
--password=PASSWORD
Gives the user account password. Optional, for user-based
authentication.
--force
Regenerates the identity certificate for the system using user‐
name/password authentication. This is used with the --regenerate
option. --regenerate alone will use an existing identity cer‐
tificate to authenticate to the subscription management service.
If the certificate is missing or corrupted or in other circum‐
stances, then it may be better to use user authentication rather
than certificate-based authentication. In that case, the --force
option requires the username or password to be given either as
an argument or in response to a prompt.
FACTS OPTIONS
The facts command lists the system information, like the release ver‐
sion, number of CPUs, and other architecture information.
--list Lists the system information. These are simple attribute: value
pairs that reflect much of the information in the /etc/sysconfig
directory
cpu.architecture: x86_64
cpu.core(s)_per_socket: 1
cpu.cpu(s): 2
cpu.cpu_family: 6
cpu.cpu_mhz: 1861.776
cpu.cpu_op-mode(s): 64-bit
cpu.cpu_socket(s): 2
cpu.hypervisor_vendor: KVM
cpu.model: 2
cpu.numa_node(s): 1
cpu.numa_node0_cpu(s): 0,1
cpu.stepping: 3
cpu.thread(s)_per_core: 1
cpu.vendor_id: GenuineIntel
cpu.virtualization_type: full
distribution.id: Santiago
distribution.name: Red Hat Enterprise Linux Workstation
distribution.version: 6.1
----
--update
Updates the system information. This is particularly important
whenever there is a hardware change (such as adding a CPU) or a
system upgrade because these changes can affect the subscrip‐
tions that are compatible with the system.
CLEAN OPTIONS
The clean command removes all of the subscription and identity data
from the local system without affecting the system information in the
subscription management service. This means that any of the subscrip‐
tions applied to the system are not available for other systems to use.
The clean command is useful in cases where the local subscription
information is corrupted or lost somehow, and the system will be rereg‐
istered using the register --consumerid=EXISTING_ID command.
This command has no options.
CONFIG OPTIONS
The config command changes the rhsm.conf configuration file used by
Subscription Manager. Almost all of the connection information used by
Subscription Manager to access the subscription management service,
content server, and any proxies is set in the configuration file, as
well as general configuration parameters like the frequency Subscrip‐
tion Manager checks for subscriptions updates. There are major divi‐
sions in the rhsm.conf file, such as [server] which is used to config‐
ure the subscription management service. When changing the Subscription
Manager configuration, the settings are identified with the format sec‐
tion.name and then the new value. For example:
server.hostname=newsubscription.example.com
--list Prints the current configuration for Subscription Manager.
--remove=section.name
Deletes the current value for the parameter without supplying a
new parameter. A blank value tells Subscription Manager to use
service default values for that parameter. If there are no
defaults, then the feature is ignored.
--section.name=VALUE
Sets a parameter to a new, specified value. This is commonly
used for connection settings:
* server.hostname (subscription management service)
* server.proxy
* server.proxy_port
* server.proxy_user
* server.proxy_password
* rhsm.baseurl (content server)
* rhsm.certFrequency
VERSION OPTIONS
The version command displays information about the current Subscription
Manager packages and whatever subscription service the system is regis‐
tered with. For example:
[root@server ~]# subscription-manager version
registered to: subscription.rhn.redhat.com
server type: subscription management service
subscription-manager: 1.1.2-1.el6
python-rhsm: 1.1.3-1.el6
This command has no options.
STATUS OPTIONS
The status command shows the current status of the products and
attached subscriptions for the system. If some products are not fully
covered or subscriptions have expired, then the status command shows
why subscriptions are not current.
[root@server ~]# subscription-manager status
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Valid
--ondate=DATE
Shows the system status for a specific date in the future. The
format of the date is YYYY-MM-DD.
[root@server ~]# subscription-manager status --ondate=2014-01-01
+-------------------------------------------+
System Status Details
+-------------------------------------------+
Overall Status: Insufficient
USAGEsubscription-manager has two major tasks:
1. Handling the registration for a given system to a subscrip‐
tion management service
2. Handling the product subscriptions for installed products on
a system
subscription-manager makes it easier for network administrators to
maintain parity between software subscriptions and updates and their
installed products by tracking and managing what subscriptions are
attached to a system and when those subscriptions expire or are
exceeded.
REGISTERING AND UNREGISTERING MACHINES
A system is either registered to a subscription management service --
which makes all of the subscriptions available to the system -- or it
is not registered. Unregistered systems necessarily lack valid software
subscriptions because there is no way to record that the subscriptions
have been used or to renew them.
The default subscription management service in the Subscription Manager
configuration is the Customer Portal Subscription Management service.
The configuration file can be edited before the system is registered to
point to an on-premise subscription management service like Subscrip‐
tion Asset Manager.
Systems are usually registered to a subscription management service as
part of their initial configuration, such as the firstboot or kickstart
process. However, systems can be registered manually after they are
configured, can be removed from a content service, or reregistered.
If a system has never been registered (not even during firstboot), then
the register command will register the system with whatever subscrip‐
tion management service is configured in the /etc/rhsm/rhsm.conf file.
This command requires, at a minimum, the username and password for an
account to connect to the subscription management service. If the cre‐
dentials aren't passed with the command, then subscription-manager
prompts for the username and password interactively.
When there is a single organization or when using the Customer Portal
Subscription Management service, all that is required is the user‐
name/password set. For example:
subscription-manager register --username=admin --password=secret
With on-premise subscription services, such as Subscription Asset Man‐
ager, the infrastructure is more complex. The local administrator can
define independent groups called organizations which represent physical
or organizational divisions (--org). Those organizations can be subdi‐
vided into environments (--environment). Optionally, the information
about what subscription service (--serverurl) and content delivery net‐
work (--baseurl) to use for the system registration can also be passed
(which overrides the Red Hat Subscription Manager settings). The server
and content URLs are usually configured in the Subscription Manager
configuration before registering a system.
subscription-manager register --username=admin --password=secret
--org="IT Dept" --environment="local dev" --serverurl=local-cloudforms.example.com --baseurl=https://local-cloudforms.example.com:8088/cfse
If a system is in a multi-tenant environment and the organization is
not provided with the registration request, registration fails with a
remote server error. In the rhsm.log, there will be errors about being
unable to load the owners interface.
Some information is assigned automatically. Subscription Manager auto‐
matically generates a unique ID for the system which is used by the
subscription management service and it assigns a unit type, which indi‐
cates what kinds of software are available for the system. The name for
the entry can be manually assigned (for use within an on-premise sub‐
scription service, for instance). A handful of subscriptions (such as
specialized servers for content or identity management) have their own
specific unit type. For example:
subscription-manager register --username=admin
--password=secret --type=system --name=server1
--org="IT Dept"
If a system is registered and then somehow its subscription information
is lost -- a drive crashes or the certificates are deleted or corrupted
-- the system can be reregistered, with all of its subscriptions
restored, by registering with the existing ID.
subscription-manager register --username=admin
--password=secret --consumerid=1234abcd
A system uses an SSL client certificate (its identity certificate) to
authenticate to the subscriptions system to check for updates or
changes to subscriptions. If the identity certificate is lost or cor‐
rupted, it can be regenerated using the identity command.
subscription-manager identity --regenerate
Using the --force option will prompt for the username and password for
the account, if one isn't given, and then return the new inventory ID
and the hostname of the registered system.
subscription-manager identity --force
Username: jsmith
Password:
eff9a4c9-3579-49e5-a52f-83f2db29ab52 server.example.com
A system is unregistered and removed from the subscription management
service simply by running the unregister command. Unregistering a sys‐
tem and removing its attached subscriptions can free up subscriptions
when a system is taken offline or moved to a different department.
subscription-manager unregister
An option with registration, --auto-attach, will automatically attach
the subscriptions pool which best matches the system architecture and
configuration to the newly-registered system. This option attaches sub‐
scriptions as part of the registration process, rather than separately
managing subscriptions.
subscription-manager register --username=admin --password=secret
--auto-attach
Autoattach also supports an option to set a preferred service level
with the selected subscriptions, the --servicelevel option. In this
case, the --servicelevel option sets a preference that helps the
autoattach process select appropriate subscriptions. For example, if
the preferred service level for a production server is premium, and
there are three matching subscriptions with different service levels
(none, standard, and premium), the autoattach process selects the sub‐
scription which offers a premium service level.
subscription-manager register --username=admin --password=secret
--auto-attach --servicelevel=premium
LISTING, ATTACHING, AND REMOVING SUBSCRIPTIONS FOR PRODUCTS
A subscription is essentially the right to install, use, and receive
updates for a Red Hat product. (Sometimes multiple individual software
products are bundled together into a single subscription.) When a sys‐
tem is registered, the subscription management service is aware of the
system and has a list of all of the possible product subscriptions that
the system can install and use. A subscription is applied to a system
when the system is attached to the subscription pool that makes that
product available. A system releases or removes that subscription
(meaning, it removes that subscription so that another system can use
that subscription count).
list command shows you what subscriptions are available specifically to
the system (meaning subscriptions which are active, have available
quantities, and match the hardware and architecture) or all subscrip‐
tions for the organization. Using the --ondate option shows subscrip‐
tions that are or will be active at a specific time (otherwise, it
shows subscriptions which are active today).
subscription-manager list --available --ondate=2012-01-31
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux
SKU: SYS0395
Pool Id: 8a85f981302cbaf201302d899adf05a9
Quantity: 249237
Service Level: None
Service Type: None
Multi-Entitlement: No
Ends: 01/01/2022
Machine Type: physical
The list command can also be used to show what products you currently
have installed, as a way of tracking what products you have versus what
subscriptions you have on the system.
subscription-manager list --installed
+-------------------------------------------+
Installed Product Status
+-------------------------------------------+
ProductName: Red Hat Enterprise Linux Server
Product ID: 69
Version: 6.3
Arch: x86_64
Status: Subscribed
Started: 07/26/2012
Ends: 08/31/2015
Attaching a subscription requires the ID for the subscription pool (the
--pool option). For example:
subscription-manager attach
--pool=ff8080812bc382e3012bc3845da100d2
As with the register command, the system can be autoattached to the
best-fitting subscriptions using the --auto option:
subscription-manager attach --auto
Autoattach also supports an option to set a preferred service level
with the selected subscriptions, the --servicelevel option. In this
case, the --servicelevel option sets a preference that helps the
autoattach process select appropriate subscriptions. For example, if
the preferred service level for a production server is premium, and
there are three matching subscriptions with different service levels
(none, standard, and premium), the autoattach process selects the sub‐
scription which offers a premium subscription.
subscription-manager attach --auto --servicelevel=premium
Some subscriptions define a count based on attributes of the system
itself, like the number of sockets or the number of virtual guests on a
host. You can combine multiple subscriptions together to cover the
count. For example, if there is a four socket server, you can use two
subscriptions for "RHEL Server for Two Sockets" to cover the socket
count. To specify the number of subscriptions to use, use the --quan‐
tity option. For example:
subscription-manager attach
--pool=ff8080812bc382e3012bc3845da100d2
--quantity=2
Removing subscription from a system releases the subscription back into
the pool. The system remains registered with the subscription manage‐
ment service. Each product has an identifying X.509 certificate
installed with it. To remove a subscription for a specific product,
specify the serial number (or numbers, in multiple --serial options) of
the certificate:
subscription-manager remove --serial=1128750306742160
Giving the remove command with the --all option removes every subscrip‐
tion the system has used.
REDEEMING EXISTING SUBSCRIPTIONS
Sometimes, a system may come pre-configured with products and subscrip‐
tions. Rather than attaching a pool and claiming a subscription, this
system simply needs to redeem its existing subscriptions.
After registration, subscriptions on pre-configured systems can be
claimed using the redeem command, which essentially autoattaches the
system to its pre-existing subscriptions.
subscription-manager redeem --email=admin@example.com --org="IT Dept"
VIEWING LOCAL SUBSCRIPTION & CONTENT PROVIDER INFORMATION
Red Hat has a hosted environment, through the Customer Portal, that
provides centralized access to subscription management and content
repositories. However, organizations can use other tools -- like Sub‐
scription Manager -- for content hosting and subscription management.
With a local content provider, the organization, environments, reposi‐
tories, and other structural configuration is performed in the content
provider. Red Hat Subscription Manager can be used to display this
information, using the environments, orgs, and repos commands.
subscription-manager repos --list
subscription-manager environments --username=jsmith
--password=secret --org=prod
subscription-manager orgs --username=jsmith
--password=secret
CHANGING SUBSCRIPTION MANAGER CONFIGURATION
The Subscription Manager CLI and GUI both use the /etc/rhsm/rhsm.conf
file for configuration, including what content and subscription manage‐
ment services to use and management settings like auto-attaching. This
configuration file can be edited directly, or it can be edited using
the config command. Parameters and values are passed as arguments with
the config command in the format --section.parameter=value , where sec‐
tion is the configuration section in the file: server, rhsm, or rhsm‐
certd.
For example, to change the hostname of the subscription management ser‐
vice host:
subscription-manager config --server.hostname=myserver.example.com
UPDATING FACTS
The information about a system, such as its hardware and CPU, its oper‐
ating system versions, and memory, are collected by Subscription Man‐
ager in a list of facts. Subscription Manager uses these facts to
determine what purchased subscriptions are compatible with the system.
Whenever these facts change (such as installing an additional CPU), the
facts can be updated immediately using the facts command.
subscription-manager facts --update
The collected facts can also be overridden by creating a JSON file in
the /etc/rhsm/facts/ directory. These have simple formats that define a
fact and value:
{"fact1": "value1","fact2": "value2"}
Any fact override file must have a .facts extension.
When these fact files are added, running the facts command will update
the collected facts with the new, manual facts or values.
SUBSCRIPTIONS AND KICKSTART
The subscription-manager tool can be run as a post-install script as
part of the kickstart installation process. This allows subscription
management (registing and applying subscriptions) to be automated along
with installation. For example:
%post --log=/root/ks-post.log
/usr/sbin/subscription-manager register --username admin --password secret --org 'east colo' --auto-attach --servicelevel=premium --force
FILES
* /etc/pki/consumer/*.pem
* /etc/pki/entitlement/<serial>.pem
* /etc/pki/product/*.pem
* /etc/rhsm/rhsm.conf
* /etc/rhsm/facts/*.facts
AUTHORS
Deon Lackey, <dlackey@redhat.com>, and Pradeep Kilambi, <pkilambi@red‐
hat.com>
version 2.7 May 23, 2013 subscription-manager(8)