Red Hat Bugzilla – Bug 1272149
filter_host_uuid skips all hosts when hypervisor_id set to hostname
Last modified: 2016-11-30 19:32:41 EST
Description of problem:
If the config parameter hypervisor_id is set to hostname, adding uuid's to the config parameter filter_host_uuids causes virt-who to skip all hypervisors instead of returning data for the hypervisors whose uuid is listed in the filter_host_uuids parameter.
This might be a documentation error, because if you use the hypervisor hostname instead of uuid with filter_host_uuids it does filter correctly, returning only the hostnames listed in the filter_host_uuids parameter.
The man page states...
"filter_host_uuids - Only hosts which uuid is specified in comma-separated list in this option will be reported. Put the uuid into the double-quotes if it contains special characters (like comma)."
Version-Release number of selected component (if applicable):
virt-who.noarch 0.12-10.el6 @rhel-6-server-rpms
You can reproduce the behavior by changing the config file 3 times and running virt-who.
Steps to Reproduce:
Data is imported into satellite 6.1.2
For all 3 cases below I run virt-who as a service but have it configured to run in single-shot mode. I've made these changes to the standard /etc/sysconfig/virt-who file.
Between test cases I delete any records that were imported into satellite.
1. Configure the file /etc/virt-who.d/config as noted below and run virt who. It will return data for the one hypervisor that matches the listed uuid. In this case virt-who works as expected.
2. Configure the file /etc/virt-who.d/config as noted below and run virt who. It will skip all hypervisors and not return sny data for the one uuid listed in the filter list. In this case virt-who does not work as expected.
3. Configure the file /etc/virt-who.d/config as noted below and run virt who. It will return data for the one hypervisor that matches the listed hostname. In this case virt-who does return data but based on the name of the parameter and the virt-who-config man page I was expecting to supply the uuid not a hostname.
In the first case data was returned as expected when filtering by uuid. The second case there was no data returned when filtering by uuid. The third case data was returned unexpectedly when I used hostname instead of uuid in the filter list
Based on the parameter name and the virt-who-config man page I expected the data returned to be filtered by uuid regardless of how hypervisor_id was set.
As noted above this might simply be fixed by updating the man page for virt-who-config but it might be considered a bug too, I'm not sure. Now that I figured out to use hostname in the filter list when I set hypervisor_id=hostname I'm good to go but since I got stuck on this I thought I should bring it to your attention and maybe it will save someone else from getting stuck!
Thank you for the report. I think that filtering the hosts by hostname when hypervisor_id is hostname makes more sense. If you are reporting hypervisors by hostname, you'll see the machine hostname in the UI (e.g. Satellite). So it make sense to filter by it.
The change has been applied upstream and will be part of rebased virt-who package.
Fixed by rebase to virt-who-0.16-1.el6.
Verified it on virt-who-0.16-4.el6.noarch since man page has been updated and make "filter_host_uuids" attribution more clearly. Therefore,verify it.
[root@sgi-xe500-01 ~]# man virt-who-config
Only hosts which uuid (or hostname or hwuuid, based on hypervisor_id) is specified in comma-separated list in this option will be reported. Put the value into the double-quotes if it contains special characters (like comma).
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.