RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1184665 - RFE: allow filtering which hosts are sent by virt-who
Summary: RFE: allow filtering which hosts are sent by virt-who
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who
Version: 6.7
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: gaoshang
Laura Novich
URL:
Whiteboard:
Depends On: 1163608 1259295
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-22 00:20 UTC by jalviso
Modified: 2019-04-16 14:32 UTC (History)
9 users (show)

Fixed In Version: virt-who-0.12-1.el6
Doc Type: Release Note
Doc Text:
Filtering for hypervisors reported by virt-who The virt-who service introduces a filtering mechanism for the Subscription Manager reports. As a result, users can now choose which hosts virt-who should display according to the specified parameters. For example, they can filter out hosts that do not run any Red Hat Enterprise Linux guests, or hosts that run guests of a specified version of Red Hat Enterprise Linux.
Clone Of: 1163608
Environment:
Last Closed: 2015-07-22 07:15:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1377 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2015-07-20 17:58:35 UTC

Comment 3 Radek Novacek 2015-02-27 11:08:22 UTC
This feature is now implemented upstream like this: there are two options that affects which hosts are filtered:

filter_host_uuids - if provided, only hosts with uuid in this list will be reported,
exclude_host_uuids - do not report hosts with uuid in this list.

Is this acceptable?

Comment 4 Radek Novacek 2015-02-27 19:42:03 UTC
Fixed by rebase to virt-who-0.12-1.el6.

Comment 7 Stephen Gilson 2015-04-02 16:55:50 UTC
CCS has determined that this bug should be described in the RHEL 6.7 Release Notes. Please update the Doc Text field with a summary feature description.

Comment 8 Liushihui 2015-04-10 06:56:19 UTC
On the virt-who-0.12-2.el6.noarch, virt-who can filter out one host, but it's failed to filter out multi-hosts, Therefore, reopen it.

Checked version:
virt-who-0.12-2.el6.noarch
subscription-manager-1.14.1-1.el6.x86_64

Checked process:
Precondition:There are two esx hosts in this vcenter.
1.Register system to SAM server
2.Configure virt-who run at esx mode and configure a host which can be filtered.
[root@hp-z220-06 virt-who.d]# cat /etc/virt-who.d/vir 
[test-esx1]
type=esx
server=10.66.79.72
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
filter_host_uuids="86b2bd00-8bad-11e2-87f4-6c3be514699d"
3. Restart virt-who service , check the virt-who log, it can filter out ""86b2bd00-8bad-11e2-87f4-6c3be514699d""
2015-04-10 14:49:53,246 [DEBUG]  @virtwho.py:84 - Using config named 'test-esx1'
2015-04-10 14:49:53,246 [INFO]  @virtwho.py:475 - Using configuration "test-esx1" ("esx" mode)
2015-04-10 14:49:53,246 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 10 seconds interval
2015-04-10 14:49:53,378 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-10 14:49:54,500 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-10 14:49:54,820 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-10 14:49:54,840 [DEBUG]  @virt.py:89 - Skipping host 'aee4ff00-8c33-11e2-994a-6c3be51d959a' because its uuid is not included
2015-04-10 14:49:54,840 [INFO]  @subscriptionmanager.py:124 - Sending update in hosts-to-guests mapping: {86b2bd00-8bad-11e2-87f4-6c3be514699d: [4224e5d2-4fcf-2bc2-2559-5846035d3a78, 4224a77f-1c50-42cb-3507-2b68b447ed60]}
2015-04-10 14:49:54,840 [DEBUG]  @subscriptionmanager.py:76 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-04-10 14:49:55,953 [INFO]  @virtwho.py:127 - Created host: ead55c34-b85b-4c50-98f4-a95b8ed86b4f with guests: [4224e5d2-4fcf-2bc2-2559-5846035d3a78, 4224a77f-1c50-42cb-3507-2b68b447ed60]
4. stop virt-who service, then configure virt-who filter out two esx hosts.
[root@hp-z220-06 virt-who.d]# cat /etc/virt-who.d/vir 
[test-esx1]
type=esx
server=10.66.79.72
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
filter_host_uuids="86b2bd00-8bad-11e2-87f4-6c3be514699d,aee4ff00-8c33-11e2-994a-6c3be51d959a"
5. Restart virt-who service, check the virt-who's log
2015-04-10 14:50:34,405 [DEBUG]  @virtwho.py:84 - Using config named 'test-esx1'
2015-04-10 14:50:34,405 [INFO]  @virtwho.py:475 - Using configuration "test-esx1" ("esx" mode)
2015-04-10 14:50:34,405 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 10 seconds interval
2015-04-10 14:50:34,547 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-10 14:50:35,736 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-10 14:50:36,043 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-10 14:50:36,061 [DEBUG]  @virt.py:89 - Skipping host 'aee4ff00-8c33-11e2-994a-6c3be51d959a' because its uuid is not included
2015-04-10 14:50:36,061 [DEBUG]  @virt.py:89 - Skipping host '86b2bd00-8bad-11e2-87f4-6c3be514699d' because its uuid is not included
2015-04-10 14:50:36,061 [INFO]  @subscriptionmanager.py:124 - Sending update in hosts-to-guests mapping: {}
2015-04-10 14:50:36,061 [DEBUG]  @subscriptionmanager.py:76 - Authenticating with certificate: /etc/pki/consumer/cert.pem

