Logic to determine expected number of running session wrong (regression in hardy's open-iscsi 2.0.865-1ubuntu3.1)

Bug #394398 reported by Evan Broder on 2009-07-01
This bug affects 5 people
Affects Status Importance Assigned to Milestone
open-iscsi (Ubuntu)

Bug Description

Binary package hint: open-iscsi

The recent open-iscsi update changed from always running `iscsiadm -m node --loginall=automatic` to only running it if `cat /etc/iscsi/nodes/*/*/default 2>/dev/null| grep -c automatic` is not equal to `iscsiadm -m session 2>/dev/null | grep -c ^`.

On my servers, we use multiple paths from our severs to our iscsi targets, and as a result, we don't have any files at /etc/iscsi/nodes/*/*/default - ours are out /etc/iscsi/nodes/*/*/eth{0,1}. This means that the startup script concludes that the number of "expected" sessions is equal to the number of running sessions - i.e. 0 - and doesn't initiate a session.

I'm not entirely sure what the right solution is here - I think it might be using /etc/iscsi/nodes/*/*/* instead of default, but maybe not.

For reference, we configured multiple interfaces by creating /etc/iscsi/ifaces/eth{0,1} files, which seem to have been prompted creation of /etc/iscsi/nodes/*/*/eth{0,1}

tags: added: regression-update
Steve Langasek (vorlon) wrote :

Mathias, Dustin, could you look at what should be changed to fix this bug in karmic, and prepare an SRU for hardy if you think it's appropriate?

Changed in open-iscsi (Ubuntu Hardy):
importance: Undecided → High
Changed in open-iscsi (Ubuntu):
importance: Undecided → High
Martin Pitt (pitti) on 2009-07-15
Changed in open-iscsi (Ubuntu):
assignee: nobody → Canonical Server Team (canonical-server)
Thierry Carrez (ttx) on 2009-07-29
Changed in open-iscsi (Ubuntu):
assignee: Canonical Server Team (canonical-server) → Canonical Foundations Team (canonical-foundations)
Evan Broder (broder) wrote :

Well, since nobody else seems to be interested in dealing with this regression, here's a debdiff that I believe should fix at least the bug that I'm experiencing. I've uploaded the diff to my PPA (https://launchpad.net/~broder/+archive/ubuntu-tests), but due to the fact that all of my servers using iSCSI are in production use right now, I don't have any way to test the fix.

Changed in open-iscsi (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → Colin Watson (cjwatson)
Beanotj (beanotj) wrote :

This is also happening in oneiric ocelot package 2.0.871-0ubuntu9.

Running the following:
iscsiadm -m discovery -t st -p
iscsiadm -m node -T "iqn.2008-08.com.starwindsoftware:-testing" -v automatic --portal ""

automatically creates a folder structure like:

thus it never automatically starts because the following init.d script chunk never runs properly.
ISCSI_TARGET_NB=$(cat /etc/iscsi/nodes/*/*/default 2>/dev/null| grep -c automatic)
ISCSI_SESSION_NB=$($ADM -m session 2>/dev/null | grep -c ^)
if [ "${ISCSI_TARGET_NB}" -ne "${ISCSI_SESSION_NB}" ]; then
        $ADM -m node --loginall=automatic > /dev/null
        udevadm settle

Two possible workarounds:
Change ISCSI_TARGET_NB=$(cat /etc/iscsi/nodes/*/*/default 2>/dev/null| grep -c automatic) to ISCSI_TARGET_NB=$(cat /etc/iscsi/nodes/*/* 2>/dev/null| grep -c automatic)


mkdir /etc/iscsi/nodes/iqn.2008-08.com.starwindsoftware\:-testing/automatic
echo "automatic" >> /etc/iscsi/nodes/iqn.2008-08.com.starwindsoftware\:-testing/automatic/default

Jason Schuh (jschuh11) on 2012-03-14
Changed in open-iscsi (Ubuntu):
status: New → Incomplete
Evan Broder (broder) on 2012-03-14
Changed in open-iscsi (Ubuntu):
status: Incomplete → Confirmed
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in open-iscsi (Ubuntu Hardy):
status: New → Confirmed
Ben Beuchler (insyte) wrote :

This issue is present in Lucid, exactly as described for Hardy.

Abel Cheung (abelcheung) wrote :

Marked Bug #1001535 as duplicate of this one.

Abel Cheung (abelcheung) wrote :

The core of problem here is, Ubuntu modifications of open-iscsi was based on the braindead Debian versions *four years ago*, and no attempt of rebasing the work on recent Debian package (which at least reverts some of the stupid 'features' and eliminate some of the bugs against open-iscsi package) is done at all.

Abel Cheung (abelcheung) wrote :

Broder, this approach is not sufficient to fix problem, because if I set both 'node.startup' and 'node.conn[0].startup' to automatic, then the result from grep would be double counted, so ${ISCSI_TARGET_NB} and $ISCSI_SESSION_NB} never ever match. It's mere lucky that iscsiadm --loginall will still be triggered (and only executed once), and doesn't do anything harmful.

I can confirm I have also encountered the same issue and arrived at the same conclusion.

FWIW the node.conn[0].startup varialbe does not seem to get set to automatic when you discover targets with the automatic start-up variable set in your iscsid.conf. So the scenario outlined in Abel's post #8 would only occur if you are manually setting that value.

I did a bit of googling and it seems that Ben Beuchler has already asked the question regarding node.startup Vs. node.conn[0].startup on the open-iscsi group:


It appears that it shouldn't be necessary to set both variables.

Rolf Leggewie (r0lf) wrote :

Hardy has seen the end of its life and is no longer receiving any updates. Marking the Hardy task for this ticket as "Won't Fix".

Changed in open-iscsi (Ubuntu Hardy):
status: Confirmed → Won't Fix
Colin Watson (cjwatson) on 2014-12-18
Changed in open-iscsi (Ubuntu):
assignee: Colin Watson (cjwatson) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers