iSCSI Initiator Sessions….

A session is a TCP connection between an initiator node port and a target node port.LUNs are not accessible until a session is established. After targets have been discovered by the initiator, the initiator needs to log in to access the LUNs. Logging in establishes a session, which is a TCP connection between an initiator node port and a target node port. Before logging in, no sessions are active. Example:

# iscsiadm -m session

iscsiadm: No active sessions

Use the following command to log in and establish a session. When a session is established, iSCSI control, data, and status messages are communicated over the session.

# iscsiadm -m node -l

To log in to a specific target:

# iscsiadm -m node –targetname –p -l

Login to [iface: default, target:, portal:] successful.

To log off from all targets:

# iscsiadm -m node -u

To log off from a specific target, use the same login command as shown, except use –u.

Running the -m session command after logging in shows an active session:

# iscsiadm -m session

tcp: [1],1 (non-flash)

The TCP session includes a session ID (SID) of 1 in this example. Include –P <printlevel> for more details. Valid <printlevel> values are 1, 2, and 3.

The following example shows additional details on the session:

# iscsiadm -m session –P 1


    Current Portal:,1

    Persistent Portal:,1




        Iface Name: default

        Iface Transport: tcp

        Iface Initiatorname:

        Iface IPaddress:

        Iface HWaddress: <empty>

        Iface Netdev: <empty>

        SID: 1

        iSCSI Connection State: LOGGED IN

        iSCSI Session State: LOGGED IN

        Internal iscsid Session State: NO CHANGE

The following example provides the most details, including information about the attached SCSI devices. In this example, the target defines two LUNs:

# iscsiadm -m session –P 3



        Attached SCSI devices:


        Host Number: 4 State: running

        scsi10 Channel 00 Id 0 Lun:1

        Attached scsi disk sda State: running

        scsi10 Channel 00 Id 0 Lun:2

        Attached scsi disk sdb State: running