Result: virt-who skipping two hosts, it send a null host/guest mapping when setting filter out two esx hosts. 

Expected result: virt-who should send the two host/guest's mapping info which specified in the configure file to SAM server

Comment 9 Liushihui 2015-04-10 07:08:41 UTC
If set "exclude_host_uuids="86b2bd00-8bad-11e2-87f4-6c3be514699d,aee4ff00-8c33-11e2-994a-6c3be51d959a"", it will send these two hosts to SAM server.Actually, it shouldn't send these host/guest info to SAM server at this time.
It seems the function of "exclude_host_uuids" and "filter_host_uuids" are totally reverse when there are mult-hosts in the configure file.

Comment 10 Liushihui 2015-04-10 07:45:34 UTC
Please ignore commend 8 and commend 9 which is result in the incorrect config. 

Radek, Could you help me to modify the bug status to ON_QA? I will verify it again, sorry for my mistake, thanks.

Comment 11 Radek Novacek 2015-04-14 05:37:45 UTC
Moving back to ON_QA.

Comment 12 Liushihui 2015-04-14 08:40:39 UTC
Verified it on virt-who-0.12-2.el6.noarch, virt-who can filter out any host which configured in /etc/virt-who.d/XXX

Checked version:
virt-who-0.12-2.el6.noarch
subscription-manager-1.14.1-1.el6.x86_64

