[Stgt-devel] [Patch 3/6] Update sample script to new lu layout.

Mark Harvey markh794
Wed Jun 20 10:01:30 CEST 2007


>From 42b2eaf57103613b67cefe2d0a47b281ee3ceccd Mon Sep 17 00:00:00 2001
From: Mark Harvey <markh794 at gmail.com>
Date: Wed, 20 Jun 2007 17:34:26 +1000
Subject: Updated sample script to suit new Logical Unit creation

As LU are no longer tied to the target type, the sample script
required a rework to suit new layout.

Signed-off-by: Mark Harvey <markh794 at gmail.com>
---
 scripts/tgt-core-test |   56 ++++++++++++++++++++++++------------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/scripts/tgt-core-test b/scripts/tgt-core-test
index 1bbb404..a90fc9d 100755
--- a/scripts/tgt-core-test
+++ b/scripts/tgt-core-test
@@ -28,49 +28,49 @@ fi
 
 set -x
 
-###################################################################################
+###############################################################################
 # Set up SBC HDD device
-###################################################################################
+###############################################################################
 TID=1
 
+# Create Target ID 1..
 tgtadm --lld iscsi --mode target --op new --tid $TID \
-		-T iqn.2007-03:marks-vtl_sbc:`hostname` --target-type disk
-
+		-T iqn.2007-03:marks-vtl_sbc:`hostname`
 sleep 1
-tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun 0 -b $HOME/hd_block
-
-tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun 0 --params scsi_sn=FRED00,scsi_id=Fred
-
-tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun 0 \
-	--params vendor_id=QUANTUM,product_id=HD100,product_rev=0010,removable=1,sense_format=0
-
-
-tgtadm --lld iscsi --mode target --op bind --tid $TID -I ALL
 
+# Create first LUN - Disk
+LUN=1
+tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun $LUN -b $HOME/hd_block --device-type=disk
 
-###################################################################################
-# Set up MMC CD/DVD device
-###################################################################################
-TID=2
+tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun $LUN \
+	--params scsi_sn=FRED00,scsi_id=Fred
 
-tgtadm --lld iscsi --mode target --op new --tid $TID \
-		-T iqn.2007-03:marks-vtl_mmc:`hostname` --target-type cd
-
-sleep 1
-tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun 0 -b $HOME/cd_block0
-tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun 0 \
-	--params vendor_id=VirtualCD,product_id=CD101,product_rev=0010,scsi_sn=XYZZY10,removable=1
+tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun $LUN \
+	--params vendor_id=QUANTUM,product_id=HD100,product_rev=0010,removable=1,sense_format=0
 
-tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun 1 -b $HOME/cd_block1
-tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun 1 \
+# Create 2nd LUN - CD/ROM
+LUN=2
+tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun $LUN -b $HOME/cd_block0 --device-type=cd
+tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun $LUN \
 	--params vendor_id=VirtualCD,product_id=CD101,product_rev=0010,scsi_sn=XYZZY11,removable=1
 
-tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun 2 -b $HOME/cd_block2
-tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun 2 \
+# Create 3rd LUN - CD/ROM
+LUN=3
+tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun $LUN -b $HOME/cd_block1 --device-type=cd
+tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun $LUN \
 	--params vendor_id=VirtualCD,product_id=CD101,product_rev=0010,scsi_sn=XYZZY12,removable=1
 
+# Create 4th LUN - CD/ROM
+LUN=4
+tgtadm --lld iscsi --mode logicalunit --op new --tid $TID --lun $LUN -b $HOME/cd_block1 --device-type=cd
+tgtadm --lld iscsi --mode logicalunit --op update --tid $TID --lun $LUN \
+	--params vendor_id=VirtualCD,product_id=CD101,product_rev=0010,scsi_sn=XYZZY13,removable=1
+
+# Allow ALL initiators to connect to this target
 tgtadm --lld iscsi --mode target --op bind --tid $TID -I ALL
 
+
+# Show all our good work.
 tgtadm --lld iscsi --mode target --op show
 
 
-- 
1.5.2.1









More information about the stgt mailing list