<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Xen block iSCSI script with multipath support</title>
	<atom:link href="http://backdrift.org/xen-block-iscsi-script-with-multipath-support/feed" rel="self" type="application/rss+xml" />
	<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support</link>
	<description></description>
	<lastBuildDate>Sat, 21 Jan 2012 13:22:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-974</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Thu, 29 Sep 2011 14:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-974</guid>
		<description>So, as it turns out, I&#039;ve been sort&#039;ve leading you down the garden path for not much return.

I am not actually set up yet to take advantage of the multipath part of the equation... and I didn&#039;t realize (because *none* of the doco sources I&#039;ve been looking at bothered to say so) that the stock install comes with a block-iscsi script that does *not* do multipath, but apparently works ok. 

Oops.  :-}

I&#039;ll come back to this, but probably not for a week or two.  I&#039;ll send you patches when I figure them out.  Thanks for the help, though, sir.</description>
		<content:encoded><![CDATA[<p>So, as it turns out, I&#8217;ve been sort&#8217;ve leading you down the garden path for not much return.</p>
<p>I am not actually set up yet to take advantage of the multipath part of the equation&#8230; and I didn&#8217;t realize (because *none* of the doco sources I&#8217;ve been looking at bothered to say so) that the stock install comes with a block-iscsi script that does *not* do multipath, but apparently works ok. </p>
<p>Oops.  :-}</p>
<p>I&#8217;ll come back to this, but probably not for a week or two.  I&#8217;ll send you patches when I figure them out.  Thanks for the help, though, sir.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-973</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Wed, 28 Sep 2011 19:40:52 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-973</guid>
		<description>Well, the first one appears to have mismatched quoting.  Let me go back to my local copy of the script.

Oh.  Nope; just a typography problem.banner.

/appl/xen/cent/57 # set -vx
banner:/appl/xen/cent/57 # SCSI_DEV=&quot;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\``&quot;
SCSI_DEV=&quot;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\``&quot;
basename `/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0`
/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0
+++ /usr/bin/readlink /dev/disk/by-path/ip-:-iscsi--lun-0
++ basename
basename: missing operand
Try `basename --help&#039; for more information.
+ SCSI_DEV=/dev/

Aha.

The symlinks in the /dev/disk/by-path directory on SUSE are *relative*; they&#039;re &quot;../../sda&quot;.  Is that what&#039;s causing the problem?</description>
		<content:encoded><![CDATA[<p>Well, the first one appears to have mismatched quoting.  Let me go back to my local copy of the script.</p>
<p>Oh.  Nope; just a typography problem.banner.</p>
<p>/appl/xen/cent/57 # set -vx<br />
banner:/appl/xen/cent/57 # SCSI_DEV=&#8221;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\&#8220;&#8221;<br />
SCSI_DEV=&#8221;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\&#8220;&#8221;<br />
basename `/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0`<br />
/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0<br />
+++ /usr/bin/readlink /dev/disk/by-path/ip-:-iscsi&#8211;lun-0<br />
++ basename<br />
basename: missing operand<br />
Try `basename &#8211;help&#8217; for more information.<br />
+ SCSI_DEV=/dev/</p>
<p>Aha.</p>
<p>The symlinks in the /dev/disk/by-path directory on SUSE are *relative*; they&#8217;re &#8220;../../sda&#8221;.  Is that what&#8217;s causing the problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-972</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Wed, 28 Sep 2011 19:29:38 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-972</guid>
		<description>@Baylink, I see, thats progress!  So I would then move on to the get_mpath_map function, testing those commands and resolving any potential differences between redhat and suse.  These two variables are particularly important:

SCSI_DEV=&quot;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\``&quot;

MPATH_MAP=&quot;/dev/mapper/`multipath -ll ${SCSI_DEV} &#124; head -1 &#124; awk &#039;{ print $1}&#039;`&quot;</description>
		<content:encoded><![CDATA[<p>@Baylink, I see, thats progress!  So I would then move on to the get_mpath_map function, testing those commands and resolving any potential differences between redhat and suse.  These two variables are particularly important:</p>
<p>SCSI_DEV=&#8221;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\&#8220;&#8221;</p>
<p>MPATH_MAP=&#8221;/dev/mapper/`multipath -ll ${SCSI_DEV} | head -1 | awk &#8216;{ print $1}&#8217;`&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-971</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Wed, 28 Sep 2011 19:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-971</guid>
		<description>Ok.  I abstracted out ${NODES} at the top of the script (patch to follow), and now I get this instead:

Sep 28 15:18:26 banner kernel: [344763.765160] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)
Sep 28 15:18:26 banner kernel: [344763.767690] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)
Sep 28 15:18:26 banner logger: /etc/xen/scripts/block: add XENBUS_PATH=backend/vbd/0/268441856
Sep 28 15:18:26 banner logger: /etc/xen/scripts/block-iscsi: add XENBUS_PATH=backend/vbd/0/268441856
Sep 28 15:18:26 banner block-iscsi: *** Beginning device add ***
Sep 28 15:18:26 banner block-iscsi: IQN: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0
Sep 28 15:18:26 banner block-iscsi: 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1
Sep 28 15:18:26 banner block-iscsi: TARGET: 192.168.1.190:3260
Sep 28 15:18:26 banner block-iscsi: logging in to iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 on 192.168.1.190:3260
Sep 28 15:18:31 banner kernel: [344769.234912] scsi6 : iSCSI Initiator over TCP/IP
Sep 28 15:18:32 banner kernel: [344769.491819] scsi 6:0:0:0: Direct-Access     Openfile Virtual disk     0    PQ: 0 ANSI: 4
Sep 28 15:18:32 banner block-iscsi: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0, portal: 192.168.1.190,3260]
Sep 28 15:18:32 banner block-iscsi: Login to [iface: default, target: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0, portal: 192.168.1.190,3260]: successful
Sep 28 15:18:32 banner kernel: [344769.492445] sd 6:0:0:0: Attached scsi generic sg2 type 0
Sep 28 15:18:32 banner kernel: [344769.494970] sd 6:0:0:0: [sda] 16777216 512-byte logical blocks: (8.58 GB/8.00 GiB)
Sep 28 15:18:32 banner kernel: [344769.495315] sd 6:0:0:0: [sda] Write Protect is off
Sep 28 15:18:32 banner kernel: [344769.495322] sd 6:0:0:0: [sda] Mode Sense: 77 00 00 08
Sep 28 15:18:32 banner kernel: [344769.497558] sd 6:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn&#039;t support DPO or FUA
Sep 28 15:18:32 banner kernel: [344769.520537]  sda: sda1 sda2 sda3
Sep 28 15:18:32 banner kernel: [344769.524294] sd 6:0:0:0: [sda] Attached SCSI disk
Sep 28 15:18:32 banner iscsid: connection2:0 is operational now
Sep 28 15:18:37 banner logger: /etc/xen/scripts/block: Writing backend/vbd/0/268441856/hotplug-error /etc/xen/scripts/block failed; error detected. backend/vbd/0/268441856/hotplug-status error to xenstore.
Sep 28 15:18:37 banner logger: /etc/xen/scripts/block: /etc/xen/scripts/block failed; error detected.
Sep 28 15:18:37 banner logger: /etc/xen/scripts/block: remove XENBUS_PATH=backend/vbd/0/268441856
Sep 28 15:18:37 banner logger: /etc/xen/scripts/xen-hotplug-cleanup: XENBUS_PATH=backend/vbd/0/268441856

