Bug 1359571

Summary: [Satellite5.7] virt-who send mapping info every refresh interval although no host/guests changes
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: ldai, ovasik, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.17-7.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:10:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Liushihui 2016-07-25 03:38:22 UTC
Description of problem:
When virt-who send mapping info to satellite5.X, although no changes in host/guests , virt-who still send mapping info to server periodically.

Version-Release number of selected component (if applicable):
virt-who-0.17-6.el7.noarch
subscription-manager-1.17.9-1.el7.x86_64
python-rhsm-1.17.5-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite5.7, make virt-who run at esx mode and enable debug option
[root@hp-microservergen8-01 ~]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_DEBUG=1
VIRTWHO_SATELLITE5=1
VIRTWHO_ESX=1
VIRTWHO_ESX_OWNER=ACME_Corporation
VIRTWHO_ESX_ENV=Library
VIRTWHO_ESX_USERNAME=Administrator
VIRTWHO_ESX_SERVER=10.73.2.95
VIRTWHO_ESX_PASSWORD=Welcome1!
VIRTWHO_SATELLITE_SERVER=sat57.jul21.redhat.com
VIRTWHO_SATELLITE_USERNAME=admin
VIRTWHO_SATELLITE_PASSWORD=redhat
2. restart virt-who service and check rhsm.log.
# /etc/init.d/virt-who restart
# tail -f /var/log/rhsm/rhsm.log
3. Make sure no host/guests changes, wait for over 120s.

Actual results:
Virt-who send host/guest mapping info to server side every refresh interval(60s)
========================start virtwho service===============================
2016-07-24 23:21:46,256 [virtwho.init INFO] MainProcess(36596):MainThread @main.py:main:160 - Using configuration "env/cmdline" ("esx" mode)
2016-07-24 23:21:46,257 [virtwho.init INFO] MainProcess(36596):MainThread @main.py:main:162 - Using reporter_id='hp-microservergen8-01.ml3.eng.bos.redhat.com-7f98a6f2c3d140578ed8088db627b31a'
2016-07-24 23:21:46,259 [virtwho.main DEBUG] MainProcess(36596):MainThread @executor.py:run:171 - Starting infinite loop with 60 seconds interval
2016-07-24 23:21:46,300 [virtwho.env_cmdline DEBUG] Esx-1(36603):MainThread @virt.py:run:364 - Virt backend 'env/cmdline' started
2016-07-24 23:21:46,302 [virtwho.env_cmdline DEBUG] Esx-1(36603):MainThread @esx.py:_prepare:128 - Log into ESX
2016-07-24 23:21:47,961 [virtwho.env_cmdline DEBUG] Esx-1(36603):MainThread @esx.py:_prepare:131 - Creating ESX event filter
2016-07-24 23:21:48,755 [virtwho.env_cmdline DEBUG] Esx-1(36603):MainThread @virt.py:enqueue:357 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-07-24 23:21:48,771 [virtwho.main DEBUG] MainProcess(36596):MainThread @satellite.py:_connect:75 - Initializing satellite connection to https://sat57.jul21.redhat.com/XMLRPC
2016-07-24 23:21:48,771 [virtwho.main DEBUG] MainProcess(36596):MainThread @satellite.py:_connect:84 - Initialized satellite connection
2016-07-24 23:21:48,772 [virtwho.main INFO] MainProcess(36596):MainThread @satellite.py:hypervisorCheckIn:208 - Sending update in hosts-to-guests mapping: 2 hypervisors and 1 guests found
2016-07-24 23:21:48,772 [virtwho.main DEBUG] MainProcess(36596):MainThread @satellite.py:hypervisorCheckIn:210 - Host-to-guest mapping: {
    "hypervisors": [
        {
            "hypervisorId": {
                "hypervisorId": "60554d56-20cb-f25e-7ab9-33e7e330dc15"
            }, 
            "name": "bootp-73-5-201.rhts.eng.pek2.redhat.com", 
            "guestIds": [], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.version": "6.0.0"
            }
        }, 
        {
            "hypervisorId": {
                "hypervisorId": "3e504d56-3982-037b-f3e6-669289892fa1"
            }, 
            "name": "bootp-73-5-248.rhts.eng.pek2.redhat.com", 
            "guestIds": [
                {
                    "guestId": "4206405a-4133-bd0c-f8a5-9c7bc1355837", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }
            ], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.version": "6.0.0"
            }
        }
    ]
}
........................................
2016-07-24 23:21:51,370 [virtwho.main DEBUG] MainProcess(36596):MainThread @executor.py:send_report:101 - Report for config "env/cmdline" sent

================After 60s, send mapping info to server again====================
2016-07-24 23:22:48,960 [virtwho.env_cmdline DEBUG] Esx-1(36603):MainThread @virt.py:enqueue:357 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-07-24 23:22:51,373 [virtwho.main DEBUG] MainProcess(36596):MainThread @satellite.py:_connect:75 - Initializing satellite connection to https://sat57.jul21.redhat.com/XMLRPC
2016-07-24 23:22:51,373 [virtwho.main DEBUG] MainProcess(36596):MainThread @satellite.py:_connect:84 - Initialized satellite connection
2016-07-24 23:22:51,373 [virtwho.main INFO] MainProcess(36596):MainThread @satellite.py:hypervisorCheckIn:208 - Sending update in hosts-to-guests mapping: 2 hypervisors and 1 guests found
2016-07-24 23:22:51,374 [virtwho.main DEBUG] MainProcess(36596):MainThread @satellite.py:hypervisorCheckIn:210 - Host-to-guest mapping: {
    "hypervisors": [
        {
            "hypervisorId": {
                "hypervisorId": "60554d56-20cb-f25e-7ab9-33e7e330dc15"
            }, 
            "name": "bootp-73-5-201.rhts.eng.pek2.redhat.com", 
            "guestIds": [], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.version": "6.0.0"
            }
        }, 
        {
            "hypervisorId": {
                "hypervisorId": "3e504d56-3982-037b-f3e6-669289892fa1"
            }, 
            "name": "bootp-73-5-248.rhts.eng.pek2.redhat.com", 
            "guestIds": [
                {
                    "guestId": "4206405a-4133-bd0c-f8a5-9c7bc1355837", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }
            ], 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.version": "6.0.0"
            }
        }
    ]
}
...................................
2016-07-24 23:22:53,793 [virtwho.main INFO] MainProcess(36596):MainThread @satellite.py:hypervisorCheckIn:234 - Mapping for config "env/cmdline" updated
2016-07-24 23:22:53,793 [virtwho.main DEBUG] MainProcess(36596):MainThread @executor.py:send_report:101 - Report for config "env/cmdline" sent

Expected results:
Virt-who should show notice info if no host/guest mapping info change in  esx mode. for example:
"No change in report gathered using config: "env/cmdline", report not sent."

Additional info:

Comment 3 Liushihui 2016-08-15 08:32:59 UTC
Verified it on virt-who-0.17-8.el7.noarch since virt-who will send "Report for config "test-rhevm1" hasn't changed, not sending" info to server when no host/guest updating. Therefore, verify it.

Comment 5 errata-xmlrpc 2016-11-04 05:10:04 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-2016-2387.html