[stgt] Using opensolaris as iscsi initiator for stgt

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Mon Dec 14 13:11:45 CET 2009


On Mon, 14 Dec 2009 20:51:47 +0900
FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp> wrote:

> On Mon, 14 Dec 2009 11:40:55 +0100
> Albert Pauw <albert.pauw at gmail.com> wrote:
> 
> > FUJITA Tomonori wrote:
> > > On Mon, 14 Dec 2009 11:11:07 +0100
> > > Albert Pauw <albert.pauw at gmail.com> wrote:
> > >
> > >   
> > >> I've attached the patches to move targets.conf.example to conf/examples/
> > >> as well as the vtl examples (with the name Tomo suggested).
> > >>     
> > >
> > > Thanks!
> > >
> > >
> > >   
> > >> As for the Makefile changes, I couldn't find anything to change, as only
> > >> the empty targets.conf is installed as a dummy from conf/ which I just
> > >> left as it was.
> > >>     
> > >
> > > I think we need to
> > >
> > > 1) modify doc/Makefile not to install targets.conf.example.
> > > 2) modify conf/Makefile to create conf/examples/ and install the new
> > > example files to it.
> > >
> > >   
> > Something like this?
> 
> We need to add tricks a bit.
> 
> This works for me.

And this is a patch to add your example files.

=
From: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
Subject: [PATCH] add two VTL targets.conf examples

This adds two VTL targets.conf examples.

Thanks to Albert Pauw <albert.pauw at gmail.com> for writing them.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
---
 conf/Makefile                          |    6 ++-
 conf/examples/targets.conf.vtl.L700    |   92 ++++++++++++++++++++++++++++++++
 conf/examples/targets.conf.vtl.MSL2024 |   69 ++++++++++++++++++++++++
 3 files changed, 165 insertions(+), 2 deletions(-)
 create mode 100644 conf/examples/targets.conf.vtl.L700
 create mode 100644 conf/examples/targets.conf.vtl.MSL2024

diff --git a/conf/Makefile b/conf/Makefile
index d6b5ea6..9066e56 100644
--- a/conf/Makefile
+++ b/conf/Makefile
@@ -1,6 +1,6 @@
 sysconfdir ?= /etc
 
-EXAMPLES = targets.conf.example
+EXAMPLES = targets.conf.example targets.conf.vtl.L700 targets.conf.vtl.MSL2024
 
 .PHONY: all
 all:
@@ -12,7 +12,9 @@ install:
 		install -m 644 targets.conf $(DESTDIR)$(sysconfdir)/tgt ; \
 	fi
 	install -d -m 755 $(DESTDIR)$(sysconfdir)/tgt/examples
-	install -m 644 examples/$(EXAMPLES) $(DESTDIR)$(sysconfdir)/tgt/examples
+	for f in $(EXAMPLES) ; do \
+		install -m 644 examples/$$f $(DESTDIR)$(sysconfdir)/tgt/examples ;\
+	done
 
 .PHONY: clean
 clean:
