Bug 1532483 - Improve osinfo kdump_status() logging level.
Summary: Improve osinfo kdump_status() logging level.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm
Version: 4.1.8
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ovirt-4.2.1
: ---
Assignee: Dan Kenigsberg
QA Contact: Petr Matyáš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-09 04:51 UTC by Germano Veit Michel
Modified: 2021-03-11 19:38 UTC (History)
7 users (show)

Fixed In Version: vdsm v4.20.14
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-15 17:54:02 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3319151 0 None None None 2018-01-12 02:37:52 UTC
Red Hat Product Errata RHEA-2018:1489 0 None None None 2018-05-15 17:55:30 UTC
oVirt gerrit 86088 0 master MERGED osinfo: error level on kdump_status exception logging 2018-01-13 00:26:28 UTC

Description Germano Veit Michel 2018-01-09 04:51:29 UTC
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 05:06:00 UTC
https://gerrit.ovirt.org/#/c/86088/

Comment 2 Petr Matyáš 2018-01-22 16:04:07 UTC
Verified on vdsm-4.20.14-1.el7ev.x86_64

Comment 3 Petr Matyáš 2018-01-22 16:06:14 UTC
This scenario is logged in vdsm.log as a warning.

Comment 9 errata-xmlrpc 2018-05-15 17:54:02 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/RHEA-2018:1489

Comment 10 Franta Kust 2019-05-16 13:07:06 UTC
BZ<2>Jira Resync


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