The modified script:

banner:/appl/xen/cent/57 # cat /etc/xen/scripts/block-iscsi
#!/bin/bash
# block-iscsi  -  2009 Keith Herron 
#
# multipath enabled block-iscsi xen block script.
#
# Note: This script depends on a block-iscsi.conf file
#       located in the same directory.  This file contains
#       an array of available iSCSI target IPs
#

dir=$(dirname &quot;$0&quot;)
. &quot;$dir/block-common.sh&quot;
. &quot;$dir/block-iscsi.conf&quot;

# Where do your node files live?
#NODES=/var/lib/iscsi
NODES=/etc/iscsi

# Log which mode we are in
logger -t block-iscsi &quot;*** Beginning device $command ***&quot;

# Fetch the iqn we specify in the domu config file
#
IQN=$(xenstore_read &quot;$XENBUS_PATH/params&quot;)
logger -t block-iscsi &quot;IQN: ${IQN}&quot;

# We define portal ip in order to support new luns which don&#039;t yet have
# ${NODES}/node entrys yet, not dynamic but avoids manual discovery
#
for PORTAL in ${PORTALS[@]}; do
  logger -t block-iscsi `iscsiadm -m discovery -t st -p $PORTAL`
done

# Using the iscsi node directory we can determine the ip and port of
# our iscsi target on a lun by lun basis
#
  IP=`ls ${NODES}/nodes/${IQN} &#124; cut -d , -f 1`
