#838540 Target portal group change at login not properly handled (logoutall skips session)

Package:
open-iscsi
Source:
open-iscsi
Description:
iSCSI initiator tools
Submitter:
Colby Ross
Date:
2022-01-25 16:18:02 UTC
Severity:
important
Tags:
#838540#5
Date:
2016-09-22 01:06:43 UTC
From:
To:
I am running debian stretch/sid with virt-manager, dkms, open-iscsi,
virtualbox guest additions, and openssh installed.

I have an iscsi session opened with a local box on my lan, running
FreeNAS. I have virt-manager and its dependencies installed, and have
connected to the iSCSI share with virt-manager. I have no issues
connecting, and no issues starting the machine back up. The issue comes
during reboot or shutdown.

It looks like the script to log out all sessions (logout-all.sh) is
being called at reboot/shutdown, but it is not finding any sessions to
disconnect from, even though when I issue iscsiadm -m session, I get
this output:

root@debscsi:~# iscsiadm -m session
tcp: [1] 172.16.5.30:3260,257 iqn.2015-12.org.cokenet.ctl:iscsi (non-flash)
root@debscsi:~#


The session is still connected, and I can access it. When I manually
invoke logout-all.sh, I get this:

root@debscsi:/lib/open-iscsi# ./logout-all.sh
iscsiadm: No matching sessions found
root@debscsi:/lib/open-iscsi#


When I try to debug the script with bash -x, I get the following output:
root@debscsi:/lib/open-iscsi# bash -x logout-all.sh
+ ISCSIADM=/sbin/iscsiadm
+ PIDFILE=/run/iscsid.pid
+ ISCSI_ROOT_KEEP_ALL_SESSIONS_AT_SHUTDOWN=0
+ '[' -f /etc/default/open-iscsi ']'
+ . /etc/default/open-iscsi
++ LVMGROUPS=
++ HANDLE_NETDEV=1
++ EXCLUDE_MOUNTS_AT_SHUTDOWN=
++ ISCSI_ROOT_KEEP_ALL_SESSIONS_AT_SHUTDOWN=0
+ '[' -f /etc/iscsi/iscsi.initramfs ']'
+ '[' '!' -s /run/iscsid.pid ']'
++ sed -n 1p /run/iscsid.pid
+ kill -0 1703
+ EXCLUDED_SESSIONS=
+ '[' -f /run/open-iscsi/shutdown-keep-sessions ']'
+ '[' -z '' ']'
+ /sbin/iscsiadm -m node --logoutall=all
iscsiadm: No matching sessions found
+ exit 21
root@debscsi:/lib/open-iscsi#

So, it appears the command being issued is /bin/iscsiadm -m node
--logoutall=all. When I try that command, I get the same error as when I 
try to run the script. The logout-all.sh script contains this function
that invokes that command:
# trivial case
if [ -z "$EXCLUDED_SESSIONS" ] ; then
         $ISCSIADM -m node --logoutall=all
         exit $?
fi

I don't know scripting language very well at all, but it is apparently
not finding the session to terminate correctly. When I manually log out
of the session, it reboots and shuts down normally with no issues. Maybe
this part of the script is being called in error, I'm not sure.  When I
replace the command with $ISCSIADM -m node -u, it reboots and shuts down
fine, but I consider this more of a hack than a true fix.

I previously tried to determine the cause of the hang on
reboot/shutdown.  What happens is the system tries to ping the iscsi
target, but fails because the network interface has already been brought
down, and the system hangs indefinitely.  I get the error connection1:0:
ping timeout of 5 secs expired, recv timeout 5, last rx 4294927718, last
ping 4294928970, now 4294930224. However, I think the error is just an
indication the target was not logged out properly and the system thinks
its still connected.

I previously reported this under the systemd package, as I thought it
was an issue with systemd and its ordering of shutdown scripts (possibly
killing the interface before the logout of iscsi session). That was
reported in bug# 838028 and I have updated this bug to reflect my
additional troubleshooting and findings. Any help with the appropriate
fix for this would be appreciated.

Colby Ross

#838540#10
Date:
2016-09-22 09:31:41 UTC
From:
To:
Hi,

This is weird, I cannot reproduce this here. I logged into a
new iSCSI session, and after the login I immediately called

iscsiadm -m node --logoutall=all

In that case, the logout worked for me.

(Note that we don't consider return code 21 an error in the
shutdown logic, because if you just install open-iscsi and
there are no sessions configured, iscsiadm will also return
that error code - which is perfectly fine there, as there
really are no sessions in that case. See the systemd service
file's SuccessExitStatus line. Doesn't help here though,
because you clearly have an active session.)

On a running system with the iSCSI session logged in, could
you post the contents of

iscsiadm -m node -p $PORTAL -T $TARGET -P1

to this bug report?

The command is harmless and will leave the session intact. You
can run it on a production system. Replace $PORTAL with your
portal IP and $TARGET with the target, you can find them out by
using iscsiadm -m node -P1, which is also harmless.

(I don't care about IP addresses or target names, they shouldn't
be relevant to this, so feel free to censor them.)
network interface is deconfigured, the system hangs for a long
time. If a logout wasn't possible, the only proper thing to do
would actually be to not deconfigure the network interface.

