[Bug 394398] Re: Logic to determine expected number of running session wrong (regression in hardy's open-iscsi 2.0.865-1ubuntu3.1)

Beanotj 394398 at bugs.launchpad.net
Wed Nov 23 16:43:22 UTC 2011


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

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

automatically creates a folder structure like:
/etc/iscsi/nodes/iqn.2008-08.com.starwindsoftware\:-testing/169.169.169.12\,3260

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
fi

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)

or

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

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/394398

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

Status in “open-iscsi” package in Ubuntu:
  New
Status in “open-iscsi” source package in Hardy:
  New

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}

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/394398/+subscriptions




More information about the foundations-bugs mailing list