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 1248425 - Failed to filter host as "AttributeError"
Summary: Failed to filter host as "AttributeError"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: xingge
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-30 09:22 UTC by Liushihui
Modified: 2016-12-01 00:33 UTC (History)
5 users (show)

Fixed In Version: virt-who-0.14-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 11:57:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
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 Liushihui 2015-07-30 09:22:57 UTC
Description of problem:
Virt-who failed to filter host as "AttributeError: 'str' object has no attribute 'hypervisorId'" when communicate with subscription-manager

Version-Release number of selected component (if applicable):
virt-who-0.14-2.el7.noarch
subscription-manager-1.15.6-1.el7.x86_64
python-rhsm-1.15.3-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
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
2015-07-30 17:16:40,245 [DEBUG]  @virtwho.py:120 - Using config named 'test-esx1'
2015-07-30 17:16:40,246 [INFO]  @virtwho.py:655 - Using configuration "test-esx1" ("esx" mode)
2015-07-30 17:16:40,246 [DEBUG]  @virtwho.py:203 - Starting infinite loop with 3600 seconds interval
2015-07-30 17:16:40,284 [DEBUG]  @esx.py:55 - Log into ESX
2015-07-30 17:16:40,516 [DEBUG]  @esx.py:58 - Creating ESX event filter
2015-07-30 17:16:40,604 [DEBUG]  @esx.py:142 - Waiting for ESX changes
2015-07-30 17:16:40,606 [ERROR]  @virtwho.py:177 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 160, in send
    self._sendGuestAssociation(report)
  File "/usr/share/virt-who/virtwho.py", line 190, in _sendGuestAssociation
    report.association,
  File "/usr/share/virt-who/virt/virt.py", line 171, in association
    if self._config.filter_host_uuids is not None and host.hypervisorId not in self._config.filter_host_uuids:
AttributeError: 'str' object has no attribute 'hypervisorId'

Actual results:
Failed to filter out host as "AttributeError: 'str' object has no attribute 'hypervisorId'" when virt-who communicate with subscription-manager

Expected results:
Virt-who should support filter out host after setting filter_host_uuids/exclude_host_uuids

Additional info:

Comment 1 Radek Novacek 2015-07-30 13:16:10 UTC
Fixed in virt-who-0.14-3.el7.

Comment 3 Liushihui 2015-08-11 06:01:14 UTC
Verified it on virt-who-0.14-3.el7.noarch since virt-who can filter out host after configure "filter_host_uuids". 

Verified version
virt-who-0.14-3.el7.noarch
subscription-manager-1.15.9-2.el7.x86_64
python-rhsm-1.15.4-2.el7.x86_64
Satellite 6.1.0-20150731.0

Verified process:
1.Register system to SAM server
2.Configure virt-who run at esx mode and configure a host which can't  be filtered.
[root@hp-z220-06 virt-who.d]# cat /etc/virt-who.d/virt
[test-esx1]
type=esx
server=10.66.78.97
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
filter_host_uuids="aee4ff00-8c33-11e2-994a-6c3be51d959a"
3. Restart virt-who service, check virt-who's log
2015-08-11 13:51:19,924 [DEBUG]  @virtwho.py:126 - Using config named 'test-esx1'
2015-08-11 13:51:19,925 [INFO]  @virtwho.py:662 - Using configuration "test-esx1" ("esx" mode)
2015-08-11 13:51:19,925 [DEBUG]  @virtwho.py:209 - Starting infinite loop with 3600 seconds interval
2015-08-11 13:51:19,960 [DEBUG]  @esx.py:55 - Log into ESX
2015-08-11 13:51:20,184 [DEBUG]  @esx.py:58 - Creating ESX event filter
2015-08-11 13:51:20,255 [DEBUG]  @esx.py:142 - Waiting for ESX changes
2015-08-11 13:51:20,259 [DEBUG]  @virt.py:173 - Skipping host '86b2bd00-8bad-11e2-87f4-6c3be514699d' because its uuid is not included
2015-08-11 13:51:20,259 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-08-11 13:51:23,269 [DEBUG]  @subscriptionmanager.py:146 - Checking if server has capability 'hypervisor_async'
2015-08-11 13:51:26,594 [DEBUG]  @subscriptionmanager.py:158 - Server does not have 'hypervisors_async' capability
2015-08-11 13:51:26,595 [INFO]  @subscriptionmanager.py:165 - Sending update in hosts-to-guests mapping: {}
4.configure another host which can be filtered.
[root@hp-z220-07 ~]# cat /etc/virt-who.d/virt 
[test-esx1]
type=esx
server=10.66.78.97
username=Administrator
password=qwer1234P!
owner=ACME_Corporation
env=Library
filter_host_uuids="86b2bd00-8bad-11e2-87f4-6c3be514699d"
5. Restart virt-who service, check virt-who's log
2015-08-11 13:52:18,550 [DEBUG]  @virtwho.py:126 - Using config named 'test-esx1'
2015-08-11 13:52:18,551 [INFO]  @virtwho.py:662 - Using configuration "test-esx1" ("esx" mode)
2015-08-11 13:52:18,552 [DEBUG]  @virtwho.py:209 - Starting infinite loop with 3600 seconds interval
2015-08-11 13:52:18,586 [DEBUG]  @esx.py:55 - Log into ESX
2015-08-11 13:52:18,845 [DEBUG]  @esx.py:58 - Creating ESX event filter
2015-08-11 13:52:18,912 [DEBUG]  @esx.py:142 - Waiting for ESX changes
2015-08-11 13:52:18,916 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-08-11 13:52:22,410 [DEBUG]  @subscriptionmanager.py:146 - Checking if server has capability 'hypervisor_async'
2015-08-11 13:52:25,654 [DEBUG]  @subscriptionmanager.py:158 - Server does not have 'hypervisors_async' capability
2015-08-11 13:52:25,654 [INFO]  @subscriptionmanager.py:165 - Sending update in hosts-to-guests mapping: {
    "86b2bd00-8bad-11e2-87f4-6c3be514699d": [
        {
            "guestId": "42390187-0ca7-6139-dadb-549a990f34e3", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }
        }, 
        {
            "guestId": "564d1d17-06d9-46c3-beea-fed130d564e7", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }
        }, 
        {
            "guestId": "4239d107-b6b3-ec67-3317-678288dafe5a", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "esx"
            }
        }
    ]
}

Result: according to the result of step 3 and step 5, virt-who can filter out host after configure "filter_host_uuids". Therefore, verify it

Comment 4 errata-xmlrpc 2015-11-19 11:57:41 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.