[Stgt-devel] VTL - tgtadm syntax additions (Long)

Mark Harvey markh794
Mon Mar 26 02:19:21 CEST 2007


As the idea of hijacking the 'backing file' for use as a configuration
file has not received the most positive resonse, I have put together
some ideas for adding to the syntax of tgtadm to allow the
configuration and customization of SSC and SMC devices.

I have not attempted to implement any of the syntax, but am posting to
the list for comments before putting any effort into coding.

Here goes....


tgtadm --lld iscsi --mode logicalunit --op update --tid=[] --lun=[]
--value=[value]

Where value is:

If device_type == 1 (SSC)

 VendorIdent="SONY"
 ProductIdent="SDX-900V"
 ProductRev="5401"
 SerialNumber="XYZZY_10"

If device_type == 8 (SMC), in addition to SSC values...
 VendorIdent="STK"
 ProductIdent="L700"
 ProductRev="5400"
 SerialNumber="XYZZY"

To configure
 (Reserve address space)
 ElementType=[1|2|3] StartAddress=[number] Quanity=[number]
Sides=[1|2] (Single/double sided)

 (To reserve address space for 'drives')
 ElementType=4 StartAddress=[number] Quanity=[number] Type="ssc|smc|sbc"

 (To 'tie' a previously known SerialNumber to this Address..)
 ElementType=4 Address=[Within Range from above] SerialNumber="xxxxx"

To 'populate' slots with 'media'
 ElementType=[2|3] BarCode="string"

where   ElementType 1 == Medium Transport (picker arm)
       ElementType 2 == Storage Element (Slots in robot)
       ElementType 3 == Import/Export Element (mailslots/Cartridge Access Port)
       ElementType 4 == Data Transport (SSC/SBC/MMC device - Tape,
Optical, CD/DVD)

Limits:
VendorIdent, ProductIdent, ProductRev & SerialNumber can all be on one line...

For Medium changers
 - We first need to 'reserve' number of slots for each element type:
 - Then Tie device S/No to a slot
 - Next fill Storage Slots and Import/Export with 'media'


tgtadm --lld iscsi --mode logicalunit --op update --tid=[] --lun=[]
VendorIdent="QUANTUM"
tgtadm --lld iscsi --mode logicalunit --op update --tid=[] --lun=[]
ProductIdent="SDLT600"
tgtadm --lld iscsi --mode logicalunit --op update --tid=[] --lun=[]
ProductRev="0001"
tgtadm --lld iscsi --mode logicalunit --op update --tid=[] --lun=[]
SerialNumber="XYZZY_10"

or
tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=0 \
       VendorIdent="QUANTUM" ProductIdent="SDLT600" \
       ProductRev="0001" SerialNumber="XYZZY_10"

tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=1 \
       VendorIdent="QUANTUM" ProductIdent="SDLT600" \
       ProductRev="0001" SerialNumber="XYZZY_11"

tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=2 \
       VendorIdent="QUANTUM" ProductIdent="SDLT600" \
       ProductRev="0001" SerialNumber="XYZZY_12"

tgtadm --lld iscsi --mode logicalunit --op update --tid=1 --lun=3 \
       VendorIdent="QUANTUM" ProductIdent="SDLT600" \
       ProductRev="0001" SerialNumber="XYZZY_13"

tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       VendorIdent="STK" ProductIdent="L180" \
       ProductRev="0001" SerialNumber="XYZZY"

Allocate 1 picker at address 256...
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=1 StartAddress=256 Quanity=1 Sides=2

Allocate 800 slots starting at address 1024
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=2 StartAddress=1024 Quanity=800 Sides=2

Allocate 10 Import/Export slots starting at address 128
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=3 StartAddress=128 Quanity=10 Sides=2

Allocate room for 8 drives
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=4 StartAddress=1 Quanity=8 Sides=1

'Assign drive SerialNumber with slot'
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=4 Address=1 SerialNumber=XYZZY_10

tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=4 Address=2 SerialNumber=XYZZY_11

tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=4 Address=3 SerialNumber=XYZZY_12

tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=4 Address=4 SerialNumber=XYZZY_13


Add media to storage Element
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=2 Address=4 BarCode="ABC123L3"

Add media to import/export Element
tgtadm --lld iscsi --mode logicalunit --op update --tid=2 --lun=0 \
       ElementType=3 Address=1 BarCode="CLN001"


An example of a configured system.
tgtadm --lld iscsi --mode target --op show
Target 1: iqn.2007-03:marks-vtl_ssc:laptop
   System information:
       Type: tape
       Driver: iscsi
       Status: running
   I_T nexus information:
   LUN information:
       LUN: 0
           SCSI ID: deadbeaf2:0
           SCSI SN: beaf20
           VendorIdentification : QUANTUM
           ProductIdentification: SDLT600
           ProductRevision      : 0001
       LUN: 1
           SCSI ID: deadbeaf2:1
           SCSI SN: beaf21
           VendorIdentification : QUANTUM
           ProductIdentification: SDLT600
           ProductRevision      : 0001
       LUN: 2
           SCSI ID: deadbeaf2:2
           SCSI SN: beaf22
           VendorIdentification : QUANTUM
           ProductIdentification: SDLT600
           ProductRevision      : 0001
       LUN: 3
           SCSI ID: deadbeaf2:3
           SCSI SN: beaf23
           VendorIdentification : QUANTUM
           ProductIdentification: SDLT600
           ProductRevision      : 0001
   Account information:
   ACL information:
       ALL
Target 2: iqn.2007-03:marks-vtl_smc:laptop
   System information:
       Type: changer
       Driver: iscsi
       Status: running
   I_T nexus information:
   LUN information:
       LUN: 0
           SCSI ID: deadbeaf1:0
           SCSI SN: beaf10
           Size: 1K
           Backing store: /var/tmp/l1
           VendorIdentification : STK
           ProductIdentification: L700
           ProductRevision      : 0001
         Device Configuration:
           Medium Transport     : 1
           Storage Element      : 800
           Import/Export Element: 10
           Data Transport       : 8
   Account information:
   ACL information:
       ALL



More information about the stgt mailing list