Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1532483 - Improve osinfo kdump_status() logging level.
Improve osinfo kdump_status() logging level.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm (Show other bugs)
4.1.8
x86_64 Linux
unspecified Severity low
: ovirt-4.2.1
: ---
Assigned To: Dan Kenigsberg
Petr Matyáš
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-08 23:51 EST by Germano Veit Michel
Modified: 2018-05-15 13:55 EDT (History)
8 users (show)

See Also:
Fixed In Version: vdsm v4.20.14
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-05-15 13:54:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3319151 None None None 2018-01-11 21:37 EST
oVirt gerrit 86088 master MERGED osinfo: error level on kdump_status exception logging 2018-01-12 19:26 EST
Red Hat Product Errata RHEA-2018:1489 None None None 2018-05-15 13:55 EDT

  None (edit)
Description Germano Veit Michel 2018-01-08 23:51:29 EST
Description of problem:

An exception on osinfo kdump_status() during getCapabilities is logged with debug level. This won't go to vdsm.log unless as vdsm does not run with debug logs by default anymore.

So any issues while detecting the kdump status of the host are not logged in vdsm.log.

If an exception is thrown, vdsm will return -1 (UNKNOWN) to the engine while no error is logged at all in vdsm.log.

def kdump_status():                                                                                                                                                                                   
    try:                                                                                                                                                                                              
        # check if kdump service is running                                                                                                                                                           
        with open('/sys/kernel/kexec_crash_loaded', 'r') as f:                                                                                                                                        
            status = int(f.read().strip('\n'))                                                                                                                                                        
                                                                                                                                                                                                      
        if status == KdumpStatus.ENABLED:                                                                                                                                                             
            # check if fence_kdump is configured                                                                                                                                                      
            status = KdumpStatus.DISABLED                                                                                                                                                             
            with open('/etc/kdump.conf', 'r') as f:                                                                                                                                                   
                for line in f:                                                                                                                                                                        
                    if line.startswith('fence_kdump_nodes'):                                                                                                                                          
                        status = KdumpStatus.ENABLED                                                                                                                                                  
                        break                                                                                                                                                                         
    except (IOError, OSError, ValueError):                                                                                                                                                    
        status = KdumpStatus.UNKNOWN                                                                                                                                                                  
--->    logging.debug(                                                                                                                                                                                
            'Error detecting fence_kdump configuration status',                                                                                                                                       
            exc_info=True,                                                                                                                                                                            
        )                                                                                                                                                                                             
    return status 

Version-Release number of selected component (if applicable):
vdsm-4.19.43-3.el7ev.x86_64

How reproducible:
Always

Steps to Reproduce:
# chmod 600 /etc/kdump.conf
# vdsm-client Host getCapabilities | grep kdumpStatus
    "kdumpStatus": -1, 

Actual results: 
Logs are clean

Expected results: 
Exception logged with ERROR level.

Additional info:

Enabling DEBUG, I get this. But this requires back and forth on support case. 
# vdsm-client Host setLogLevel level=DEBUG
# vdsm-client Host getCapabilities | grep kdumpStatus

2018-01-09 14:34:32,690+1000 DEBUG (jsonrpc/3) [root] Error detecting fence_kdump configuration status (osinfo:93)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/osinfo.py", line 84, in kdump_status
    with open('/etc/kdump.conf', 'r') as f:
IOError: [Errno 13] Permission denied: '/etc/kdump.conf'
Comment 1 Germano Veit Michel 2018-01-09 00:06:00 EST
https://gerrit.ovirt.org/#/c/86088/
Comment 2 Petr Matyáš 2018-01-22 11:04:07 EST
Verified on vdsm-4.20.14-1.el7ev.x86_64
Comment 3 Petr Matyáš 2018-01-22 11:06:14 EST
This scenario is logged in vdsm.log as a warning.
Comment 9 errata-xmlrpc 2018-05-15 13:54:02 EDT
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/RHEA-2018:1489

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