PORT=`ls ${NODES}/nodes/${IQN} &#124; cut -d , -f 2`

logger -t block-iscsi &quot;TARGET: ${IP}:${PORT}&quot;

# This is called by each command to determine which multipath map to use
#
function get_mpath_map {
   # Re-run multipath to ensure that maps are up to date
   #
   multipath
   sleep 2

   # Now we determine which /dev/sd* device belongs to the iqn
   #
   SCSI_DEV=&quot;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\``&quot;
   logger -t block-iscsi &quot;scsi device: ${SCSI_DEV}&quot;

   # And using the /dev/sd* device we can determine its corresponding multipath entry
   #
   MPATH_MAP=&quot;/dev/mapper/`multipath -ll ${SCSI_DEV} &#124; head -1 &#124; awk &#039;{ print $1}&#039;`&quot;
   logger -t block-iscsi &quot;mpath device: ${MPATH_MAP}&quot;
}

case $command in
   add)
      # Login to the target
      logger -t block-iscsi &quot;logging in to ${IQN} on ${IP}:${PORT}&quot;
      sleep 5
      #FIXME needs more advanced race condition logic
      iscsiadm -m node -T ${IQN} -p ${IP}:${PORT} --login &#124; logger -t block-iscsi
      sleep 5
      #FIXME needs more advanced race condition logic
      get_mpath_map

      if [ -a ${MPATH_MAP} ]; then
         logger -t block-iscsi &quot;${command}ing device: ${MPATH_MAP}&quot;
         write_dev ${MPATH_MAP}
      fi
   ;;

   remove)
      get_mpath_map
      if [ -a ${MPATH_MAP} ]; then
         logger -t block-iscsi &quot;flushing buffers on ${MPATH_MAP}&quot;
         blockdev --flushbufs ${MPATH_MAP}
         logger -t block-iscsi &quot;attempting logout of ${IQN} on ${IP}:${PORT}&quot;
         iscsiadm -m node -T ${IQN} -p ${IP}:${PORT} --logout &#124; logger -t block-iscsi
         sleep  10
         #FIXME needs more advanced race condition logic
      fi
      sleep 5
      #FIXME needs more advanced race condition logic
   ;;
