virt-who one shot gives the correct output but running a virt-who service fails to map the correct hyperviosr-guest.

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.3.

Issue

  • When running a virt-who one shot specifying the name of one configuration file gives the correct mapping of hypervisors to guests, but if only virt-who service is running or not specified the name, it returns the wrong data/mapping.

  • Output when file name specified:

# virt-who -odc config1.conf
2019-04-25 14:44:06,269 [virtwho.destination_-6565174713917789106 INFO] MainProcess(43687):Thread-3 @virt.py:_send_data:598 - Hosts-to-guests mapping for config "config1.conf": 5 hypervisors and 824 guests found
  • Output when the file name is not specified:
# virt-who -od
2019-04-25 14:42:25,356 [virtwho.destination_-6565174713917789106 INFO] MainProcess(42925):Thread-9 @virt.py:_send_data:598 - Hosts-to-guests mapping for config "config1.conf": 2 hypervisors and 7 guests found

Resolution

  • It is observed that when having multiple virt-who configuration files, one must have some parameters unique per file.
  • Make sure all the files have a diferent header specified. No two files can have the same header.
# vi /etc/virt-who.d/virt-who.conf

       [vmware]    <====== Like all other parameters, this should be unique to every file.
       type=esx
       server=vCenter(FQDN/IP)
       username=vCenter_Username
       password=vCenter_Password
       owner=org ID (From the Command # subscription-manager identity)
       env=Library
       hypervisor_id=hostname

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

Root Cause

  • When running virt-who one shot without specifying the file name, it reads all the config files and conflicts between two similar headers and returns wrong data.
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.