Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1532483

Summary: Improve osinfo kdump_status() logging level.
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: vdsmAssignee: Dan Kenigsberg <danken>
Status: CLOSED ERRATA QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.1.8CC: lsurette, lveyde, mgoldboi, mperina, srevivo, ycui, ykaul
Target Milestone: ovirt-4.2.1   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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 17:54:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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