Hi,

We use open-iscsi in our "ESOS" project. We have a custom rc/init script 
(not RHEL / Debian based), which starts the iSCSI initiator stack at boot. 
The current start() function in that script looks like this:
--snip--
start() {
    if [ ! -f "${INAME_FILE}" ]; then
        /bin/echo "Generating unique iSCSI initiator name..."
        /bin/echo "InitiatorName=`${ISCSI_INAME}`" > ${INAME_FILE} || exit 1
    fi
    /bin/echo "Starting iSCSI initiator service..."
    eval ${ISCSID} ${USER_OPTS} || exit 1
    /bin/touch ${ISCSID_LOCK}
    /bin/echo "Setting up iSCSI targets..."
    ${ISCSIADM} -m node --loginall=automatic || exit 1
}
--snip--

This all works just fine, but there is one behavior / scenario that occurs, 
and I'm looking for advice / best practices on how to overcome this:
- Let's say the remote iSCSI target server is down/unavailable
- An initiator (client) machine boots up, and the init script runs start() 
and the very last line of the function above (--loginall=automatic) 
attempts to login to all node/session records
- That command eventually times out of course if the iSCSI target that it's 
attempting to login to isn't up
- The storage target comes up sometime later, after the "iscsiadm 
--loginall=automatic ..." has already failed/returned
- The client/initiator machine then never logs in to the target without 
intervention (eg, running login by hand)

I'd like to address this so there is no manual intervention needed, or at 
least not after some "reasonable" amount of time (eg, 12 hours, or 
whatever). My first thought is to tweak the initial login timeout values in 
iscsid.conf, and then background the "iscsiadm --loginall=automatic ..." 
that runs in the start() function of our rc/init script. But I'm wondering 
if there is a better, perhaps cleaner way, of achieving this behavior. I 
see some options related to "discoveryd" and retry attempts, but I'm not 
convinced that applies to my situation after reading some documentation / 
examples of that. The portal / target are all static on the initiator side, 
so I don't need to discover new targets each time, just login to existing 
target/portal/node records.

Any help or guidance would be greatly appreciated. Thanks for your time.

--Marc

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to