Bug 1272149 - filter_host_uuid skips all hosts when hypervisor_id set to hostname
filter_host_uuid skips all hosts when hypervisor_id set to hostname
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who (Show other bugs)
6.7
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Radek Novacek
gaoshang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-15 10:58 EDT by Robert
Modified: 2016-11-30 19:32 EST (History)
3 users (show)

See Also:
Fixed In Version: virt-who-0.16-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 19:56:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robert 2015-10-15 10:58:45 EDT
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

How reproducible:
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.
VIRTWHO_BACKGROUND=0
VIRTWHO_DEBUG=1
VIRTWHO_ONE_SHOT=1
VIRTWHO_SAM=0
VIRTWHO_SATELLITE6=1

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.

[vcenter1]
type=esx
server=xxx.xxx.xxx.xxx
username=ro-user
password=pw123456
owner="Production"
env=Library
hypervisor_id=uuid
filter_host_uuids=fb04u59a-fa43-e411-0002-00000000000e

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.

[vcenter1]
type=esx
server=xxx.xxx.xxx.xxx
username=ro-user
password=pw123456
owner="Production"
env=Library
hypervisor_id=hostname
filter_host_uuids=fb04u59a-fa43-e411-0002-00000000000e

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.

[vcenter1]
type=esx
server=xxx.xxx.xxx.xxx
username=ro-user
password=pw123456
owner="Production"
env=Library
hypervisor_id=hostname
filter_host_uuids=server01.verizon.com

Actual results:
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


Expected results:
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.


Additional info:
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!
Comment 2 Radek Novacek 2015-12-08 06:55:06 EST
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.

https://github.com/virt-who/virt-who/commit/fc063bf3c075f7f7d3a05f4f381d5f4a13653edb
Comment 3 Radek Novacek 2015-12-17 07:28:35 EST
Fixed by rebase to virt-who-0.16-1.el6.
Comment 5 Liushihui 2016-02-25 01:19:16 EST
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
filter_host_uuids
   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).
Comment 7 errata-xmlrpc 2016-05-10 19:56:42 EDT
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.

https://rhn.redhat.com/errata/RHEA-2016-0859.html

Note You need to log in before you can comment on or make changes to this bug.