ifupdown already contains such logic when iSCSI is used for the
root filesystem, because it checks if /etc/iscsi/iscsi.initramfs
is present and refuses to deconfigure on shutdown if it is. We
should really make this a lot more dynamical: if there are still
iSCSI sessions left over after shutdown (for whatever reason),
we should simply keep the network interface up and running - and
not just if iSCSI is used in the initramfs. Feel free to open a
separate bug report for this.

That makes the problem that logout doesn't work in your case so
much worse, but it isn't the root cause of your problem. The
output of the iscsiadm command would be helpful for debugging
this.

Regards,
Christian

#838540#15
Date:
2016-09-22 10:45:34 UTC
From:
To:
Christian

As requested:
# BEGIN RECORD 2.0-873
node.name = iqn.2015-12.org.cokenet.ctl:iscsi
node.tpgt = 1
node.startup = manual
node.leading_login = No
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.gateway = <empty>
iface.subnet_mask = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
iface.state = <empty>
iface.vlan_id = 0
iface.vlan_priority = 0
iface.vlan_state = <empty>
iface.iface_num = 0
iface.mtu = 0
iface.port = 0
iface.bootproto = <empty>
iface.dhcp_alt_client_id_state = <empty>
iface.dhcp_alt_client_id = <empty>
iface.dhcp_dns = <empty>
iface.dhcp_learn_iqn = <empty>
iface.dhcp_req_vendor_id_state = <empty>
iface.dhcp_vendor_id_state = <empty>
iface.dhcp_vendor_id = <empty>
iface.dhcp_slp_da = <empty>
iface.fragmentation = <empty>
iface.gratuitous_arp = <empty>
iface.incoming_forwarding = <empty>
iface.tos_state = <empty>
iface.tos = 0
iface.ttl = 0
iface.delayed_ack = <empty>
iface.tcp_nagle = <empty>
iface.tcp_wsf_state = <empty>
iface.tcp_wsf = 0
iface.tcp_timer_scale = 0
iface.tcp_timestamp = <empty>
iface.redirect = <empty>
iface.def_task_mgmt_timeout = 0
iface.header_digest = <empty>
iface.data_digest = <empty>
iface.immediate_data = <empty>
iface.initial_r2t = <empty>
iface.data_seq_inorder = <empty>
iface.data_pdu_inorder = <empty>
iface.erl = 0
iface.max_receive_data_len = 0
iface.first_burst_len = 0
iface.max_outstanding_r2t = 0
iface.max_burst_len = 0
iface.chap_auth = <empty>
iface.bidi_chap = <empty>
iface.strict_login_compliance = <empty>
iface.discovery_auth = <empty>
iface.discovery_logout = <empty>
node.discovery_address = <empty>
node.discovery_port = 0
node.discovery_type = static
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.nr_sessions = 1
node.session.auth.authmethod = None
node.session.auth.username = <empty>
node.session.auth.password = <empty>
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 172.16.5.30
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.DataDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD

Colby

#838540#20
Date:
2016-09-22 11:05:00 UTC
From:
To:
Thanks. I just compared that with what's in my test setup, and
apart from IP addresses and the target name, it's identical. I
tested the --logoutall=all command on both Stretch and sid,
and it does work for me, so I really don't know what's going on
here.

Could you check if any of the configuration files of open-iscsi
were modified (and if so, attach them, removing passwords of
course)?

To check for modification of config files:

dpkg-query -f '${Conffiles}\n' -W open-iscsi | \
    awk '{printf("%s  %s\n", $2, $1);}' | md5sum -c -

