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 1163608 - 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 7
Classification: Red Hat
Component: virt-who
Version: 7.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: Li Bin Liu
Jiri Herrmann
URL:
Whiteboard:
Depends On:
Blocks: 1184665 1259295
TreeView+ depends on / blocked
 
Reported: 2014-11-13 05:36 UTC by jalviso
Modified: 2019-09-12 08:05 UTC (History)
8 users (show)

Fixed In Version: virt-who-0.14-1.el7
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:
: 1184665 1259295 (view as bug list)
Environment:
Last Closed: 2015-11-19 11:55:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Article) 2075353 0 None None None Never
Red Hat Product Errata RHBA-2015:2370 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2015-11-19 10:39:27 UTC

Description jalviso 2014-11-13 05:36:58 UTC
Description of problem:

virt-who is mapping all the host in Vmware Vcenter.

Version-Release number of selected component (if applicable):

virt-who (all versions including latest)

How reproducible:

Steps to Reproduce:

1. Configure and run virt-who service of 1 of the virtual guest running on one of the Vmware host
2. All host in Vcenter are mapped to the Customer Portal
3. Customer apply Virtual Datacenter physical subscription to the host.

Actual results:

All host are mapped to the Customer Portal

Expected results:

Only required host will be mapped to the Customer Portal. 

Additional info:

If unwanted hosts are deleted, during the next run of virt-who, all the hosts will be mapped again (including the deleted ones). Cannot used one_shot in virt-who configuration as DRS Disaster Recovery System is implemented on the Vcenter.

Comment 3 Radek Novacek 2014-11-26 13:59:52 UTC
I'm not sure I understand proposed idea.

Customer wants some kind of blacklisting/whitelisting of which hosts will be reported to the SAM?

So lets say we have following "full" mapping that we can get from virt-who now:

{
    'host-1-uuid': [
        'guest-1-on-host-1-uuid',
        'guest-2-on-host-1-uuid'
    ],
    'host-2-uuid': [
        'guest-1-on-host-2-uuid',
        'guest-2-on-host-2-uuid'
    ]
}

And the customer wants to specify something like this in the configuration file for the given hypervisor:

report_hosts_only = ['host-2-uuid']

And then virt-who will then report this:

{
    'host-2-uuid': [
        'guest-1-on-host-2-uuid',
        'guest-2-on-host-2-uuid'
    ]
}

Is this what customer wants, do I understand it correctly?

Comment 5 Radek Novacek 2014-11-27 12:53:47 UTC
Ok, thanks for confirmation. Marking this bug as RFE for next release.

