# Create a target
<target iqn.2007-03:virtual-dvd:hostname>

# Create a DVD drive and give it a nice name
# The dvd starts out without a backing store file, i.e. no disk loaded
  <backing-store NONE:0>
    lun 1
    device-type cd
    vendor_id   STGT_DVD
    product_id  DVD101
    product_rev 0010
    scsi_sn     STGTDVD01
    removable   1
  </backing-store>

# We need a backing store file for the media changer
#dd if=/dev/zero of=$HOME/smc bs=1k count=1

# Create the SMC device and give it a nice name
  <backing-store /root/smc>
    lun 2
    device-type changer
    vendor_id   STK
    product_id  L700
    product_rev 0010
    scsi_sn     XYZZY_0
    removable   1

# Add a Data Transfer devices (1 drive)
    params element_type=4,start_address=1,quantity=1

# Specify that the DVD above (LUN 1) is the data transfer device we created
    params element_type=4,address=1,tid=${tid},lun=1

# Medium Transport Elements (robot arm / picker)
    params element_type=1,start_address=16,quantity=1

# define path to virtual media
    params media_home=/root/media

# Storage Elements - 8 starting at addr 1024
    params element_type=2,start_address=1024,quantity=8

# Add 'media' to slots 1 and 2 and leave the other 6 slots empty
# slot 1
    params element_type=2,address=1024,barcode=DISK_001,sides=1
# slot 2
    params element_type=2,address=1025,barcode=DISK_002,sides=1

  </backing-store>

</target>

# VTL=${HOME}/media
# mkdir -p ${VTL}
# Create empty writeable virtual DVD-R media
# Filename here, must match barcode above.
# tgtimg --op new --device-type cd --type dvd+r --file ${VTL}/DISK_001
# tgtimg --op new --device-type cd --type dvd+r --file ${VTL}/DISK_002

# This must exist but isn't otherwise used.
# dd if=/dev/zero of=$HOME/smc bs=1k count=1