(Any file that isn't shown next to OK was modified.)

Also, could you try calling iscsiadm with -d 8 to increase
debugging while logging out? (Unmounting the drive before of
course.)

iscsiadm -d 8 -m node --logoutall=all

Also, is there anything interesting in the logfiles regarding
open-iscsi?

journalctl -u iscsid -u open-iscsi

Regards,
Christian

#838540#25
Date:
2016-09-22 11:26:40 UTC
From:
To:
I ran the dpkg command to check config files:

root@debscsi:~# dpkg-query -f '${Conffiles}\n' -W open-iscsi | \
 >     awk '{printf("%s  %s\n", $2, $1);}' | md5sum -c -
/etc/default/open-iscsi: OK
/etc/init.d/iscsid: OK
/etc/init.d/open-iscsi: OK
/etc/iscsi/iscsid.conf: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
root@debscsi:~#


It is worth noting that during the apt-get install open-iscsi, it
prompts with a message about iscsi.conf, and asks if I want to replace,
or keep. I have chosen both Yes and No on both and it doesn't affect its
operation. Not saying either way is not causing the issue, just noting.

Output of debug:

root@debscsi:~# iscsiadm -d 8 -m node --logoutall=all
iscsiadm: Max file limits 1024 65536
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'targetname'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/targetname'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/targetname'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/targetname' with attribute value
'iqn.2015-12.org.cokenet.ctl:iscsi'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'username'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/username'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/username'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/username' with attribute value '(null)'
iscsiadm: could not read username: 5
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'password'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/password'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/password'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/password' with attribute value '(null)'
iscsiadm: could not read password: 5
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'username_in'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/username_in'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/username_in'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/username_in' with attribute value
'(null)'
iscsiadm: could not read username in: 5
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'password_in'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/password_in'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/password_in'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/password_in' with attribute value
'(null)'
iscsiadm: could not read password in: 5
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'recovery_tmo'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/recovery_tmo'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/recovery_tmo'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/recovery_tmo' with attribute value '120'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'lu_reset_tmo'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/lu_reset_tmo'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/lu_reset_tmo'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/lu_reset_tmo' with attribute value '30'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'tgt_reset_tmo'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/tgt_reset_tmo'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/tgt_reset_tmo'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/tgt_reset_tmo' with attribute value '30'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'abort_tmo'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/abort_tmo'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/abort_tmo'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/abort_tmo' with attribute value '15'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_session/session1'/'tpgt'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/tpgt'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/tpgt'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/tpgt' with attribute value '257'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection1:0'/'persistent_address'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection1:0/persistent_address'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection1:0/persistent_address'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection1:0/persistent_address' with
attribute value '172.16.5.30'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection1:0'/'address'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection1:0/address'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection1:0/address'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection1:0/address' with attribute value
'172.16.5.30'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection1:0'/'persistent_port'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection1:0/persistent_port'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection1:0/persistent_port'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection1:0/persistent_port' with
attribute value '3260'
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_connection/connection1:0'/'port'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_connection/connection1:0/port'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_connection/connection1:0/port'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_connection/connection1:0/port' with attribute value '3260'
iscsiadm: sysfs_device_get: open '/class/iscsi_session/session1'
iscsiadm: sysfs_resolve_link: path link '/class/iscsi_session/session1'
points to '../../devices/platform/host3/session1/iscsi_session/session1'
iscsiadm: sysfs_resolve_link: base '/class/iscsi_session/session1', tail
'devices/platform/host3/session1/iscsi_session/session1', back 2
iscsiadm: sysfs_resolve_link: after moving back ''
iscsiadm: sysfs_device_get: new uncached device
'/devices/platform/host3/session1/iscsi_session/session1'
iscsiadm: sysfs_device_set_values: kernel='session1'
iscsiadm: sysfs_device_set_values: kernel_number='1'
iscsiadm: sysfs_device_get: subsystem link
'/sys/devices/platform/host3/session1/iscsi_session/session1/subsystem'
points to '../../../../../../class/iscsi_session'
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host3/session1/iscsi_session/session1',
subsystem='iscsi_session', driver=''
iscsiadm: sysfs_device_get_parent: open
'/devices/platform/host3/session1/iscsi_session/session1'
iscsiadm: sysfs_device_get_parent:
'/devices/platform/host3/session1/iscsi_session/session1'
iscsiadm: sysfs_device_get: open
'/devices/platform/host3/session1/iscsi_session'
iscsiadm: sysfs_device_get: new uncached device
'/devices/platform/host3/session1/iscsi_session'
iscsiadm: sysfs_device_set_values: kernel='iscsi_session'
iscsiadm: sysfs_device_set_values: kernel_number=''
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host3/session1/iscsi_session', subsystem='',
driver=''
iscsiadm: sysfs_device_get_parent: open
'/devices/platform/host3/session1/iscsi_session'
iscsiadm: sysfs_device_get_parent:
'/devices/platform/host3/session1/iscsi_session'
iscsiadm: sysfs_device_get: open '/devices/platform/host3/session1'
iscsiadm: sysfs_device_get: new uncached device
'/devices/platform/host3/session1'
iscsiadm: sysfs_device_set_values: kernel='session1'
iscsiadm: sysfs_device_set_values: kernel_number='1'
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host3/session1', subsystem='', driver=''
iscsiadm: sysfs_device_get_parent: open '/devices/platform/host3/session1'
iscsiadm: sysfs_device_get_parent: '/devices/platform/host3/session1'
iscsiadm: sysfs_device_get: open '/devices/platform/host3'
iscsiadm: sysfs_device_get: new uncached device '/devices/platform/host3'
iscsiadm: sysfs_device_set_values: kernel='host3'
iscsiadm: sysfs_device_set_values: kernel_number='3'
iscsiadm: sysfs_device_get: subsystem link
'/sys/devices/platform/host3/subsystem' points to '../../../bus/scsi'
iscsiadm: sysfs_device_get: add to cache
'devpath=/devices/platform/host3', subsystem='scsi', driver=''
iscsiadm: sysfs_attr_get_value: open '/class/scsi_host/host3'/'proc_name'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/scsi_host/host3/proc_name'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/scsi_host/host3/proc_name'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/scsi_host/host3/proc_name' with attribute value 'iscsi_tcp'
iscsiadm: in read_transports
iscsiadm: Adding new transport iser
iscsiadm: Matched transport iser
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/iser'/'handle'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/iser/handle'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/iser/handle'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/iser/handle' with attribute value
'18446744072639602720'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/iser'/'caps'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/iser/caps'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/iser/caps'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/iser/caps' with attribute value '0x89'
iscsiadm: Adding new transport tcp
iscsiadm: Matched transport tcp
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/tcp'/'handle'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/tcp/handle'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/tcp/handle'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/tcp/handle' with attribute value
'18446744072637591584'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_transport/tcp'/'caps'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_transport/tcp/caps'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_transport/tcp/caps'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_transport/tcp/caps' with attribute value '0x39'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host3'/'hwaddress'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host3/hwaddress'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host3/hwaddress'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_host/host3/hwaddress' with attribute value '(null)'
iscsiadm: could not read hwaddress for host3
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host3'/'ipaddress'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host3/ipaddress'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host3/ipaddress'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_host/host3/ipaddress' with attribute value '172.16.5.15'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host3'/'netdev'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host3/netdev'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host3/netdev'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_host/host3/netdev' with attribute value '(null)'
iscsiadm: could not read netdev for host3
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'initiatorname'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/initiatorname'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/initiatorname'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/initiatorname' with attribute value
'iqn.1993-08.org.debian:01:7d1fb0ca2bd1'
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host3'/'port_state'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host3/port_state'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host3/port_state'
iscsiadm: sysfs_attr_get_value: stat
'/sys/class/iscsi_host/host3/port_state' failed: No such file or directory
iscsiadm: Could not read attr port_state on path /class/iscsi_host/host3
iscsiadm: sysfs_attr_get_value: open '/class/iscsi_host/host3'/'port_speed'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_host/host3/port_speed'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_host/host3/port_speed'
iscsiadm: sysfs_attr_get_value: stat
'/sys/class/iscsi_host/host3/port_speed' failed: No such file or directory
iscsiadm: Could not read attr port_speed on path /class/iscsi_host/host3
iscsiadm: sysfs_attr_get_value: open
'/class/iscsi_session/session1'/'ifacename'
iscsiadm: sysfs_attr_get_value: new uncached attribute
'/sys/class/iscsi_session/session1/ifacename'
iscsiadm: sysfs_attr_get_value: add to cache
'/sys/class/iscsi_session/session1/ifacename'
iscsiadm: sysfs_attr_get_value: cache
'/sys/class/iscsi_session/session1/ifacename' with attribute value 'default'
iscsiadm: found targetname iqn.2015-12.org.cokenet.ctl:iscsi address
172.16.5.30 pers address 172.16.5.30 port 3260 pers port 3260 driver tcp
iface name default ipaddress 172.16.5.15 netdev  hwaddress iname
iqn.1993-08.org.debian:01:7d1fb0ca2bd1
iscsiadm: rec read looking for config file
/etc/iscsi/nodes/iqn.2015-12.org.cokenet.ctl:iscsi/172.16.5.30,3260.
iscsiadm: rec read looking for config file
/etc/iscsi/nodes/iqn.2015-12.org.cokenet.ctl:iscsi/172.16.5.30,3260,257/default.
iscsiadm: Could not stat
/etc/iscsi/nodes/iqn.2015-12.org.cokenet.ctl:iscsi/172.16.5.30,3260,257/default:
No such file or directory.
iscsiadm: could not read data for
[iqn.2015-12.org.cokenet.ctl:iscsi,172.16.5.30.3260]
iscsiadm: No matching sessions found
root@debscsi:~#

Output of the journalctl command:

root@debscsi:~# cat output2.txt
-- Logs begin at Wed 2016-09-21 20:18:41 EDT, end at Thu 2016-09-22 
07:23:33 EDT. --
Sep 21 20:18:44 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 20:18:45 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 20:18:45 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 20:18:45 debscsi iscsiadm[1670]: iscsiadm: No records found
Sep 21 20:18:45 debscsi iscsid[1630]: iSCSI daemon with pid=1631 started!
Sep 21 20:18:45 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 20:18:49 debscsi iscsid[1630]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 20:19:16 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 20:19:16 debscsi logout-all.sh[2067]: iscsiadm: No matching
sessions found
Sep 21 20:19:16 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 20:19:16 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 20:19:16 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 20:19:47 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 20:19:48 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 20:19:48 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 20:19:48 debscsi iscsiadm[1673]: iscsiadm: No records found
Sep 21 20:19:48 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 20:19:49 debscsi iscsid[1667]: iSCSI daemon with pid=1668 started!
Sep 21 20:19:52 debscsi iscsid[1667]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 20:21:52 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 20:21:52 debscsi logout-all.sh[2079]: iscsiadm: No matching
sessions found
Sep 21 20:21:52 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 20:21:52 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 20:21:52 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 20:27:31 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 20:27:32 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 20:27:32 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 20:27:32 debscsi iscsiadm[1707]: iscsiadm: No records found
Sep 21 20:27:32 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 20:27:33 debscsi iscsid[1702]: iSCSI daemon with pid=1703 started!
Sep 21 20:27:36 debscsi iscsid[1702]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 20:53:23 debscsi iscsid[1702]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is shutdown.
Sep 21 20:55:52 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 20:55:52 debscsi logout-all.sh[2618]: iscsiadm: No matching
sessions found
Sep 21 20:55:52 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 20:55:52 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 20:55:52 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 20:56:15 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 20:56:15 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 20:56:15 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 20:56:15 debscsi iscsiadm[1732]: iscsiadm: No records found
Sep 21 20:56:15 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 20:56:16 debscsi iscsid[1726]: iSCSI daemon with pid=1727 started!
Sep 21 20:56:19 debscsi iscsid[1726]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 20:59:32 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 20:59:33 debscsi logout-all.sh[2099]: Logging out of session
[sid: 1, target: iqn.2015-12.org.cokenet.ctl:iscsi, portal:
172.16.5.30,3260]
Sep 21 20:59:33 debscsi logout-all.sh[2099]: Logout of [sid: 1, target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] successful.
Sep 21 20:59:33 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 20:59:33 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 20:59:33 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 20:59:51 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 20:59:52 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 20:59:52 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 20:59:52 debscsi iscsiadm[1726]: iscsiadm: No records found
Sep 21 20:59:52 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 20:59:53 debscsi iscsid[1717]: iSCSI daemon with pid=1718 started!
Sep 21 20:59:55 debscsi iscsid[1717]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 21:02:01 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 21:02:01 debscsi logout-all.sh[2034]: iscsiadm: No matching
sessions found
Sep 21 21:02:01 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 21:02:01 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 21:02:01 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 21:09:24 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 21:09:24 debscsi iscsid[1601]: iSCSI logger with pid=1640 started!
Sep 21 21:09:24 debscsi iscsid[1640]: iSCSI daemon with pid=1641 started!
Sep 21 21:09:24 debscsi systemd[1]: iscsid.service: Failed to read PID
from file /run/iscsid.pid: Invalid argument
Sep 21 21:09:24 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 21:09:24 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 21:09:24 debscsi iscsiadm[1644]: iscsiadm: No records found
Sep 21 21:09:24 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 21:09:30 debscsi iscsid[1640]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 21:11:11 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 21:11:12 debscsi logout-all.sh[2078]: Logging out of session
[sid: 1, target: iqn.2015-12.org.cokenet.ctl:iscsi, portal:
172.16.5.30,3260]
Sep 21 21:11:12 debscsi logout-all.sh[2078]: Logout of [sid: 1, target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] successful.
Sep 21 21:11:12 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 21:11:12 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 21:11:12 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 21:11:27 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 21:11:27 debscsi iscsid[1613]: iSCSI logger with pid=1619 started!
Sep 21 21:11:27 debscsi iscsid[1619]: iSCSI daemon with pid=1620 started!
Sep 21 21:11:27 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 21:11:27 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 21:11:27 debscsi iscsiadm[1624]: iscsiadm: No records found
Sep 21 21:11:29 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 21:11:32 debscsi iscsid[1619]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 21:13:04 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 21:13:04 debscsi logout-all.sh[2079]: Logging out of session
[sid: 1, target: iqn.2015-12.org.cokenet.ctl:iscsi, portal:
172.16.5.30,3260]
Sep 21 21:13:04 debscsi logout-all.sh[2079]: Logout of [sid: 1, target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] successful.
Sep 21 21:13:04 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 21:13:04 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 21:13:04 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 21 21:13:22 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 21 21:13:22 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 21 21:13:23 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 21 21:13:23 debscsi iscsiadm[1654]: iscsiadm: No records found
Sep 21 21:13:23 debscsi iscsid[1650]: iSCSI daemon with pid=1651 started!
Sep 21 21:13:24 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 21 21:13:30 debscsi iscsid[1650]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
Sep 21 21:19:53 debscsi systemd[1]: Stopping Login to default iSCSI
targets...
Sep 21 21:19:54 debscsi logout-all.sh[2119]: Logging out of session
[sid: 1, target: iqn.2015-12.org.cokenet.ctl:iscsi, portal:
172.16.5.30,3260]
Sep 21 21:19:54 debscsi logout-all.sh[2119]: Logout of [sid: 1, target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] successful.
Sep 21 21:19:54 debscsi systemd[1]: Stopped Login to default iSCSI targets.
Sep 21 21:19:54 debscsi systemd[1]: Stopping iSCSI initiator daemon
(iscsid)...
Sep 21 21:19:54 debscsi systemd[1]: Stopped iSCSI initiator daemon (iscsid).
-- Reboot --
Sep 22 06:37:25 debscsi systemd[1]: Starting iSCSI initiator daemon
(iscsid)...
Sep 22 06:37:26 debscsi systemd[1]: Started iSCSI initiator daemon (iscsid).
Sep 22 06:37:26 debscsi systemd[1]: Starting Login to default iSCSI
targets...
Sep 22 06:37:26 debscsi iscsiadm[1754]: iscsiadm: No records found
Sep 22 06:37:27 debscsi systemd[1]: Started Login to default iSCSI targets.
Sep 22 06:37:27 debscsi iscsid[1749]: iSCSI daemon with pid=1750 started!
Sep 22 06:37:31 debscsi iscsid[1749]: Connection1:0 to [target:
iqn.2015-12.org.cokenet.ctl:iscsi, portal: 172.16.5.30,3260] through
[iface: default] is operational now
root@debscsi:~#

#838540#30
Date:
2016-09-22 11:28:05 UTC
From:
To:
Sorry, forgot to attach the modified file:

root@debscsi:~# cat /etc/iscsi/iscsid.conf
#
# Open-iSCSI default configuration.
# Could be located at /etc/iscsi/iscsid.conf or ~/.iscsid.conf
#
# Note: To set any of these values for a specific node/session run
# the iscsiadm --mode node --op command for the value. See the README
# and man page for iscsiadm for details on the --op command.
#

######################
# iscsid daemon config
######################
# If you want iscsid to start the first time a iscsi tool
# needs to access it, instead of starting it when the init
# scripts run, set the iscsid startup command here. This
# should normally only need to be done by distro package
# maintainers.
#
# Default for Fedora and RHEL. (uncomment to activate).
# iscsid.startup = /etc/rc.d/init.d/iscsid force-start
#
# Default for upstream open-iscsi scripts (uncomment to activate).
iscsid.startup = /usr/sbin/iscsid


#############################
# NIC/HBA and driver settings
#############################
# open-iscsi can create a session and bind it to a NIC/HBA.
# To set this up see the example iface config file.

#*****************
# Startup settings
#*****************

# To request that the iscsi initd scripts startup a session set to
"automatic".
# node.startup = automatic
#
# To manually startup the session set to "manual". The default is manual.
node.startup = manual

# For "automatic" startup nodes, setting this to "Yes" will try logins
on each
# available iface until one succeeds, and then stop.  The default "No"
will try
# logins on all availble ifaces simultaneously.
node.leading_login = No

# *************
# CHAP Settings
# *************

# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
#node.session.auth.authmethod = CHAP

# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
#node.session.auth.username = username
#node.session.auth.password = password

# To set a CHAP username and password for target(s)
# authentication by the initiator, uncomment the following lines:
#node.session.auth.username_in = username_in
#node.session.auth.password_in = password_in

# To enable CHAP authentication for a discovery session to the target
# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
#discovery.sendtargets.auth.authmethod = CHAP

# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
#discovery.sendtargets.auth.username = username
#discovery.sendtargets.auth.password = password

# To set a discovery session CHAP username and password for target(s)
# authentication by the initiator, uncomment the following lines:
#discovery.sendtargets.auth.username_in = username_in
#discovery.sendtargets.auth.password_in = password_in

# ********
# Timeouts
# ********
#
# See the iSCSI REAME's Advanced Configuration section for tips
# on setting timeouts when using multipath or doing root over iSCSI.
#
# To specify the length of time to wait for session re-establishment
# before failing SCSI commands back to the application when running
# the Linux SCSI Layer error handler, edit the line.
# The value is in seconds and the default is 120 seconds.
# Special values:
# - If the value is 0, IO will be failed immediately.
# - If the value is less than 0, IO will remain queued until the session
# is logged back in, or until the user runs the logout command.
node.session.timeo.replacement_timeout = 120

# To specify the time to wait for login to complete, edit the line.
# The value is in seconds and the default is 15 seconds.
node.conn[0].timeo.login_timeout = 15

# To specify the time to wait for logout to complete, edit the line.
# The value is in seconds and the default is 15 seconds.
node.conn[0].timeo.logout_timeout = 15

# Time interval to wait for on connection before sending a ping.
node.conn[0].timeo.noop_out_interval = 5

# To specify the time to wait for a Nop-out response before failing
# the connection, edit this line. Failing the connection will
# cause IO to be failed back to the SCSI layer. If using dm-multipath
# this will cause the IO to be failed to the multipath layer.
node.conn[0].timeo.noop_out_timeout = 5

# To specify the time to wait for abort response before
# failing the operation and trying a logical unit reset edit the line.
# The value is in seconds and the default is 15 seconds.
node.session.err_timeo.abort_timeout = 15

# To specify the time to wait for a logical unit response
# before failing the operation and trying session re-establishment
# edit the line.
# The value is in seconds and the default is 30 seconds.
node.session.err_timeo.lu_reset_timeout = 30

# To specify the time to wait for a target response
# before failing the operation and trying session re-establishment
# edit the line.
# The value is in seconds and the default is 30 seconds.
node.session.err_timeo.tgt_reset_timeout = 30


#******
# Retry
#******

# To specify the number of times iscsid should retry a login
# if the login attempt fails due to the node.conn[0].timeo.login_timeout
# expiring modify the following line. Note that if the login fails
# quickly (before node.conn[0].timeo.login_timeout fires) because the
network
# layer or the target returns an error, iscsid may retry the login more than
# node.session.initial_login_retry_max times.
#
# This retry count along with node.conn[0].timeo.login_timeout
# determines the maximum amount of time iscsid will try to
# establish the initial login. node.session.initial_login_retry_max is
# multiplied by the node.conn[0].timeo.login_timeout to determine the
# maximum amount.
#
# The default node.session.initial_login_retry_max is 8 and
# node.conn[0].timeo.login_timeout is 15 so we have:
#
# node.conn[0].timeo.login_timeout * node.session.initial_login_retry_max =
#                                                               120 seconds
#
# Valid values are any integer value. This only
# affects the initial login. Setting it to a high value can slow
# down the iscsi service startup. Setting it to a low value can
# cause a session to not get logged into, if there are distuptions
# during startup or if the network is not ready at that time.
node.session.initial_login_retry_max = 8

################################
# session and device queue depth
################################

# To control how many commands the session will queue set
# node.session.cmds_max to an integer between 2 and 2048 that is also
# a power of 2. The default is 128.
node.session.cmds_max = 128

# To control the device's queue depth set node.session.queue_depth
# to a value between 1 and 1024. The default is 32.
node.session.queue_depth = 32

##################################
# MISC SYSTEM PERFORMANCE SETTINGS
##################################

# For software iscsi (iscsi_tcp) and iser (ib_iser) each session
# has a thread used to transmit or queue data to the hardware. For
# cxgb3i you will get a thread per host.
#
# Setting the thread's priority to a lower value can lead to higher
throughput
# and lower latencies. The lowest value is -20. Setting the priority to
# a higher value, can lead to reduced IO performance, but if you are seeing
# the iscsi or scsi threads dominate the use of the CPU then you may want
# to set this value higher.
#
# Note: For cxgb3i you must set all sessions to the same value, or the
# behavior is not defined.
#
# The default value is -20. The setting must be between -20 and 20.
node.session.xmit_thread_priority = -20


#***************
# iSCSI settings
#***************

# To enable R2T flow control (i.e., the initiator must wait for an R2T
# command before sending any data), uncomment the following line:
#
#node.session.iscsi.InitialR2T = Yes
#
# To disable R2T flow control (i.e., the initiator has an implied
# initial R2T of "FirstBurstLength" at offset 0), uncomment the
following line:
#
# The defaults is No.
node.session.iscsi.InitialR2T = No

#
# To disable immediate data (i.e., the initiator does not send
# unsolicited data with the iSCSI command PDU), uncomment the following
line:
#
#node.session.iscsi.ImmediateData = No
#
# To enable immediate data (i.e., the initiator sends unsolicited data
# with the iSCSI command packet), uncomment the following line:
#
# The default is Yes
node.session.iscsi.ImmediateData = Yes

# To specify the maximum number of unsolicited data bytes the initiator
# can send in an iSCSI PDU to a target, edit the following line.
#
# The value is the number of bytes in the range of 512 to (2^24-1) and
# the default is 262144
node.session.iscsi.FirstBurstLength = 262144

# To specify the maximum SCSI payload that the initiator will negotiate
# with the target for, edit the following line.
#
# The value is the number of bytes in the range of 512 to (2^24-1) and
# the defauls it 16776192
node.session.iscsi.MaxBurstLength = 16776192

# To specify the maximum number of data bytes the initiator can receive
# in an iSCSI PDU from a target, edit the following line.
#
# The value is the number of bytes in the range of 512 to (2^24-1) and
# the default is 262144
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144

# To specify the maximum number of data bytes the initiator will send
# in an iSCSI PDU to the target, edit the following line.
#
# The value is the number of bytes in the range of 512 to (2^24-1).
# Zero is a special case. If set to zero, the initiator will use
# the target's MaxRecvDataSegmentLength for the MaxXmitDataSegmentLength.
# The default is 0.
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0

# To specify the maximum number of data bytes the initiator can receive
# in an iSCSI PDU from a target during a discovery session, edit the
# following line.
#
# The value is the number of bytes in the range of 512 to (2^24-1) and
# the default is 32768
#
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768

# To allow the targets to control the setting of the digest checking,
# with the initiator requesting a preference of enabling the checking,
uncomment# one or both of the following lines:
#node.conn[0].iscsi.HeaderDigest = CRC32C,None
#node.conn[0].iscsi.DataDigest = CRC32C,None
#
# To allow the targets to control the setting of the digest checking,
# with the initiator requesting a preference of disabling the checking,
# uncomment one or both of the following lines:
#node.conn[0].iscsi.HeaderDigest = None,CRC32C
#node.conn[0].iscsi.DataDigest = None,CRC32C
#
# To enable CRC32C digest checking for the header and/or data part of
# iSCSI PDUs, uncomment one or both of the following lines:
#node.conn[0].iscsi.HeaderDigest = CRC32C
#node.conn[0].iscsi.DataDigest = CRC32C
#
# To disable digest checking for the header and/or data part of
# iSCSI PDUs, uncomment one or both of the following lines:
#node.conn[0].iscsi.HeaderDigest = None
#node.conn[0].iscsi.DataDigest = None
#
# The default is to never use DataDigests or HeaderDigests.
#

# For multipath configurations, you may want more than one session to be
# created on each iface record.  If node.session.nr_sessions is greater
# than 1, performing a 'login' for that node will ensure that the
# appropriate number of sessions is created.
node.session.nr_sessions = 1

#************
# Workarounds
#************

# Some targets like IET prefer after an initiator has sent a task
# management function like an ABORT TASK or LOGICAL UNIT RESET, that
# it does not respond to PDUs like R2Ts. To enable this behavior uncomment
# the following line (The default behavior is Yes):
node.session.iscsi.FastAbort = Yes

# Some targets like Equalogic prefer that after an initiator has sent
# a task management function like an ABORT TASK or LOGICAL UNIT RESET, that
# it continue to respond to R2Ts. To enable this uncomment this line
# node.session.iscsi.FastAbort = No
root@debscsi:~#

#838540#35
Date:
2016-09-22 11:35:24 UTC
From:
To:
I think I figured out part of it. When its looking for the config file
on logout, its looking in 172.16.5.30,3260,257 -- that does not exist on
my system. However, 172.16.5.30,3260,1 does, but it doesn't check this.
When I manually create the folder it is looking for and copy the
"default" file to it, it logs out with iscsiadm -m node --logoutall=all.
Not sure why its looking for that folder when it doesn't exist, but this
should help you.


Colby

#838540#40
Date:
2016-09-22 12:25:06 UTC
From:
To:
Control: severity -1 important
Control: tags -1 + upstream confirmed
Control: retitle -1 Target portal group change at login not properly handled (logoutall skips session)
can reproduce it in a more complex way), now I see where the problem
lies. You were logging in with the default target portal group (1),
but the target told you "errr, actually, I only have the target portal
group 257". The login was fine with that (and told the kernel the
right value), but since the logout tries to match the running session
against the database (which wasn't updated to reflect the new portal
group id), it pretends there are no sessions running.