Comment 12 Radek Novacek 2015-05-07 09:22:18 UTC
This feature has been implemented upstream and will be fixed by virt-who rebase (bug #1200374).

Comment 13 Radek Novacek 2015-06-23 13:32:17 UTC
Fixed in virt-who-0.14-1.el7.

Comment 15 Liushihui 2015-07-16 07:26:25 UTC
Verify it on virt-who-0.14-1.el7.noarch since virt-who can filter out any host which configured in /etc/virt-who.d/XXX

Verified version:
virt-who-0.14-1.el7.noarch
subscription-manager-1.15.5-1.el7.x86_64
python-rhsm-1.15.3-1.el7.x86_64

Verified process:
Precondition:There are two esx hosts in this vcenter.
1.Register system to Satellite
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
2015-07-16 14:42:04,336 [DEBUG]  @virtwho.py:91 - Using config named 'test-esx1'
2015-07-16 14:42:04,337 [INFO]  @virtwho.py:572 - Using configuration "test-esx1" ("esx" mode)
2015-07-16 14:42:04,349 [DEBUG]  @virtwho.py:152 - Starting infinite loop with 3600 seconds interval
2015-07-16 14:42:04,384 [DEBUG]  @esx.py:53 - Log into ESX
2015-07-16 14:42:05,156 [DEBUG]  @esx.py:56 - Creating ESX event filter
2015-07-16 14:42:05,229 [DEBUG]  @esx.py:140 - Waiting for ESX changes
2015-07-16 14:42:05,241 [DEBUG]  @virt.py:130 - Skipping host '564d9e7a-4128-92b6-7284-6335f6b399be' because its uuid is not included
2015-07-16 14:42:05,242 [INFO]  @subscriptionmanager.py:146 - Sending update in hosts-to-guests mapping: {
    "aee4ff00-8c33-11e2-994a-6c3be51d959a": [
        {
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }, 
            "guestId": "564dab7d-3b72-51a1-eeda-586036106892", 
            "state": 5
        }, 
        {
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx"
            }, 
            "guestId": "4227d611-0abc-fc5e-7538-07ebd83fa9ba", 
            "state": 1
        }, 
        {
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx"
            }, 
            "guestId": "421aa84b-a49e-e01c-fa72-0b570372dd9d", 
            "state": 1
        }, 
        {
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }, 
            "guestId": "564daa52-c518-b2f0-3c05-a343285910e1", 
            "state": 5
        }
    ]
}
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-07-16 15:19:40,381 [DEBUG]  @virtwho.py:226 - virt-who shut down started
2015-07-16 15:19:41,489 [DEBUG]  @virtwho.py:91 - Using config named 'test-esx1'
2015-07-16 15:19:41,490 [INFO]  @virtwho.py:572 - Using configuration "test-esx1" ("esx" mode)
2015-07-16 15:19:41,503 [DEBUG]  @virtwho.py:152 - Starting infinite loop with 3600 seconds interval
2015-07-16 15:19:41,539 [DEBUG]  @esx.py:53 - Log into ESX
2015-07-16 15:19:43,365 [DEBUG]  @esx.py:56 - Creating ESX event filter
2015-07-16 15:19:43,508 [DEBUG]  @esx.py:140 - Waiting for ESX changes
2015-07-16 15:19:43,520 [INFO]  @subscriptionmanager.py:146 - Sending update in hosts-to-guests mapping: {
    "564d9e7a-4128-92b6-7284-6335f6b399be": [], 
    "aee4ff00-8c33-11e2-994a-6c3be51d959a": [
        {
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }, 
            "guestId": "564dab7d-3b72-51a1-eeda-586036106892", 
            "state": 5
        }, 
        {
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx"
            }, 
            "guestId": "4227d611-0abc-fc5e-7538-07ebd83fa9ba", 
            "state": 1
        }, 
        {
            "attributes": {
                "active": 1, 
                "virtWhoType": "esx"
            }, 
            "guestId": "421aa84b-a49e-e01c-fa72-0b570372dd9d", 
            "state": 1
        }, 
        {
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }, 
            "guestId": "564daa52-c518-b2f0-3c05-a343285910e1", 
            "state": 5
        }
    ]
}
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-07-16 15:21:59,751 [DEBUG]  @virtwho.py:91 - Using config named 'test-esx1'
2015-07-16 15:21:59,752 [INFO]  @virtwho.py:572 - Using configuration "test-esx1" ("esx" mode)
2015-07-16 15:21:59,765 [DEBUG]  @virtwho.py:152 - Starting infinite loop with 3600 seconds interval
2015-07-16 15:21:59,801 [DEBUG]  @esx.py:53 - Log into ESX
2015-07-16 15:22:00,477 [DEBUG]  @esx.py:56 - Creating ESX event filter
2015-07-16 15:22:00,586 [DEBUG]  @esx.py:140 - Waiting for ESX changes
2015-07-16 15:22:00,598 [DEBUG]  @virt.py:127 - Skipping host 'aee4ff00-8c33-11e2-994a-6c3be51d959a' because its uuid is excluded
2015-07-16 15:22:00,599 [INFO]  @subscriptionmanager.py:146 - Sending update in hosts-to-guests mapping: {
    "564d9e7a-4128-92b6-7284-6335f6b399be": []
}
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","564d9e7a-4128-92b6-7284-6335f6b399be"
9. Restart virt-who service ,check the virt-who log,two hosts can't send to Satellite server.
2015-07-16 15:24:37,826 [DEBUG]  @virtwho.py:91 - Using config named 'test-esx1'
2015-07-16 15:24:37,827 [INFO]  @virtwho.py:572 - Using configuration "test-esx1" ("esx" mode)
2015-07-16 15:24:37,839 [DEBUG]  @virtwho.py:152 - Starting infinite loop with 3600 seconds interval
2015-07-16 15:24:37,874 [DEBUG]  @esx.py:53 - Log into ESX
2015-07-16 15:24:38,578 [DEBUG]  @esx.py:56 - Creating ESX event filter
2015-07-16 15:24:38,659 [DEBUG]  @esx.py:140 - Waiting for ESX changes
2015-07-16 15:24:38,671 [DEBUG]  @virt.py:127 - Skipping host 'aee4ff00-8c33-11e2-994a-6c3be51d959a' because its uuid is excluded
2015-07-16 15:24:38,671 [DEBUG]  @virt.py:127 - Skipping host '564d9e7a-4128-92b6-7284-6335f6b399be' because its uuid is excluded
2015-07-16 15:24:38,671 [INFO]  @subscriptionmanager.py:146 - Sending update in hosts-to-guests mapping: {}
2015-07-16 15:24:38,671 [DEBUG]  @subscriptionmanager.py:111 - Authenticating with certificate: /etc/pki/consumer/cert.pem

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 17 Radek Novacek 2015-08-25 11:43:56 UTC
Yes, this can be backported to RHEL-6. Please open a tracking bug for that issue and I'll make sure it'll land in RHEL-6.8.

Comment 19 errata-xmlrpc 2015-11-19 11:55:47 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-2370.html


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