Penguin

Differences between version 23 and revision by previous author of XenNotes.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 23 Last edited on Thursday, October 8, 2009 11:30:26 am by GreigMcGill Revert
Older page: version 20 Last edited on Wednesday, September 24, 2008 1:08:58 pm by DanielLawson Revert
@@ -12,8 +12,10 @@
  
 Note 3: This is for ~XenServer 4.1.0, but the principles are the same for previous versions. Just ensure you understand each step rather than following blindly. 
  
 Note 4: You'll need to enable yum repositories. Do this by editing /etc/yum.repos.d/CentOS-Base.repo, and set "enabled=1" for the Base, Updates and Addons repositories 
+  
+Note 5: Thanks to the wonderful work of Blake-r|http://sourceforge.net/users/blake-r the rawio patch|http://sourceforge.net/tracker/index.php?func=detail&aid=2855101&group_id=108475&atid=650593 has now been updated to work against iscsitarget-0.4.17|http://sourceforge.net/projects/iscsitarget/files/iscsitarget/0.4.17/iscsitarget-0.4.17.tar.gz/download - when using this against a kernel newer than 2.6.22, you'll need to edit kernel/target_raw.c and replace all the psg.page occurrences with psg.page_link due to changes in the scatterlist struct. To take advantage of this, just substitute the newer versions of iscsitarget and the rawio patch in these instructions. You should be able to keep all the instructions the same, but I've not tested this yet.  
  
 * Download the Xen 4.1 DDK from citrix.com 
 * The DDK is an ISO containing a VM with a development environment. Import it to your Xen host, and start it. 
 * Download iscsitarget 0.4.14 (you MUST use this version, as the patch for rawio support will not cleanly apply to 0.4.15) from http://optusnet.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-0.4.14.tar.gz into your DDK VM. 
@@ -48,10 +50,60 @@
 * Save and do <tt>/etc/init.d/iscsi-target start</tt> 
 * Modify <tt>/etc/sysconfig/iptables</tt> to allow port 3260 tcp from the IP addresses running the initiator. 
 * Attach to the target using the initiator of your choice. 
  
+!!Working around pesky controllers which change HCIL at boot  
+  
+See the following, requested by Simon Larsen at http://fragged.nu/2009/05/making-a-tape-drive-available-to-a-guest-via-iscsi/  
+  
+Simon, if you read this, your captcha on your blog is broken, preventing comments, and there's no contact email address. Hope you find this, and find it useful. ;)  
+  
+Just bung it in your rc.local.  
+  
+<verbatim>  
+#!/bin/bash  
+#  
+# This script is a (very) primitive method of determining the current HCIL info  
+# for /etc/ietd.conf (config file for iscsi-target) to work around some  
+# controllers which change this ID at boot time. You'll probably want to add  
+# some data validation of those vars as this is purely for my environments.  
+# Feel free to adapt or use it in any way you see fit.  
+# Greig McGill. August, 2009  
+  
+# First set some vars  
+  
+ietd="/etc/ietd.conf"  
+iqn="iqn.2009-08.nz.org.aol.internal:tape0"  
+  
+# Get the whole HCIL string representing the tape drive.  
+# IMPORTANT NOTE: I am assuming there is only one sequential access device.  
+# If I am wrong, you WILL need to rewrite this, or badness will happen.  
+# You have been warned.  
+  
+HCIL="`cat /proc/scsi/scsi | grep -B2 Sequential | head -1`"  
+  
+# Now get each component  
+  
+H="`echo $HCIL | cut -c 11`"  
+C="`echo $HCIL | cut -c 23`"  
+I="`echo $HCIL | cut -c 30`"  
+L="`echo $HCIL | cut -c 38`"  
+  
+# Got all that, now generate ietd.conf and restart iscsi-target  
+  
+cat <<EOT >$ietd  
+Target $iqn  
+ Lun 0 H=$H,C=$C,I=$I,L=$L,Type=rawio  
+ Type 1  
+EOT  
+  
+/etc/init.d/iscsi-target restart  
+  
+# exit with no error  
  
+exit 0  
+</verbatim>  
  
 See [iSCSINotes] as well for more information 
  
 ----- 
 CategoryXen