esac</description>
		<content:encoded><![CDATA[<p>Ok.  I abstracted out ${NODES} at the top of the script (patch to follow), and now I get this instead:</p>
<p>Sep 28 15:18:26 banner kernel: [344763.765160] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)<br />
Sep 28 15:18:26 banner kernel: [344763.767690] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)<br />
Sep 28 15:18:26 banner logger: /etc/xen/scripts/block: add XENBUS_PATH=backend/vbd/0/268441856<br />
Sep 28 15:18:26 banner logger: /etc/xen/scripts/block-iscsi: add XENBUS_PATH=backend/vbd/0/268441856<br />
Sep 28 15:18:26 banner block-iscsi: *** Beginning device add ***<br />
Sep 28 15:18:26 banner block-iscsi: IQN: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0<br />
Sep 28 15:18:26 banner block-iscsi: 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1<br />
Sep 28 15:18:26 banner block-iscsi: TARGET: 192.168.1.190:3260<br />
Sep 28 15:18:26 banner block-iscsi: logging in to iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 on 192.168.1.190:3260<br />
Sep 28 15:18:31 banner kernel: [344769.234912] scsi6 : iSCSI Initiator over TCP/IP<br />
Sep 28 15:18:32 banner kernel: [344769.491819] scsi 6:0:0:0: Direct-Access     Openfile Virtual disk     0    PQ: 0 ANSI: 4<br />
Sep 28 15:18:32 banner block-iscsi: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0, portal: 192.168.1.190,3260]<br />
Sep 28 15:18:32 banner block-iscsi: Login to [iface: default, target: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0, portal: 192.168.1.190,3260]: successful<br />
Sep 28 15:18:32 banner kernel: [344769.492445] sd 6:0:0:0: Attached scsi generic sg2 type 0<br />
Sep 28 15:18:32 banner kernel: [344769.494970] sd 6:0:0:0: [sda] 16777216 512-byte logical blocks: (8.58 GB/8.00 GiB)<br />
Sep 28 15:18:32 banner kernel: [344769.495315] sd 6:0:0:0: [sda] Write Protect is off<br />
Sep 28 15:18:32 banner kernel: [344769.495322] sd 6:0:0:0: [sda] Mode Sense: 77 00 00 08<br />
Sep 28 15:18:32 banner kernel: [344769.497558] sd 6:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn&#8217;t support DPO or FUA<br />
Sep 28 15:18:32 banner kernel: [344769.520537]  sda: sda1 sda2 sda3<br />
Sep 28 15:18:32 banner kernel: [344769.524294] sd 6:0:0:0: [sda] Attached SCSI disk<br />
Sep 28 15:18:32 banner iscsid: connection2:0 is operational now<br />
Sep 28 15:18:37 banner logger: /etc/xen/scripts/block: Writing backend/vbd/0/268441856/hotplug-error /etc/xen/scripts/block failed; error detected. backend/vbd/0/268441856/hotplug-status error to xenstore.<br />
Sep 28 15:18:37 banner logger: /etc/xen/scripts/block: /etc/xen/scripts/block failed; error detected.<br />
Sep 28 15:18:37 banner logger: /etc/xen/scripts/block: remove XENBUS_PATH=backend/vbd/0/268441856<br />
Sep 28 15:18:37 banner logger: /etc/xen/scripts/xen-hotplug-cleanup: XENBUS_PATH=backend/vbd/0/268441856</p>
<p>The modified script:</p>
<p>banner:/appl/xen/cent/57 # cat /etc/xen/scripts/block-iscsi<br />
#!/bin/bash<br />
# block-iscsi  &#8211;  2009 Keith Herron<br />
#<br />
# multipath enabled block-iscsi xen block script.<br />
#<br />
# Note: This script depends on a block-iscsi.conf file<br />
#       located in the same directory.  This file contains<br />
#       an array of available iSCSI target IPs<br />
#</p>
<p>dir=$(dirname &#8220;$0&#8243;)<br />
. &#8220;$dir/block-common.sh&#8221;<br />
. &#8220;$dir/block-iscsi.conf&#8221;</p>
<p># Where do your node files live?<br />
#NODES=/var/lib/iscsi<br />
NODES=/etc/iscsi</p>
<p># Log which mode we are in<br />
logger -t block-iscsi &#8220;*** Beginning device $command ***&#8221;</p>
<p># Fetch the iqn we specify in the domu config file<br />
#<br />
IQN=$(xenstore_read &#8220;$XENBUS_PATH/params&#8221;)<br />
logger -t block-iscsi &#8220;IQN: ${IQN}&#8221;</p>
<p># We define portal ip in order to support new luns which don&#8217;t yet have<br />
# ${NODES}/node entrys yet, not dynamic but avoids manual discovery<br />
#<br />
for PORTAL in ${PORTALS[@]}; do<br />
  logger -t block-iscsi `iscsiadm -m discovery -t st -p $PORTAL`<br />
done</p>
<p># Using the iscsi node directory we can determine the ip and port of<br />
# our iscsi target on a lun by lun basis<br />
#<br />
  IP=`ls ${NODES}/nodes/${IQN} | cut -d , -f 1`<br />
PORT=`ls ${NODES}/nodes/${IQN} | cut -d , -f 2`</p>
<p>logger -t block-iscsi &#8220;TARGET: ${IP}:${PORT}&#8221;</p>
<p># This is called by each command to determine which multipath map to use<br />
#<br />
function get_mpath_map {<br />
   # Re-run multipath to ensure that maps are up to date<br />
   #<br />
   multipath<br />
   sleep 2</p>
<p>   # Now we determine which /dev/sd* device belongs to the iqn<br />
   #<br />
   SCSI_DEV=&#8221;/dev/`basename \`/usr/bin/readlink /dev/disk/by-path/ip-${IP}:${PORT}-iscsi-${IQN}-lun-0\&#8220;&#8221;<br />
   logger -t block-iscsi &#8220;scsi device: ${SCSI_DEV}&#8221;</p>
<p>   # And using the /dev/sd* device we can determine its corresponding multipath entry<br />
   #<br />
   MPATH_MAP=&#8221;/dev/mapper/`multipath -ll ${SCSI_DEV} | head -1 | awk &#8216;{ print $1}&#8217;`&#8221;<br />
   logger -t block-iscsi &#8220;mpath device: ${MPATH_MAP}&#8221;<br />
}</p>
<p>case $command in<br />
   add)<br />
      # Login to the target<br />
      logger -t block-iscsi &#8220;logging in to ${IQN} on ${IP}:${PORT}&#8221;<br />
      sleep 5<br />
      #FIXME needs more advanced race condition logic<br />
      iscsiadm -m node -T ${IQN} -p ${IP}:${PORT} &#8211;login | logger -t block-iscsi<br />
      sleep 5<br />
      #FIXME needs more advanced race condition logic<br />
      get_mpath_map</p>
<p>      if [ -a ${MPATH_MAP} ]; then<br />
         logger -t block-iscsi &#8220;${command}ing device: ${MPATH_MAP}&#8221;<br />
         write_dev ${MPATH_MAP}<br />
      fi<br />
   ;;</p>
<p>   remove)<br />
      get_mpath_map<br />
      if [ -a ${MPATH_MAP} ]; then<br />
         logger -t block-iscsi &#8220;flushing buffers on ${MPATH_MAP}&#8221;<br />
         blockdev &#8211;flushbufs ${MPATH_MAP}<br />
         logger -t block-iscsi &#8220;attempting logout of ${IQN} on ${IP}:${PORT}&#8221;<br />
         iscsiadm -m node -T ${IQN} -p ${IP}:${PORT} &#8211;logout | logger -t block-iscsi<br />
         sleep  10<br />
         #FIXME needs more advanced race condition logic<br />
      fi<br />
      sleep 5<br />
      #FIXME needs more advanced race condition logic<br />
   ;;<br />
