The Red Hat Enterprise Linux (RHEL) 2013 packaging model provides a more flexible and intuitive way of managing your RHEL system entitlements. This is one of a set of articles (all available at Overview of Red Hat Enterprise Linux 2013 Packaging Model) that describes different RHEL configurations and how to use tools to entitle your RHEL systems and view the results with the 2013 packaging model.

This scenario describes the situation where you have a non-RHEL host system, such as VMware or HyperV host, with which you want to use an unlimited number of RHEL virtual machines. We refer to this configuration as a "Virtual Datacenter." The following figure illustrates this type of configuration:

Configuring Datacenter Subscriptions

Configuring Datacenters Subscriptions

Assigning a physical datacenter subscription to a virtualization datacenter lets you entitle hypervisors in that datacenter to host an unlimited number of Red Hat Enterprise Linux (RHEL) virtual machines. Using the virt-who service, you can query different virtual datacenters to find and register the hosts in those datacenters to use unlimited datacenter subscriptions. The virt-who service lets you register the following types of datacenters:

  • VMware ESX
  • Microsoft Hyper-V
  • Red Hat Enterprise Virtualization Manager

NOTE: You need organizational administrator permission to see Hypervisors added by virt-who. Someone with appropriate permission can add this capability for other users by navigating to the following URL: https://access.redhat.com/wapps/ugc/protected/usermgt/userList.html

NOTE: For detailed explanation on the need for virt-who and various interfaces that require virt-who, please see the K-Base at the following URL:
Why and when do I need Virt-Who?

The steps for setting up hypervisors to host an unlimited number of RHEL virtual guests is basically the same for all three types of virtualization datacenters. The following steps take you through an example of a VMware ESX datacenter setup:

  • STEP #1 Set up virt-who on RHEL VM: Install a RHEL virtual guest system on a VMware host and configure the virt-who package to identify the location of the VMware ESX management server for the VMware datacenter. This causes information about each hypervisor in the VMware datacenter to be added to the customer's subscription information in the Red Hat Customer Portal (https://access.redhat.com/subscriptions) or Subscription Asset Management (SAM) server (if you are managing subscriptions on site).

  • STEP #2 Add datacenter SKU to hosts: Login to the customer portal (or SAM server) and locate the hypervisor systems that are associated with the datacenter. Assign "Red Hat Enterprise Linux for Virtual Datacenters" subscription type physical to each host on which you want to be able to run an unlimited number of RHEL virtual guests. This action unlocks a new virtual datacenter SKU that is used by RHEL virtual guests to enable their RHEL subscriptions.

  • STEP #3 Register/subscribe unlimited VMs on entitled hosts: When you launch a RHEL virtual guest on a hypervisor in a VMware datacenter that is entitled to unlimited guests, the RHEL guest can use the SKU that was unlocked for the hypervisor to subscribe to the RHEL software repositories it needs.

See the following procedure for details of these steps. Refer to the "Datacenter Subscription Tips" section of this article for other issues to be aware of related to Virtual Datacenter subscriptions.

Step #1: Set up virt-who

  1. Install RHEL on a virtual guest: Install RHEL on a virtual guest on one of the hosts associated with the datacenter you want to subscribe to. During installation, be sure to select to install the virt-who package (it is on the RHEL Server DVD, but is not currently in the default base installation.) If you install RHEL without the virt-who package, you can obtain the virt-who package as described in the Getting the virt-who package tip later in this article or install the package from the local media: How to install virt-who from local media
  2. Register and check identity: On the RHEL guest connected to the Internet, do the following to obtain your Red Hat account's org name to use when configuring virt-who:
    # subscription-manager register
    # subscription-manager identity
    Current identity is: 5bb28904-18fc-123e-ad9d-185d262a10b2
    name: rhelvm01.example.com
    org name: 5847285
    org ID: 5847285
    