I'm raising the severity of this bug to important, because it's really
ugly if a hang is caused in this kind of configuration.

So there are two problems:

 - either lack of database update when a different target portal
   group is detected at login or more likely, since database updates
   at login shouldn't actually happen, no real match against against
   the original configuration for a given running session

 - no useful error message when matching running session against
   configuration fails (it just skips it)

Since this is not Debian-specific, I'll forward this upstream. The
"workaround" you stumbled upon yourself is actually the way to make
your configuration match the actual target (technically, you'd still
need to update the node.tpgt = to 257 in the 'default' configuration
file), so I would suggest you keep that anyway, irrespective of this
bug.

Just a quick question: how precisely did you setup the iSCSI client
configuration? You have node.discovery_type = static in there, which
is unusual, because typically (when not using iSNS or the Firmware)
you'd use sendtargets discovery to get a list of targets for a given
portal, and then the TPG would be detected automatically.

Regards,
Christian

#838540#51
Date:
2016-09-22 14:09:23 UTC
From:
To:
Christian

Sorry I didn't mention this before. I thought I had.

I set up the iscsi share in virt-manager. I basically installed the
open-iscsi package and used virt-manager to attach to the share as a
storage pool. The share is nothing more than a pass through to a kvm guest.
Virt-manager I believe reconnects the share are system start up. No manual
configuration of any of the open-iscsi files tool place on my part unless
virt-manager did it on its own.

