Chapter 2. Registering the a system using Red Hat Subscription Management
Software delivery, support, and other services for Red Hat products are managed through a subscription service. A subscription service tracks systems and the subscriptions attached to those systems.
A system is recognized by the system after being registered with the service. A subscription is associated or _attached to a system. Systems can then be _registered with a subscription service during the firstboot process or as part of the kickstart setup (both described in the Red Hat Enterprise Linux Installation guides).
Systems can also be registered after they have been configured or removed from the subscription service inventory (unregistered) if they will no longer be managed within that subscription system.
Additional Resources
2.1. Registering a system from the command line
Use the 'register' command while logged in with your Customer Portal credentials. When the system is successfully authenticated, it echoes back the newly-assigned system inventory ID and your Customer Portal account.
You can use the 'auto-attach option', which allows the system to be registered to the Customer Portal and immediately attaches a subscription which best matches the system’s architecture. Using this option depends on your subscription catalog and your organization’s needs.
Procedure
- Open Terminal.
- Enter 'subscription manager register --username admin-example --password password-example'
Example 2.1 Registering a system to the Customer Portal
[root@server1 ~]# subscription-manager register --username admin-example --password secret The system has been registered with id: 7d133d55-876f-4f47-83eb-0ee931cb0a97+'
Example 2.2 Registering a system to the Customer Portal using auto-attach
[root@server1 ~]# subscription-manager register --username admin-example --password secret --auto-attach
2.2. Registering an offline system
Administrators may want to attach and track subscriptions for a system with limited connectivity or inconsistent access to the Internet. To register an offline or "air-gapped" system, you need to manually create a system profile using Red Hat Subscription Management in the Customer Portal.
This profile serves as a placeholder and is not connected to your actual system until it can access the Internet again.
Procedure
- Create a system profile. From the systems page in RHSM, click the New button. Provide the required information to finish creating the new system profile.
- Attach subscriptions. In your newly created system profile, click the Subscriptions tab, and attach any subscriptions you want to use with the system.
Download and import the entitlement certificate(s). From the Subscriptions tab on your system profile, click Download Certificates to download the entitlement certificate(s) for attached subscriptions. The downloaded file will be in zip format. Extract the content and in /export/entitlement_certificates/ folder you will find the certificate xyz.pem. Move it to the client system’s /tmp directory.
# subscription-manager import --certificate=/tmp/Name_Of_Downloaded_Entitlement_Cert.pem
2.3. Unregistering a system
The only thing required to unregister a machine is to run the unregister command. This removes the system’s entry from the subscription service, removes any subscriptions, and, locally, deletes its identity and subscription certificates. From the command line, this requires only the 'unregister; command.
Procedure
- Open a Terminal window.
- Enter the command:
# subscription-manager unregister
Confirm the system has been unregistered.
# Unregistering from: subscription.rhsm.redhat.com:443/subscription # System has been unregistered
2.4. Restoring a registration
There are times when the local registration and subscription information could be lost or corrupted. There could be a hardware failure or system crash. Or other IT considerations may require that a system be moved to a different machine. Whatever the reason, the local subscription configuration is lost.
A system can be registered against an existing system entry in the Red Hat subscription service, which essentially restores or reregisters that system. The reregister operation uses the original system ID with the registration request, so that all of the previous subscriptions associated with the system entry are restored along with the registration.
Procedure
- Open a Terminal window.
Enter the command:
# subscription-manager register
Enter your Customer Portal credentials.
# Registering to: subscription.rhsm.redhat.com:443/subscription # Username: USERNAME # Password: PASSWORD
Confirm that your system has been re-registered:
# The system has been registered with ID: abcdef123456 # The registered system name is: localhost.localdomain
Attach the system to a valid entitlement.
# subscription-manager attach
Verify the system has been re-attached:
# Installed Product Current Status: # Product Name: Red Hat Enterprise Linux for x86_64 # Status: Subscribed
2.5. Red Hat Subscription Manager commands for the command line interface
Red Hat Subscription Manager has specific commands that can be used to help maintain your systems using the command line interface.
2.5.1. Red Hat Subscription Manager operational Commands
Table 2.1. Operational Commands
Command | Description |
---|---|
register | Registers or identifies a new system to the subscription service. |
unregister | Unregisters a machine, which strips its subscriptions and removes the machine from the subscription service. |
attach | Assigns a specific subscription to the machine. |
remove | Removes a specific subscription or all subscriptions from the machine. |
redeem | Autosubscribes a machine to a pre-specified subscription that was purchased from a vendor, based on its hardware and BIOS information. |
import | Manually installs a subscription certificate, rather than contacting the subscription service with a request and then receiving the certificate. |
list | Manually installs a subscription certificate, rather than contacting the subscription service with a request and then receiving the certificate. |
2.5.2. Red Hat Subscription Manager register commands
Table 2.2. Register Commands
Option | Description | Required |
--username=name | Gives the content server user account name. | Required |
--password=password | Gives the password for the user account. | Required |
--baseurl=URL | Gives the hostname of the content delivery server to use to receive updates. Red Hat Subscription Management and use Red Hat’s hosted content delivery services, with the URL https://cdn.redhat.com. Since Red Hat Satellite hosts its own content, the URL must be used for systems registered with Red Hat Satellite. | Required for Red Hat Satellite |
--org=name | Gives the organization to which to join the system. | Required except within hosted environments |
--environment=name | Registers the system to an environment within an organization. | OptionalGUI |
--name=machine_name | Sets the name of the system to register. This defaults to be the same as the hostname. | Optional |
--auto-attach | Automatically attaches the best-matched compatible subscription. This is good for automated setup operations, since the system can be configured in a single step. | OptionalGUI |
--activationkey=key | Attaches existing subscriptions as part of the registration process. | Optional |
--SLA=None | Standard | Premium |
Sets the service level to use for subscriptions on that machine. | Optional | --release=NUMBER |
Sets the operating system minor release to use for subscriptions for the system. Products and updates are limited to that specific minor release version. This is used only used with the '--auto-attach' option. | Optional | --force |
Registers the system even if it is already registered. Normally, any register operations will fail if the machine is already registered. | Optional | --type=TYPE |
Sets what type of consumer is being registered. The default is system, which is applicable to both physical systems and virtual guests. Other types include hypervisor for virtual hosts, person, domain, rhui, and candlepin for some subscription management applications. | Optional | --role=Workstation |
Server | Sets the role of the system where the software is being consumed. | Optional |
--usage=Development | Production | Sets the usage for the system where the software is being consumed. |
2.5.3. Red Hat Subscription Manager re-register command options
Table 2.3. Re-Register Commands
Option | Description |
--consumerid | Gives the system UUID used by an existing system. The system’s entry must exist in the Red Hat subscription service for the reregister operation to succeed. |
--username=name | Gives the content server user account name. |
--password=password | Gives the password for the user account. |
2.5.4. Red Hat Subscription Manager configuration commands
Table 2.4. Configuration Commands
Command | Description |
---|---|
config | Modifies a specified configuration parameter in the configuration file, '/etc/rhsm/rhsm.conf'. The parameters are passed in the form -configuration_area.parameter="value"-. |
service-level | Sets the service-level preference for the system to use when selecting subscriptions in autoattach operations. |
release | Sets the operating system release version preference for the system to use when selecting subscriptions in autoattach operations. |
refresh | Pulls the latest subscription data from the server. Normally, the system polls the subscription server at a set interval (four hours by default) to check for any changes in the available subscriptions. The 'refresh' command checks with the subscription server immediately, outside the normal interval. |
clean | Removes all of the subscription and identity data from the local system without affecting the consumer information in the subscription service. Any of the subscriptions consumed by the system are still consumed and 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 reregistered using the 'register --consumerid=EXISTING_ID' command. |
2.5.5. Red Hat Subscription Manager informative commands
Table 2.5. Informative Commands
Command | Description |
version | Returns the version of the local client, the name of the subscription service the system is registered with, and the version of the subscription service. |
identity | Handles the identity certificate and registration ID for a system. This command can be used to return the current UUID or generate a new identity certificate. |
facts | Lists the system information, like the release version, number of CPUs, and other architecture information. |
orgs, repos, environments | Lists all of the configured organizations, environments, and content repositories that are available to the given user account or system. These commands are used to view information in a multi-org infrastructure. They are not used to configure the local machine or multi-org infrastructure. |