Open-iscsi doesn't login into target on boot

Hi,

I am on version 5.0-3 errata645 and want to use ZFS for the Samba share, since Univention does not support ZFS, I created an iSCSI target with TrueNas Sacle. I have little experience with Linux as an initiator, so maybe the solution to my problem is relatively simple. The connection works fine with the command “iscsiadm -m node –login” and my fstab entry looks like this.

###/etc/fstab

LABEL=sambalun /mnt/data01 ext4 _netdev,auto,users,user_xattr 0 2

NFS would be an alternative or a systemd service that executes a script as soon as iSCSI is started that connects the Lun and mounts it via the fstab, but I would be interested in the clean solution, I mean it should work without a hack.

After a reboot

root@test-01:~# iscsiadm -m session -o show
iscsiadm: No active sessions.
root@test-01:~#
root@test-01:~#
root@test-01:~# iscsiadm -m node --login
Logging in to [iface: default, target: iqn.2005-10.org.freenas.ctl:univention-samba, portal: 172.23.23.5,3260] (multiple)
Login to [iface: default, target: iqn.2005-10.org.freenas.ctl:univention-samba, portal: 172.23.23.5,3260] successful.
root@test-01:~#
root@test-01:~#
root@test-01:~# iscsiadm -m session -o show
tcp: [1] 172.23.23.5:3260,1 iqn.2005-10.org.freenas.ctl:univention-samba (non-flash)

Here my iSCSI configuration

###/etc/iscsi/iscsid.conf


######################
# iscsid daemon config
######################
# If you want iscsid to start the first time an 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 = /sbin/iscsid

# Check for active mounts on devices reachable through a session
# and refuse to logout if there are any.  Defaults to "No".
# iscsid.safe_logout = Yes

#############################
# 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 available ifaces simultaneously.
node.leading_login = Yes 



# *************
# 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 = user 
#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 = user 
node.session.auth.password_in = password

# 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 = user 
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

####

the problem was simple, I had overlooked that each connection has its own config file. Just changed from manual to automatic and everything works.

Mastodon