SD attaches the share after the login prompt for tty1 appears. My guess is
maybe the share is the last thing to get connected via virt-manager.

Colby

#838540#56
Date:
2016-09-22 14:24:51 UTC
From:
To:
Christian

It's also strange it's detecting portal group 257. It may be an issue with
freenas but I have the portal group ID set as 1 for my iscsi  share in Free
NAS.

Colby

#838540#61
Date:
2016-09-22 14:46:29 UTC
From:
To:
You probably did, I just didn't know virt-manager supported configuring
guests for iSCSI now, so it didn't register when you said something
about virt-manager. Sorry.

But then there's also at least a minor bug in libvirt, because libvirt
will be the one doing the target discovery, and it doesn't seem to pass
the target portal group properly to the guest. I'll also take a look at
that.

Well, you can do a sendtargets discovery to see what open-iscsi thinks:

iscsiadm -m discovery -t sendtargets -p $PORTAL_IP

The portal group is after a comma in the first column.

I never used FreeNAS to export iSCSI though, so I can't really comment
on that part. Maybe the ID in FreeNAS is internal only and the public
ID (sometimes also referred to as "portal group tag") is allocated when
the portal group is created? (Just speculating.)

Regards,
Christian

#838540#66
Date:
2016-09-22 14:48:32 UTC
From:
To:
I'll give it a go and see what I find.

