How to Register VMware ESXi Guests to the Red Hat Customer Portal using virt-who

Solution Verified - Updated

Environment

  • Certificate-based subscription (RHSM)
  • VMware ESX hypervisor
  • Red Hat Enterprise Linux guest

Issue

  • How do I configure virt-who for use with VMware ESX hypervisors?
  • How do I register VMware ESX host/hypervisor to customer portal to use virtual subscriptions?
  • How do I register a Red Hat Enterprise Linux virtual system running on an ESX hypervisor to consume a Virtual Datacenter subscription?
  • How do I install the virt-who package?

Resolution

To have a Red Hat Enterprise Linux virtual machine consume a virtual entitlement (VDC Subscription) when running on an ESX host, virt-who will need to be configured on the RHEL VM.

  • Make sure the virt-who is installed:

    # rpm -qa virt-who
    
  • If virt-who is not installed:

    # yum install virt-who
    
  • Register the guest via Subscription Management but do not apply any entitlements yet:

    # subscription-manager register
    
  • Change the configuration in legacy virt-who file:

    # vi /etc/sysconfig/virt-who
    --enable communication to portal
    VIRTWHO_SAM=1
    
  • Obtain the org name from the following command:

    # subscription-manager identity
    Current identity is: 5acd8904-25fc-498e-ad9d-239d262be0aa
    name: system1.example.redhat.com
    org name: 7086261
    org ID: 7086261
    
  • Configure virt-who options in /etc/virt-who.d/lab-esx.conf

    # vi /etc/virt-who.d/lab-esx.conf
    [lab-esx]
    type=esx
    server=vcenter.example.com
    username=ro-virtwho-user
    encrypted_password=
    owner=ORG_LABEL or ORG_ID
    env=Library
    hypervisor_id=hostname
    

To generate encrypted passwords for the virt-who configuration file

  • Execute virt-who-password command

    [root@satellite ~]# virt-who-password 
    Password: 
    Use following as value for encrypted_password key in the configuration file:
    924be7fb0a82ad7f11fcf545eed42f72
    
  • Start and enable the virt-who service to run after every reboot.

    [root@satellite ~]# systemctl start virt-who; systemctl enable virt-who
    
  • Monitor /var/log/rhsm/rhsm.log for any virt-who related errors.

For more KB articles/solutions related to Virt-who and Virtual Datacenter (VDC) Subscriptions Issues, please refer to the Consolidated Troubleshooting Article for Virt-who and Virtual Datacenter (VDC) Subscriptions Issues

Diagnostic Steps

  • For proper virt-who reporting with the Customer Portal the rhsm.log should look as below
[root@satellite ~]# tail -f -n0 /var/log/rhsm/rhsm.log
2015-12-29 11:08:11,254 [INFO]  @subscriptionmanager.py:165 - Sending update in hosts-to-guests mapping: {
    "cf482bb9-7542-3666-8dea-28cabb6dc8d3": [
        {
            "guestId": "4234f686-233b-910b-feed-e3a401017947", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "42348972-5976-2444-be6d-9075204e1032", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "564d9712-1eb8-c3b1-41bd-60879e1e4553", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "4234ff72-bc4a-ef8e-467c-a0d61515da6b", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "564de0f9-7565-3037-791b-9a533576e0c5", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "564dd5ef-0662-a4f6-f47a-0655889252d9", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }, 
        {
            "guestId": "564dfec6-d4ec-111d-9138-d5ce50e33429", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx", 
                "hypervisorType": "vmware"
            }
        }
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.