virt-who fails to map host-guest details in Red Hat Satellite 6

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • virt-who fails to map host-guest details in Red Hat Satellite server.

  • virt-who fails to sent mapping report to Red Hat Satellite with the following errors in the rhsm.logs:

       [ERROR] @virt.py:389 - Thread 'destination_-4061267657026572828' fails with exception:
    RemoteServerException: Server error attempting a GET to /rhsm/status/ returned status 404
       [INFO] @virt.py:555 - Error report received
    

Resolution

  • Make sure that virt-who configuration contains Red Hat Satellite organization label instead of name.

  • Also check whether "encrypted_password" is correct in virt-who config file.

        # hammer organization list
        [Foreman] Password for admin: 
    
       
    
   ID | NAME                 | LABEL                | DESCRIPTION

-|-|-|-

   1  | Default Organization | Default_Organization |            

-|-|-

   # cat /etc/virt-who.d/lab-esx.conf
   [lab-esx]
   type=esx
   server=vcenter.example.com
   username=ro-virtwho-user
   encrypted_password=924be7fb0a82ad7f11fcf545eed42f72
   owner=ORG_LABEL                   <----- Must be a valid organization label
   env=Library
   rhsm_hostname=satellite.example.com
   rhsm_username=admin
   rhsm_encrypted_password=3fce89e16bf2ed289ce10b8dd692e4b6
   rhsm_prefix=/rhsm
   hypervisor_id=hostname


- Check the port number in `/etc/rhsm/rhsm.conf`, it should be 443.

- Make sure `rhsm_hostname` in virt-who configuration points to Satellite server if virt-who is configured on any other machine and not on Satellite.


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](https://access.redhat.com/articles/6463781)

## Root Cause

- `virt-who`  collects all host-guest details but fails while sending the mapping to Red Hat Satellite server because of incorrect "owner" entry in `virt-who` configuration file. 
- Wrong `port` number in `/etc/rhsm/rhsm.conf`



## Diagnostic Steps

- Check `virt-who` debug output for the errors


  # systemctl stop virt-who

  # virt-who -d -o

  2017-10-11 13:06:38,177 [rhsm.connection DEBUG] MainProcess(27982):Thread-6 @connection.py:_request:516 - Making request: POST /rhsm/hypervisors?owner=ORG_LABEL&env=Library
  2017-10-11 13:06:38,350 [rhsm.connection INFO] MainProcess(27982):Thread-6 @connection.py:_request:552 - Response: status=500, request="POST /rhsm/hypervisors?owner=ORG_LABEL&env=Library"
  2017-10-11 13:06:38,350 [virtwho.destination_5037974140476915850 ERROR] MainProcess(27982):Thread-6 @virt.py:_send_data:625 - Error during hypervisor checkin: 
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 609, in _send_data
      options=self.options)
    File "/usr/lib/python2.7/site-packages/virtwho/manager/subscriptionmanager/subscriptionmanager.py", line 221, in hypervisorCheckIn
   raise ManagerError("Communication with subscription manager failed with code %d: %s" % (e.code, str(e)))
  ManagerError: Communication with subscription manager failed with code 500: 
  2017-10-11 13:06:38,352 [virtwho.destination_5037974140476915850 DEBUG] MainProcess(27982):Thread-6 @virt.py:_send_data:712 - At least one report for each connected source has been sent. Terminating.
  2017-10-11 13:06:38,359 [virtwho.destination_5037974140476915850 DEBUG] MainProcess(27982):Thread-6 @virt.py:run:394 - Thread 'destination_5037974140476915850' terminated
  2017-10-11 13:06:38,800 [virtwho.main DEBUG] MainProcess(27982):MainThread @__main__.py:main:23 - virt-who terminated
  2017-10-11 13:06:38,800 [virtwho.main DEBUG] MainProcess(27982):MainThread @executor.py:terminate:226 - virt-who is shutting down


SBR
Product(s)
Components
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.