HowTo Debug iSER

Version 7

    This post shows various of options to debug iSER.

    iSER and iSCSI state machines, sessions, connections, etc discussions are out of scope for this post (refer to open-iscsi website).

    This post assume familiarity with iSER initiator and TGT target.






    Identify Connections


    View discovered targets:

    # iscsiadm -m node,1 iqn.tgt-1


    Identify the target transport is configured as iSER:

    # iscsiadm -m node -T iqn.tgt-1 | grep -i trans

    iface.transport_name = iser


    View sessions:

    # iscsiadm -m session

    iser: [6],1 iqn.tgt-1 (non-flash)


    To get more debug info about the sessions:

    # iscsiadm -m session -P 3



    Debug Levels


    1. Debug level for ib_iser


    There are four debug levels for ib_iser kernel module.


    • 0 Error only (default)
    • 1 Warning
    • 2 Info
    • 3 Debug


    View the current debug level of ib_iser:

    # cat /sys/module/ib_iser/parameters/debug_level


    To change the debug Level (for example to 2=Info) run:

    # echo 2 > /sys/module/ib_iser/parameters/debug_level
    # cat /sys/module/ib_iser/parameters/debug_level


    2. Debug level for libiscsi

    Since iSER is an extension to iSCSI and uses libiscsi it is also possible to increase debug level for libiscsi.

    # echo 1 > /sys/module/libiscsi/parameters/debug_libiscsi_conn

    # echo 1 > /sys/module/libiscsi/parameters/debug_libiscsi_eh

    # echo 1 > /sys/module/libiscsi/parameters/debug_libiscsi_session



    • There are many debug messages. Enabling all debug levels may flood the log with information causing you to possible miss the important information.
    • Long time runs with debug level enabled may increase the log size dramatically.


    3. Debug iscsid

    iSCSI state machine is managed via a user-space daemon called iscsid

    To debug iscsid, you can restart the iscsid process with a different debug level.

    Example, to execute iscsid in foreground with debug level 3:

    # service iscsid stop

    # iscsid -d 3 -f


    Log files


    ib_iser messages are logged to the system default log file.


    Distros with systemd have logs in the journalctl

    Older distros usually have it in /var/log/messages or /var/log/syslog



    TGTD Target


    tgtd is a user-space application which uses syslog for the logging output. It is also possible to send the log to stdout.

    Example, running tgtd in foreground with debug:

    # tgtd -d 1 -f


    Note: tgtd has only 1 debug level.