Bug 1573172

Summary: Failed to get mapping info - virt-who - KeyError: 'config.network.dnsConfig.hostName' [rhel-7.5.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: virt-whoAssignee: candlepin-bugs
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: high Docs Contact:
Priority: high    
Version: 7.5CC: ahumbe, asakpal, candlepin-bugs, csnyder, dbragalo, khowell, patalber, rajukuma, salmy, shbharad, shyan, wpinheir, wpoteat, yuefliu
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1569299 Environment:
Last Closed: 2018-05-14 16:13:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1569299    
Bug Blocks:    

Description Oneata Mircea Teodor 2018-04-30 11:57:45 UTC
This bug has been copied from bug #1569299 and has been proposed to be backported to 7.5 z-stream (EUS).

Comment 3 Shuai Yan 2018-05-03 06:37:17 UTC
rhel: 7.5 (Maipo)
satellite: build: 6.3.1

Before upgrading:
    virt-who: virt-who-0.21.5-1.el7.noarch
using a changed key like: 'xxx_config.network.dnsConfig.hostName'
got log:
2018-05-03 02:20:37,617 [virtwho.main DEBUG] MainProcess(30787):Thread-2 @esx.py:_prepare:132 - Creating ESX event filter
2018-05-03 02:20:38,420 [virtwho.main ERROR] MainProcess(30787):Thread-2 @virt.py:run:388 - Thread 'esx' fails with exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/virt.py", line 379, in run
    self._run()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/esx/esx.py", line 215, in _run
    assoc = self.getHostGuestMapping()
  File "/usr/lib/python2.7/site-packages/virtwho/virt/esx/esx.py", line 262, in getHostGuestMapping
    uuid = host['xxx_config.network.dnsConfig.hostName']
KeyError: 'xxx_config.network.dnsConfig.hostName'


Upgrading virt-who:
[root@sgi-uv2-01 ~]# rpm -Uvh ./virt-who-0.21.7-1.el7_5.noarch.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:virt-who-0.21.7-1.el7_5          ################################# [ 50%]
Cleaning up / removing...
   2:virt-who-0.21.5-1.el7            ################################# [100%]



After upgrading:
    virt-who: virt-who-0.21.7-1.el7_5.noarch
using a change key like 'xxx_config.network.dnsConfig.hostName'
got log:
2018-05-03 02:28:29,965 [virtwho.main DEBUG] MainProcess(30826):Thread-2 @esx.py:_prepare:129 - Log into ESX
2018-05-03 02:28:31,793 [virtwho.main DEBUG] MainProcess(30826):Thread-2 @esx.py:_prepare:132 - Creating ESX event filter
2018-05-03 02:28:32,549 [virtwho.main DEBUG] MainProcess(30826):Thread-2 @esx.py:getHostGuestMapping:268 - Host 'host-179' doesn't have hypervisor_id property
2018-05-03 02:28:32,549 [virtwho.main DEBUG] MainProcess(30826):Thread-2 @esx.py:getHostGuestMapping:268 - Host 'host-173' doesn't have hypervisor_id property
2018-05-03 02:28:32,549 [virtwho.main INFO] MainProcess(30826):Thread-2 @virt.py:_send_data:922 - Report for config "esx" gathered, placing in datastore


After upgrading virt-who, and run virt-who again, we cannot get the error log as before. 
So mark this as VERIFIED.

Comment 6 errata-xmlrpc 2018-05-14 16:13:46 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://access.redhat.com/errata/RHBA-2018:1409