Checked process:
Precondition:There are two esx hosts in this vcenter.
1.Register system to SAM server
2.Configure virt-who run at esx mode and configure a host which can be filtered.
[root@hp-z220-06 virt-who.d]# cat /etc/virt-who.d/vir 
[test-esx1]
type=esx
server=10.66.79.72
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
filter_host_uuids="aee4ff00-8c33-11e2-994a-6c3be51d959a"
3. Restart virt-who service , check the virt-who log, it can send "aee4ff00-8c33-11e2-994a-6c3be51d959a" to satellite server
2015-04-14 16:28:00,252 [DEBUG]  @virtwho.py:84 - Using config named 'test-esx1'
2015-04-14 16:28:00,253 [INFO]  @virtwho.py:475 - Using configuration "test-esx1" ("esx" mode)
2015-04-14 16:28:00,253 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 5 seconds interval
2015-04-14 16:28:00,384 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-14 16:28:01,478 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-14 16:28:01,791 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-14 16:28:01,809 [DEBUG]  @virt.py:89 - Skipping host '86b2bd00-8bad-11e2-87f4-6c3be514699d' because its uuid is not included
2015-04-14 16:28:01,810 [INFO]  @subscriptionmanager.py:124 - Sending update in hosts-to-guests mapping: {aee4ff00-8c33-11e2-994a-6c3be51d959a: []}
4. Configure filter two hosts
[test-esx1]
type=esx
server=10.66.79.68
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
filter_host_uuids="aee4ff00-8c33-11e2-994a-6c3be51d959a","86b2bd00-8bad-11e2-87f4-6c3be514699d"
5. Restart virt-who service , check the virt-who log, it send two hosts which configured to Satellite server
2015-04-14 16:28:46,732 [DEBUG]  @virtwho.py:84 - Using config named 'test-esx1'
2015-04-14 16:28:46,732 [INFO]  @virtwho.py:475 - Using configuration "test-esx1" ("esx" mode)
2015-04-14 16:28:46,732 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 5 seconds interval
2015-04-14 16:28:46,864 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-14 16:28:47,969 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-14 16:28:48,292 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-14 16:28:48,310 [INFO]  @subscriptionmanager.py:124 - Sending update in hosts-to-guests mapping: {aee4ff00-8c33-11e2-994a-6c3be51d959a: [], 86b2bd00-8bad-11e2-87f4-6c3be514699d: [4224a77f-1c50-42cb-3507-2b68b447ed60, 4224e5d2-4fcf-2bc2-2559-5846035d3a78]}
6. Configure excluded one host "aee4ff00-8c33-11e2-994a-6c3be51d959a"
[test-esx1]
type=esx
server=10.66.79.68
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
exclude_host_uuids="aee4ff00-8c33-11e2-994a-6c3be51d959a"
7. Restart virt-who service,check the virt-who log,virt-who can't send "aee4ff00-8c33-11e2-994a-6c3be51d959a" to Satellite server
2015-04-14 16:29:42,690 [DEBUG]  @esx.py:84 - Wait for ESX event finished, timeout
2015-04-14 16:29:45,754 [DEBUG]  @virtwho.py:84 - Using config named 'test-esx1'
2015-04-14 16:29:45,754 [INFO]  @virtwho.py:475 - Using configuration "test-esx1" ("esx" mode)
2015-04-14 16:29:45,754 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 5 seconds interval
2015-04-14 16:29:45,885 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-14 16:29:46,986 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-14 16:29:47,301 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-14 16:29:47,318 [DEBUG]  @virt.py:86 - Skipping host 'aee4ff00-8c33-11e2-994a-6c3be51d959a' because its uuid is excluded
2015-04-14 16:29:47,318 [INFO]  @subscriptionmanager.py:124 - Sending update in hosts-to-guests mapping: {86b2bd00-8bad-11e2-87f4-6c3be514699d: [4224a77f-1c50-42cb-3507-2b68b447ed60, 4224e5d2-4fcf-2bc2-2559-5846035d3a78]}
8. Configure excluded two hosts.
[test-esx1]
type=esx
server=10.66.79.68
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
exclude_host_uuids="aee4ff00-8c33-11e2-994a-6c3be51d959a","86b2bd00-8bad-11e2-87f4-6c3be514699d"
9. Restart virt-who service ,check the virt-who log,two hosts can't send to Satellite server.
2015-04-14 16:30:31,563 [DEBUG]  @virtwho.py:84 - Using config named 'test-esx1'
2015-04-14 16:30:31,564 [INFO]  @virtwho.py:475 - Using configuration "test-esx1" ("esx" mode)
2015-04-14 16:30:31,564 [DEBUG]  @virtwho.py:131 - Starting infinite loop with 5 seconds interval
2015-04-14 16:30:31,708 [DEBUG]  @esx.py:51 - Log into ESX
2015-04-14 16:30:32,799 [DEBUG]  @esx.py:54 - Creating ESX event filter
2015-04-14 16:30:33,121 [DEBUG]  @esx.py:113 - Waiting for ESX changes
2015-04-14 16:30:33,141 [DEBUG]  @virt.py:86 - Skipping host 'aee4ff00-8c33-11e2-994a-6c3be51d959a' because its uuid is excluded
2015-04-14 16:30:33,141 [DEBUG]  @virt.py:86 - Skipping host '86b2bd00-8bad-11e2-87f4-6c3be514699d' because its uuid is excluded
2015-04-14 16:30:33,141 [INFO]  @subscriptionmanager.py:124 - Sending update in hosts-to-guests mapping: {}

Result: According to result of step3,step5,step7,step9, 
filter_host_uuids - if provided, only hosts with uuid in this list will be reported,
exclude_host_uuids - do not report hosts with uuid in this list.
Therefore, verify it

Comment 13 errata-xmlrpc 2015-07-22 07:15:45 UTC
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/RHBA-2015-1377.html


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