3. Configure virt-who (for virt-who version 0.14+):
NOTE: virt-who Configuration Helper is now available in the
Customer Portal to seamlessly create virt-who configuration file by entering required information. The
configuration helper will create the file which can be copied to the folder location mentioned below:

On the RHEL guest, create a virt-who.conf file under /etc/virt-who.d/ and edit that file to identify the location of your VMware vCenter (there are different blocks of values for HyperV and RHEVM datacenters) as mentioned below. Once done, restart virt-who service:

[vmware]
type=esx
server=vCenter.domain.com
username=vCenterusername
password=vCenterpassword
owner=org ID
env=Library
hypervisor_id=hostname


NOTE:
- When updating virt-who version 0.14+, do not set VMware vCenter server information in /etc/sysconfig/virt-who.
- By specifying VMware vCenter server (fully qualified hostname or IP address), it will allow all VMware Hypervisors manage by the vCenter to be mapped by virt-who.
- The VMware vCenter user that is to be configured with virt-who can be a Read-Only user but the user must have the privilege to view the Hypervisor (Host) and the Virtual Machine (Guest). This is describe in detail in this link; Registering VMware ESXi Guests to the Red Hat Customer Portal using virt-who

For complete list of options, see virt-who-config(5) manual page.

$ man virt-who-config
       server 
              Hostname, IP address or URL of the server that provides virtualization information 
              (not applicable for vdsm mode).

       username 
              Username for authentication to the server (not applicable for vdsm mode). May include domain. 
              Do not escape the backslash between domain and username.

       password
              Password for authentication to the server (not applicable for vdsm mode).

       owner
              Owner for use with Subscription Asset Manager, the Red Hat Customer Portal, or Satellite 6
              (not applicable for Satellite 5)

       env
              Environment for use with Subscription Asset Manager or Satellite 6 (not applicable for Satellite 5)

       hypervisor_id
              Property that should be used as identification of the hypervisor. 
              Can be one of following: **uuid**, **hostname**, **hwuuid**. Note that some virtualization
              backends  don't  have  all of them implemented. 
              Default is uuid. hwuuid is applicable to esx and rhevm only. This property is
              meant to be set up before initial run of virt-who.
              Changing it later will result in duplicated entries in the subscription manager.

Example of virt-who.conf
~~~
$ cat /etc/virt-who.d/virt-who.conf

[vmware]
type=esx
server=1.2.3.4
username=admin
password=password
owner=5847285
env=Library
hypervisor_id=hostname
~~~

4. Start and enable virt-who: On the RHEL guest, type the following (activity is logged in /var/log/rhsm/rhsm.log):

    # service virt-who restart
    # chkconfig virt-who on
    

**NOTE**: Although only one guest must be running the virt-who service on a host associated with a VMware ESX management server, there must be a virt-who instance running for every host associated with a RHEV Manager's datacenter subscriptions.

