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

Updated

virt-who is an agent for reporting virtual guest IDs to various system management applications, including the Red Hat Customer Portal. It scans for UUIDs of hypervisors and guests, then send this information to the Red Hat Customer Portal so you can apply subscriptions. This saves the hassle of registering every guest separately.

This article shows how to use virt-who to register guests on VMware ESXi to the Red Hat Customer Portal

Requirements

  • One virtual machine hosted on ESXi. This article will refer to this virtual machine as virt-who-guest.example.com
  • Firewall exception to allow connection to HTTP/S (port 80 and 443) from virt-who-guest.example.com to VMware vCenter.
  • A user account with read-only permissions. virt-who uses this user to read virtual machine information and relay this to the Red Hat Customer Portal. This article will refer to this user as virtwho-readonly-user.

Provisioning the User Account

There are two ways to create this user depending on the type of authentication method your VMware environment uses:

  • Creating a local user through VMware vSphere Web Client
  • Creating a user through Active Directory

Creating a local user through VMware vSphere Web Client

  1. Log in to vSphere Web Client using an account with administrator privileges.

  2. Navigate to Home > Administration > Single Sign-On > Users and Groups.

  3. Press the plus (+) icon to create a new user.

  4. Provide the User name with virtwho-readonly-user user and enter a Password for this user. Click OK to save the user.

  5. Navigate to Manage > Permissions and press the plus (+) icon to open the Add Permission dialog.

  6. Select the virtwho-readonly-user.

  7. Select the Read-only role.

  8. Click OK to save the permissions.

  9. Log out and test the virtwho-readonly-user in vCenter. Make sure the inventory shows the resources that virtwho-readonly-user can access.

Creating a user through Active Directory

  1. Run the Active Directory Users and Computers program on your Windows machine with a user that has rights to add users into your domain. Create a user named virtwho-readonly-user.

  2. Log in to vSphere Web Client using an account with administrator privileges.

  3. Navigate to Home > Administration > Single Sign-On > Configuration.

  4. Navigate to the Identity Sources tab and, press the plus (+) icon, and select the Active Directory identity source. This adds Active Directory identity source, including the virtwho-readonly-user user.

  5. Navigate to Home > vCenter and select the vCenter to grant access to virtwho-readonly-user.

  6. Navigate to Manage > Permissions and press the plus (+) icon to open the Add Permission dialog.

  7. Select the virtwho-readonly-user.

  8. Select the Read-only role.

  9. Click OK to save the permissions.

  10. Log out and test the virtwho-readonly-user in vCenter. Make sure the inventory shows the resources that virtwho-readonly-user can access.

Setting up virt-who

Install virt-who on virt-who-guest.example.com and configure it to use the your vCenter.

  1. Log in to virt-who-guest.example.com as the root user.

  2. Install virt-who:

    [root@virt-who-guest ~]# yum install virt-who
    
  3. Get your organization ID for use for the VIRTWHO_ESX_OWNER parameter in the configuration step:

    [root@virt-who-guest ~]# subscription-manager identity | awk '/org ID/ {print $NF}'
    
  4. Edit the virt-who configuration file:

    [root@virt-who-guest ~]# vim /etc/sysconfig/virt-who
    
  5. Modify the configuiration file:

    VIRTWHO_BACKGROUND=1
    VIRTWHO_DEBUG=1
    VIRTWHO_ESX=1
    VIRTWHO_ESX_OWNER=xxxxxxxxx                           # Replace with  organization ID from above
    VIRTWHO_ESX_ENV='Organization Name'                   # Replace with your organization name
    VIRTWHO_ESX_SERVER=vcenter.example.com                # Replace with your vcenter.server domain name or IP address
    VIRTWHO_ESX_USERNAME=DOMAIN\\virtwho-readonly-user    # Replace DOMAIN with your Active Directory domain
    VIRTWHO_ESX_PASSWORD=XXX                              # Replace with the password for virtwho-readonly-user
    

    Replace the value with your own values

  6. Start virt-who and watch /var/log/rhsm/rhsm.log:

    [root@virt-who-guest ~]# tail -f /var/log/rhsm/rhsm.log &
    [root@virt-who-guest ~]# service virt-who restart
    

    A successful virt-who configuration results in hypervisor details sent to the Red Hat Customer Portal. For example:

        2015-02-25 06:02:42,084 [INFO]  @subscriptionmanager.py:119 - Sending update in hosts-to-guests mapping: {34383137-3630-4753-4834-32374b583457: [422fd3e0-45e5-6607-0112-70a29fbebaa0, 421ec05d-d15c-9db1-37df-f2ed37b172f1, 421eb743-c21a-d68f-df55-b7ff258c9c8e, 421eb32c-3015-2610-4ef1-1ba324997fdc, 422fff5f-dc40-e2c9-2b10-1b309d8836b0, 421ef928-3dc3-ae31-503a-1d23dc63056f, 421e63ee-df16-c4ca-9f97-e2d3b0e3f5fb]}
    
        2015-02-25 06:02:46,449 [INFO]  @virtwho.py:164 - Created host: c8690817-147e-43a8-a49b-da97bf2f8714 with guests: [422fd3e0-45e5-6607-0112-70a29fbebaa0, 421ec05d-d15c-9db1-37df-f2ed37b172f1, 421eb743-c21a-d68f-df55-b7ff258c9c8e, 421eb32c-3015-2610-4ef1-1ba324997fdc, 422fff5f-dc40-e2c9-2b10-1b309d8836b0, 421ef928-3dc3-ae31-503a-1d23dc63056f, 421e63ee-df16-c4ca-9f97-e2d3b0e3f5fb]
    

Associating the Hypervisor Profile with the Virtual DataCenter Subscription

  1. Navigate to Subscriptions in the top menu.

  2. Scroll to the Red Hat Subscription Management section and click on Hypervisors.

  3. Click on the UUID of the hypervisor containing the Red Hat Enterprise Linux guests.

  4. Attach the Virtual DataCenter subscription and other required subscriptions.

Register and Attach Guests to the Subscription

  1. Login to a guest system on the hypervisor.

  2. Clean out previous subscriptions, if any:

    # subscription-manager unsubscribe --all
    or
    # subscription-manager remove --all
    
  3. Subscribe them using --auto option:

    # subscription-manager subscribe --auto
    or
    # subscription-manager attach --auto
    
  4. Navigate to guest system profile on the customer portal and confirm that the guest system has consumed subscription attached to the hypervisor profile.

Resources:

  1. Documents and Articles

    1. Virt-Who Processes, Queries, and Data

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

Category
Components
Article Type