I can say I had no issues either Debian Jessie 8.5 with this same exact
setup.

Colby

#838540#71
Date:
2016-09-22 19:31:55 UTC
From:
To:
Christian

Just an update -- iscsiadm's discover protocol detects the target portal
group tag as 257. Windows own iSCSI initiator does as well.

Colby

#838540#76
Date:
2016-09-22 19:38:13 UTC
From:
To:
Thanks, that was what I expected. I'll update you once I've pinned
down the precise problem.

Regards,
Christian

#838540#81
Date:
2016-09-22 19:41:09 UTC
From:
To:
Also, not sure if it is relevant or not, but after the discovery command
was issued, it started attaching to the iSCSI share twice at boot. I had
to manually remove both entries in
/etc/iscsi/nodes/iqn.2015-12.org.cokenet.ctl:iscsi. After that, it
stopped attaching to it twice, and is back to attaching to it once (as
/dev/sdb).

Colby

#838540#86
Date:
2016-10-02 10:29:02 UTC
From:
To:
Hi again,

I've now dug into the code a bit and forwarded the bug to the
upstream open-iscsi mailing list. Once a patch exists that
upstream is happy with as well, I'll push a new version to sid
with the patch for that included.

I've also found out where the problem in libvirt lies and will
report a bug for that as well.

Regards,
Christian

#838540#93
Date:
2022-01-25 16:15:09 UTC
From:
To:
------------------------------

Hi Member!

Thank you for your interest in our products.
Your Annual membership for *NORTON 360 PROTECTION* has been renewed &
updated successfully.


*Item Name* *Finish Date* *Quantity* *Total* *Payment Method*
NORTON 360 PROTECTION In 1 year 1 $579.00 USD Auto Debit
Order No. DD20220125ON
Invoice Date: 2022-01-25


*If you require urgent assistance, please call our Experts for refund and
settlement issue on * +1 – ( 850 ) – ( 203 ) – 4159