diff --git a/conf/examples/targets.conf.vtl.L700 b/conf/examples/targets.conf.vtl.L700
new file mode 100644
index 0000000..48413a5
--- /dev/null
+++ b/conf/examples/targets.conf.vtl.L700
@@ -0,0 +1,92 @@
+# Virtual tape library example for a STK L700 tape library
+#
+# In this case, tapes are stored in the directory /root/tapes
+# size is in MB (1 GB in this case)
+# using the command "tgtimg --op=new --device-type=tape --barcode="A00000001" --size=10240 --type=data --file=A00000001"
+#
+# The tapes can be added after startup with
+# "tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 4 --params element_type=2,address=1000,barcode=A0000001,sides=1"
+# for slot 0 (is nr 1000)
+#
+
+include /etc/tgt/temp/*.conf
+
+default-driver iscsi
+
+<target iqn.2008-09.com.example:server.tape>
+    allow-in-use yes
+#
+# For every drive We need a backing store, although the tape drive will be empty,
+# so we create a dummy tape "notape" in directory /root/tapes
+# with the command "tgtimg --op=new --device-type=tape --barcode="" --size=1 --type=clean --file=notape"
+# and create symbolic links for every drive (limitation of tgt)
+# link -s /root/tapes/notape /root/tapes/notape1
+# link -s /root/tapes/notape /root/tapes/notape2
+# link -s /root/tapes/notape /root/tapes/notape2
+#
+    <backing-store /root/tapes/notape1>
+        lun 1
+        device-type tape
+        removable 1
+        vendor_id "HP"
+        product_id "LTO3 ULTRIUM"
+        product_rev "0001"
+        scsi_sn "HUM1A00001"
+        scsi_id "HP LTO3 ULTRIUM"
+    </backing-store>
+    <backing-store /root/tapes/notape2>
+        lun 2
+        device-type tape
+        removable 1
+        vendor_id "HP"
+        product_id "LTO3 ULTRIUM"
+        product_rev "0001"
+        scsi_sn "HUM1A00002"
+        scsi_id "HP LTO3 ULTRIUM"
+    </backing-store>
+    <backing-store /root/tapes/notape3>
+        lun 3
+        device-type tape
+        removable 1
+        vendor_id "HP"
+        product_id "LTO3 ULTRIUM"
+        product_rev "0001"
+        scsi_sn "HUM1A00003"
+        scsi_id "HP LTO3 ULTRIUM"
+    </backing-store>
+    <backing-store /root/smc>
+        lun 4
+        device-type changer
+        removable 1
+        vendor_id "STK"
+        product_id "L700"
+        product_rev "0001"
+        scsi_sn "123:456:789:000"
+        # Dummy 'page 0'
+        mode_page "0:0:0"
+        # Page 0x02: Disconnect/Reconnect SPC-3
+        mode_page "0x02:0:14:0x80:0x80:0:0xa:0:0:0:0:0:0:0:0:0:0"
+        # Page 0x1a: Power Condition SPC-3
+        mode_page "0x1a:0:18:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0"
+        # Page 0x1c: Informational Exceptions Control SPC-3
+        mode_page "0x1c:0:10:8:0:0:0:0:0:0:0:0:0"
+        # Page 0x1d: Element Address Assignment SMC-3 7.3.4
+        mode_page "0x1d:0:0x12:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0"
+        # Page 0x1e: Transport Geometry Parameters SMC-3 7.3.5
+        mode_page "0x1e:0:2:0:0"
+        # Page 0x1f: Device Capabilities SMC-3 7.3.2
+        # Page 0x1f/Subpage 0x41: Extended Device Capabilities SMC-3 7.3.3
+        mode_page "0x1f:0:0x12:0x0f:7:0x0f:0x0f:0x0f:0x0f:0:0:0:0:0x0f:0x0f:0x0f:0x0f:0:0:0:0"
+        # Type 1: Medium Transport Elements (robot arm/picker)
+        params element_type=1,start_address=1,quantity=1,media_home=/root/tapes
+        # Type 2: Storage Elements (tape slots)
+        params element_type=2,start_address=1000,quantity=216,media_home=/root/tapes
+        # Type 3: Import/Export Elements (CAP)
+        params element_type=3,start_address=10,quantity=20,media_home=/root/tapes
+        # Type 4: Add Data Transfer devices (drives)
+        params element_type=4,start_address=500,quantity=3,media_home=/root/tapes
+        params element_type=4,address=500,tid=1,lun=1
+        params element_type=4,address=500,tid=1,lun=2
+        params element_type=4,address=500,tid=1,lun=3
+    </backing-store>
+</target>
diff --git a/conf/examples/targets.conf.vtl.MSL2024 b/conf/examples/targets.conf.vtl.MSL2024
new file mode 100644
index 0000000..791d1a6
--- /dev/null
+++ b/conf/examples/targets.conf.vtl.MSL2024
@@ -0,0 +1,69 @@
+# Virtual tape library example for an HP MSL-2024 tape library
+#
+# In this case, tapes are stored in the directory /root/tapes
+# size is in MB (1 GB in this case)
+# using the command "tgtimg --op=new --device-type=tape --barcode="A00000001" --size=10240 --type=data --file=A00000001"
+#
+# The tapes can be added after startup with
+# "tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 4 --params element_type=2,address=1000,barcode=A0000001,sides=1"
+# for slot 0 (is nr 1000)
+#
+# Please note that an MSL-2024 has no IMPORT/EXPORT elements (type 3)
+
+include /etc/tgt/temp/*.conf
+
+default-driver iscsi
+
+<target iqn.2008-09.com.example:server.tape>
+    allow-in-use yes
+#
+# We need a backing store, although the tape drive will be empty,
+# so we create a dummy tape "notape" in directory /root/tapes
+# with the command "tgtimg --op=new --device-type=tape --barcode="" --size=1 --type=clean --file=notape"
+#
+    <backing-store /root/tapes/notape>
+        lun 1
+        device-type tape
+        removable 1
+        vendor_id "HP      "
+        product_id "Ultrium 3-SCSI"
+        product_rev "D21W"
+        scsi_sn "HU012345AB"
+        scsi_id "HP LTO3 ULTRIUM"
+    </backing-store>
+#
+# For the tape changer we need also a backing store, this can be a file containing zeros, like this:
+# "dd if=/dev/zero of=$HOME/smc bs=1k count=1"
+#
+    <backing-store /root/smc>
+        lun 4
+        device-type changer
+        removable 1
+        vendor_id "HP      "
+        product_id "MSL G3 Series   "
+        product_rev "3.00"
+        scsi_sn "ABC01234G3"
+        # Dummy 'page 0'
+        mode_page "0:0:0"
+        # Page 0x02: Disconnect/Reconnect SPC-3
+        mode_page "0x02:0:14:0x80:0x80:0:0xa:0:0:0:0:0:0:0:0:0:0"
+        # Page 0x1a: Power Condition SPC-3
+        mode_page "0x1a:0:18:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0"
+        # Page 0x1c: Informational Exceptions Control SPC-3
+        mode_page "0x1c:0:10:8:0:0:0:0:0:0:0:0:0"
+        # Page 0x1d: Element Address Assignment SMC-3 7.3.4
+        mode_page "0x1d:0:0x12:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0"
+        # Page 0x1e: Transport Geometry Parameters SMC-3 7.3.5
+        mode_page "0x1e:0:2:0:0"
+        # Page 0x1f: Device Capabilities SMC-3 7.3.2
+        # Page 0x1f/Subpage 0x41: Extended Device Capabilities SMC-3 7.3.3
+        mode_page "0x1f:0:0x12:0x0f:7:0x0f:0x0f:0x0f:0x0f:0:0:0:0:0x0f:0x0f:0x0f:0x0f:0:0:0:0"
+        # Type 1: Medium Transport Elements (robot arm/picker)
+        params element_type=1,start_address=1,quantity=1,media_home=/root/tapes
+        # Type 2: Storage Elements (tape slots)
+        params element_type=2,start_address=1000,quantity=24,media_home=/root/tapes
+        # Type 4: Add Data Transfer devices (drives)
+        params element_type=4,start_address=2,quantity=1,media_home=/root/tapes
+        params element_type=4,address=2,tid=1,lun=1
+    </backing-store>
+</target>
-- 
1.5.6.5


--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list