Bug 1374203

Summary: Pass debug level and log file while accessing gluster volume via gfapi for qemu commands
Product: [oVirt] vdsm Reporter: Sahina Bose <sabose>
Component: GeneralAssignee: Dan Kenigsberg <danken>
Status: CLOSED NOTABUG QA Contact: Aharon Canan <acanan>
Severity: medium Docs Contact:
Priority: high    
Version: 4.17.18CC: bugs, jcody, prasanna.kalever
Target Milestone: ovirt-4.1.0-alphaFlags: sabose: ovirt-4.1?
sabose: planning_ack?
sabose: devel_ack?
sabose: testing_ack?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-15 10:20:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Sahina Bose 2016-09-08 08:59:28 UTC
Description of problem:

Debug level and log file options have been added for gluster driver in qemu. These need to be passed from vdsm for all qemu commands (qemu-img) in order to enable logging to files.

Version-Release number of selected component (if applicable):


How reproducible:
NA

Steps to Reproduce:
NA

Comment 1 Sahina Bose 2016-09-08 09:01:04 UTC
Prasanna, can you give a sample for the options?

Comment 2 Prasanna Kumar Kalever 2016-09-08 09:15:57 UTC
we can choose the log level [0-9] and logfile path (default to /dev/stderr)

Debug levels are 0-9, with 9 being the most verbose, and 0 representing no debugging output. The default is the same as it was before, which is a level of 4. The current logging levels defined in the gluster source are:                                                                          
0 - None                                                                           
1 - Emergency
2 - Alert
3 - Critical
4 - Error
5 - Warning
6 - Notice
7 - Info
8 - Debug
9 - Trace


For qemu-img:
Only URI format is supported because the qemu .brv_create() is currently doesn't support json style. 
# qemu-img create -o debug=9 -o logfile=/var/log/vdsm/qemu_gluster.log gluster://hostname/volname/VM.img 2G 

For qemu-system-x86_64 or qemu-kvm:
# *URI Style:                                                                     
  ---------                                                                      
  qemu-system-x86_64 -drive file=gluster://hostname/volname/image.qcow2,file.debug=9,file.logfile=/var/log/qemu/qemu-gfapi.log                  
                                                                                                                                                     
 *JSON Style:                                                                    
  ----------                                                                     
  qemu-system-x86_64 \
  'json:{                                                                        
           "driver":"qcow2",                                                     
           "file":{                                                              
              "driver":"gluster",                                                
              "volume":"volname",                                                
              "path":"image.qcow2",                                              
              "debug":"9",                                                       
              "logfile":"/var/log/qemu/qemu-gfapi.log",                          
              "server":[                                                         
                 {                                                               
                    "type":"tcp",                                                
                    "host":"1.2.3.4",                                            
                    "port":24007                                                 
                 },                                                              
                 {                                                               
                    "type":"unix",                                               
                    "socket":"/var/run/glusterd.socket"                          
                 }                                                               
              ]                                                                  
           }                                                                     
        }'
                                                                       
Note: DEBUG LEVEL patches are currently available with qemu but LOG FILE related patches are not merged yet (we can expect this in near future, as I already got an ACK with the patches)

Comment 3 Sahina Bose 2016-09-15 10:20:57 UTC
The log level will be controlled by "qemu_gfapi_debuglevel" in qemu.conf , see https://www.redhat.com/archives/libvir-list/2016-September/msg00485.html

This bug is not required. closing it