esac</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-970</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Wed, 28 Sep 2011 19:16:44 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-970</guid>
		<description>I see that your script assumes directories not in evidence for SuSE&#039;s implementation.  :-)

/var/lib/iscsi doesn&#039;t exist.

It&#039;s /etc/iscsi/nodes in this build.

banner:/etc/xen/scripts # cd /etc/iscsi/nodes/
banner:/etc/iscsi/nodes # l
total 16
drw------- 4 root root 4096 Sep 28 15:09 ./
drwxr-xr-x 5 root root 4096 Sep 28 15:09 ../
drw------- 3 root root 4096 Sep 28 15:09 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0/
drw------- 3 root root 4096 Sep 28 15:09 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1/

Let me go change that path and try again.</description>
		<content:encoded><![CDATA[<p>I see that your script assumes directories not in evidence for SuSE&#8217;s implementation.  <img src='http://backdrift.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>/var/lib/iscsi doesn&#8217;t exist.</p>
<p>It&#8217;s /etc/iscsi/nodes in this build.</p>
<p>banner:/etc/xen/scripts # cd /etc/iscsi/nodes/<br />
banner:/etc/iscsi/nodes # l<br />
total 16<br />
drw&#8212;&#8212;- 4 root root 4096 Sep 28 15:09 ./<br />
drwxr-xr-x 5 root root 4096 Sep 28 15:09 ../<br />
drw&#8212;&#8212;- 3 root root 4096 Sep 28 15:09 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0/<br />
drw&#8212;&#8212;- 3 root root 4096 Sep 28 15:09 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1/</p>
<p>Let me go change that path and try again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-969</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Wed, 28 Sep 2011 19:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-969</guid>
		<description>@Baylink, what do you see when you run the commands from the second part manually?

IP=`ls /var/lib/iscsi/nodes/${IQN} &#124; cut -d , -f 1`
PORT=`ls /var/lib/iscsi/nodes/${IQN} &#124; cut -d , -f 2`</description>
		<content:encoded><![CDATA[<p>@Baylink, what do you see when you run the commands from the second part manually?</p>
<p>IP=`ls /var/lib/iscsi/nodes/${IQN} | cut -d , -f 1`<br />
PORT=`ls /var/lib/iscsi/nodes/${IQN} | cut -d , -f 2`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-968</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Wed, 28 Sep 2011 19:11:45 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-968</guid>
		<description>/etc/xen/scripts/block-iscsi.conf:

# block-iscsi.conf  -  2009 Keith Herron 
#
# Note: Config file for block-iscsi xen block script /etc/xen/scripts/block-iscsi

# Define iSCSI portal addresses here, necessary for discovery
PORTALS[0]=&quot;192.168.1.190&quot;

It isn&#039;t executable, though; as the script also wasn&#039;t.  Since it&#039;s picking up the portal, I assume that&#039;s not the problem.

run manually:

banner:/etc/xen/scripts # iscsiadm -m discovery -t st -p 192.168.1.190
192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0
192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1

and as I said: I can log in to the filer manually, and mount one of those -- I did so to copy the local image over to the filer with dd, logged out again afterwards.

So I know the connection proper is working.

My open-iscsi:

open-iscsi-2.0.870-37.38.1.i586

which is the distro package on SuSE 11.4.</description>
		<content:encoded><![CDATA[<p>/etc/xen/scripts/block-iscsi.conf:</p>
<p># block-iscsi.conf  &#8211;  2009 Keith Herron<br />
#<br />
# Note: Config file for block-iscsi xen block script /etc/xen/scripts/block-iscsi</p>
<p># Define iSCSI portal addresses here, necessary for discovery<br />
PORTALS[0]=&#8221;192.168.1.190&#8243;</p>
<p>It isn&#8217;t executable, though; as the script also wasn&#8217;t.  Since it&#8217;s picking up the portal, I assume that&#8217;s not the problem.</p>
<p>run manually:</p>
<p>banner:/etc/xen/scripts # iscsiadm -m discovery -t st -p 192.168.1.190<br />
192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0<br />
192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1</p>
<p>and as I said: I can log in to the filer manually, and mount one of those &#8212; I did so to copy the local image over to the filer with dd, logged out again afterwards.</p>
<p>So I know the connection proper is working.</p>
<p>My open-iscsi:</p>
<p>open-iscsi-2.0.870-37.38.1.i586</p>
<p>which is the distro package on SuSE 11.4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-967</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Wed, 28 Sep 2011 17:56:01 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-967</guid>
		<description>@Baylink, I notice that your $IP and $PORT variables don&#039;t appear to be working.

This snippet from the script:
# Login to the target
      logger -t block-iscsi &quot;logging in to ${IQN} on ${IP}:${PORT}&quot;

Is yielding the following output:
Sep 27 23:39:41 banner block-iscsi: logging in to iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 on :

As you can see, the $IP:$PORT is coming out blank (is /etc/xen/scripts/block-iscsi.conf in place?).  The below section is where the IP and port are assigned, I would try running these commands by hand to ensure that they provide the expected output:

# We define portal ip in order to support new luns which don&#039;t yet have
# /var/lib/iscsi/node entrys yet, not dynamic but avoids manual discovery 
#
for PORTAL in ${PORTALS[@]}; do
  logger -t block-iscsi `iscsiadm -m discovery -t st -p $PORTAL`
done
 
# Using the iscsi node directory we can determine the ip and port of 
# our iscsi target on a lun by lun basis
#
  IP=`ls /var/lib/iscsi/nodes/${IQN} &#124; cut -d , -f 1`
PORT=`ls /var/lib/iscsi/nodes/${IQN} &#124; cut -d , -f 2`
 
logger -t block-iscsi &quot;TARGET: ${IP}:${PORT}&quot;</description>
		<content:encoded><![CDATA[<p>@Baylink, I notice that your $IP and $PORT variables don&#8217;t appear to be working.</p>
<p>This snippet from the script:<br />
# Login to the target<br />
      logger -t block-iscsi &#8220;logging in to ${IQN} on ${IP}:${PORT}&#8221;</p>
<p>Is yielding the following output:<br />
Sep 27 23:39:41 banner block-iscsi: logging in to iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 on :</p>
<p>As you can see, the $IP:$PORT is coming out blank (is /etc/xen/scripts/block-iscsi.conf in place?).  The below section is where the IP and port are assigned, I would try running these commands by hand to ensure that they provide the expected output:</p>
<p># We define portal ip in order to support new luns which don&#8217;t yet have<br />
# /var/lib/iscsi/node entrys yet, not dynamic but avoids manual discovery<br />
#<br />
for PORTAL in ${PORTALS[@]}; do<br />
  logger -t block-iscsi `iscsiadm -m discovery -t st -p $PORTAL`<br />
done</p>
<p># Using the iscsi node directory we can determine the ip and port of<br />
# our iscsi target on a lun by lun basis<br />
#<br />
  IP=`ls /var/lib/iscsi/nodes/${IQN} | cut -d , -f 1`<br />
PORT=`ls /var/lib/iscsi/nodes/${IQN} | cut -d , -f 2`</p>
<p>logger -t block-iscsi &#8220;TARGET: ${IP}:${PORT}&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-966</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Wed, 28 Sep 2011 04:46:37 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-966</guid>
		<description>I guess I should have included this:

name=&quot;centos57base&quot;
vcpus=1
memory=1024
# disk=[&#039;tap:aio:/appl/xen/images/centos57base/centos57base.img,xvda,w&#039;]
disk=[&#039;iscsi:iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0,xvda,w&#039;]
vif=[&#039;ip=67.78.195.9,bridge=br0,mac=00:16:3E:FF:00:4E&#039;]
bootloader = &#039;/usr/bin/pygrub&#039;
extra=&quot;(hd0,0)/boot/grub/menu.lst&quot;

The tap image is the one I DDd over; it works when local; the IQN is what comes out of the discovery, copy/pasta.

The image is CentOS5.7, installed via HTTP from ... OSU, I think.  Some mirror.</description>
		<content:encoded><![CDATA[<p>I guess I should have included this:</p>
<p>name=&#8221;centos57base&#8221;<br />
vcpus=1<br />
memory=1024<br />
# disk=['tap:aio:/appl/xen/images/centos57base/centos57base.img,xvda,w']<br />
disk=['iscsi:iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0,xvda,w']<br />
vif=['ip=67.78.195.9,bridge=br0,mac=00:16:3E:FF:00:4E']<br />
bootloader = &#8216;/usr/bin/pygrub&#8217;<br />
extra=&#8221;(hd0,0)/boot/grub/menu.lst&#8221;</p>
<p>The tap image is the one I DDd over; it works when local; the IQN is what comes out of the discovery, copy/pasta.</p>
<p>The image is CentOS5.7, installed via HTTP from &#8230; OSU, I think.  Some mirror.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baylink</title>
		<link>http://backdrift.org/xen-block-iscsi-script-with-multipath-support/comment-page-1#comment-965</link>
		<dc:creator>Baylink</dc:creator>
		<pubDate>Wed, 28 Sep 2011 03:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://backdrift.org/?p=232#comment-965</guid>
		<description>Well, maybe not so much.

Any ideas what might have caused this, oh person-who-knows-xen-well-enough-to-write-block-scripts?  :-)

Sep 27 23:39:41 banner kernel: [288438.536745] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)
Sep 27 23:39:41 banner kernel: [288438.539718] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)
Sep 27 23:39:41 banner logger: /etc/xen/scripts/block: add XENBUS_PATH=backend/vbd/0/268441856
Sep 27 23:39:41 banner logger: /etc/xen/scripts/block-iscsi: add XENBUS_PATH=backend/vbd/0/268441856
Sep 27 23:39:41 banner block-iscsi: *** Beginning device add ***
Sep 27 23:39:41 banner block-iscsi: IQN: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0
Sep 27 23:39:41 banner block-iscsi: 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1
Sep 27 23:39:41 banner block-iscsi: TARGET: :
Sep 27 23:39:41 banner block-iscsi: logging in to iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 on :
Sep 27 23:39:51 banner logger: /etc/xen/scripts/block: Writing backend/vbd/0/268441856/hotplug-error /etc/xen/scripts/block failed; error detected. backend/vbd/0/268441856/hotplug-status error to xenstore.
Sep 27 23:39:51 banner logger: /etc/xen/scripts/block: /etc/xen/scripts/block failed; error detected.
Sep 27 23:39:51 banner logger: /etc/xen/scripts/block: remove XENBUS_PATH=backend/vbd/0/268441856
Sep 27 23:39:51 banner logger: /etc/xen/scripts/xen-hotplug-cleanup: XENBUS_PATH=backend/vbd/0/268441856

I&#039;d just copied a local diskimage file to an openfiler iSCSI share the same size; the entire subnet has access permissions on it -- and the dom0 in particular, cause I mounted it by hand to (successfully) dd it over to the filer.</description>
		<content:encoded><![CDATA[<p>Well, maybe not so much.</p>
<p>Any ideas what might have caused this, oh person-who-knows-xen-well-enough-to-write-block-scripts?  <img src='http://backdrift.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Sep 27 23:39:41 banner kernel: [288438.536745] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)<br />
Sep 27 23:39:41 banner kernel: [288438.539718] blkback: ring-ref 8, event-channel 70, protocol 1 (x86_32-abi)<br />
Sep 27 23:39:41 banner logger: /etc/xen/scripts/block: add XENBUS_PATH=backend/vbd/0/268441856<br />
Sep 27 23:39:41 banner logger: /etc/xen/scripts/block-iscsi: add XENBUS_PATH=backend/vbd/0/268441856<br />
Sep 27 23:39:41 banner block-iscsi: *** Beginning device add ***<br />
Sep 27 23:39:41 banner block-iscsi: IQN: iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0<br />
Sep 27 23:39:41 banner block-iscsi: 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 192.168.1.190:3260,1 iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot1<br />
Sep 27 23:39:41 banner block-iscsi: TARGET: :<br />
Sep 27 23:39:41 banner block-iscsi: logging in to iqn.2006-01.com.openfiler:zing_atlas.lv-vmroot0 on :<br />
Sep 27 23:39:51 banner logger: /etc/xen/scripts/block: Writing backend/vbd/0/268441856/hotplug-error /etc/xen/scripts/block failed; error detected. backend/vbd/0/268441856/hotplug-status error to xenstore.<br />
Sep 27 23:39:51 banner logger: /etc/xen/scripts/block: /etc/xen/scripts/block failed; error detected.<br />
Sep 27 23:39:51 banner logger: /etc/xen/scripts/block: remove XENBUS_PATH=backend/vbd/0/268441856<br />
Sep 27 23:39:51 banner logger: /etc/xen/scripts/xen-hotplug-cleanup: XENBUS_PATH=backend/vbd/0/268441856</p>
<p>I&#8217;d just copied a local diskimage file to an openfiler iSCSI share the same size; the entire subnet has access permissions on it &#8212; and the dom0 in particular, cause I mounted it by hand to (successfully) dd it over to the filer.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  backdrift.org/xen-block-iscsi-script-with-multipath-support/feed ) in 0.38246 seconds, on Feb 5th, 2012 at 2:44 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 3:44 pm UTC -->