Step #2: Add datacenter subscriptions to hosts

  1. Log into Red Hat Customer Portal: Log into the Red Hat Customer portal (or the SAM server) with the user account that you used with the virt-who service in the previous step.

  2. View available hypervisors: Go to the list of registered systems for the user account (https://access.redhat.com/management/systems).

  3. Add subscription to hypervisor: Select the name of the hypervisor (or use filter to find the Hypervisor) you want to subscribe, then select "Attach Subscriptions" to see a list of available subscriptions. From the list of available subscriptions, click the check box next to the one marked as follows and select "Attach Subscriptions":

    Red Hat Enterprise Linux for Virtual Datacenters...System:Physical

    If you have multiple hypervisors in the ESX datacenter, subscribe each hypervisor in the same way.

When you are done subscribing your hypervisors, any RHEL virtual guest installed on any of those hypervisors should have subscriptions available named "Red Hat Enterprise Virtual Datacenters" that provide the repositories needed to get the software you need.

Step #3: Register/Subscribe RHEL Guests

  1. Register a RHEL virtual guest: Log into each RHEL virtual guest system and register that system (if it is not already registered). You can either auto-attach (add the --auto-attach option) in this step or attach a specific subscription in the next step:

    # subscription-manager register

  2. Subscribe virtual guests: After you subscribe a datacenter host, new datacenter subscriptions are unlocked and made available to registered RHEL virtual guest running on that host. From the RHEL virtual guest, you can view the available subscriptions, then either auto attach (--auto-attach) or specifically subscribe to the entitlement the provides the Virtual Datacenters subscription:

    IMPORTANT: If you attach a specific SKU (based on its Pool ID), be sure to use the "Virtual" system type of subscription. When you list available subscriptions, you should notice that the "Physical" subscription types don't provide any software repositories, while the "Virtual" types provide multiple repositories. Don't use a "Physical" subscription on a virtual guest.

    # subscription-manager list --available | less      Find the Pool ID for the Virtual Datacenters subscription
    # subscription-manager attach --pool=31b3d88642361285014238c18fe968ba    Use the Pool ID that Provides the RHEL software repos.

Datacenter Subscription Tips

  • Leave virt-who running: Keep the virt-who service running continuously on at least one RHEL virtual guest in your datacenter.

  • What problems will happen when virt-who is down?:
    Please see the following KCS
    What problems will happen when virt-who is down?

  • Subscription Asset Management (SAM): If you are using SAM instead of managing your subscriptions through the Red Hat Customer portal, be sure to configure SAM before configuring virt-who.

  • Getting the virt-who package: While the virt-who package is on the RHEL Server DVD, is it not installed by default with a base system installation. Because virt-who must be installed and configured before you can properly subscribe your system with datacenter subscriptions, you must either consume a different subscription (using subscription-manager) or use RHN classic (rhnreg_ks) to get the virt-who package before subscribing properly. If that is your case, follow the description below to get the virt-who package, then continue with the procedure above for reverting the the datacenter subscriptions:

    1. Register system: (Only valid for RHEL 5 or 6). Install a RHEL virtual guest running on a host in an ESX Datacenter and temporarily register the system to Red Hat Network:

      # rhnreg_ks --username user --password passwd

      NOTE: If you are using a RHEL 5 virtual guest, you need to enable the RHEL Virtualization channel (rhel-x86_64-server-vt-5) before you can get the virt-who package.

    2. Install virt-who: On the RHEL guest, install the virt-who package.

      # yum -y install virt-who

    3. Switch to subscription management: On the RHEL guest, install two packages and switch to subscription management:

      # yum install subscription-manager-migration subscription-manager-migration-data
      # rhn-migrate-classic-to-rhsm -n

For RHEL 7 virtual guests that cannot be registered to RHN classic, install the virt-who package from the local repository: How to install virt-who from local media

  • Removing hypervisors: If you want to remove a datacenter hypervisor, and you are managing your subscriptions with Subscription Asset Manager, you can use a tool called headpin to remove it (see the Using Subscription Asset Management manual). If your datacenter hypervisor is registered through the Red Hat Customer portal, contact Red Hat Support and file a ticket to have them manually remove it from the customer portal.

  • Migrating guests: If you migrate virtual guests from one entitled datacenter hypervisor to another, the RHEL guest subscription on the new hypervisor will be used by the guest, keeping the RHEL subscription continuous. However, if you are using subscriptions for other Red Hat software (such as JBoss), your guest may be assigned a new subscription for that add-on software.

  • Subscription not listed: If a subscription isn't shown as available on your RHEL virtual guest after you have subscribed the hypervisor it is running on, run the following command on the guest to refresh the subscription information: subscription-manager refresh

  • Troubleshooting subscription-manager: If you are having other issues with Subscription Management, refer to the following documents:

    How to troubleshoot subscription-manager and yum issues?
    Get Started with Red Hat Subscription Management
    How to configure virt-who service to communicate with Hyper-V