ISCSI Tape Library Initiator and Target Configuration

This article is for Amanda Enterprise (AE)

There are times where you are unable to locate your tape drive on the Amanda Enterprise server. In this case you can setup an ISCSI Initiator on your server that will be able to login to the targets on the Tape library host machine. Below is a rough outline to allow for the requested setup.

Target Setup

On the Target (Host with the Tape Library) install packages for tgtadm (RHEL/CENT use scsi-target-utils DEB/UBUNTU use tgt).

Start tgt daemon (/etc/inet.d/tgt start)

Identify the tape changer and drives you want to create targets for (lsscsi -g).

root@debian8-amandace-dev:~/mhvtl-1.5# lsscsi -g
[1:0:0:0] cd/dvd Msft Virtual CD/ROM 1.0 /dev/sr0 /dev/sg1
[2:0:0:0] disk Msft Virtual Disk 1.0 /dev/sda /dev/sg0
[4:0:0:0] mediumx STK L700 0105 /dev/sch0 /dev/sg10
[4:0:1:0] tape IBM ULT3580-TD5 0105 /dev/st0 /dev/sg2
[4:0:2:0] tape IBM ULT3580-TD5 0105 /dev/st1 /dev/sg3
[4:0:3:0] tape IBM ULT3580-TD4 0105 /dev/st2 /dev/sg4
[4:0:4:0] tape IBM ULT3580-TD4 0105 /dev/st3 /dev/sg5

Create your target device using the following command:

tgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn.2016-08.com.example:vtl1

Add logical units for changer and each tape drive

tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --bstype=sg --device-type=pt -b /dev/sg2
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 --bstype=sg --device-type=pt -b /dev/sg3
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 3 --bstype=sg --device-type=pt -b /dev/sg4
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 4 --bstype=sg --device-type=pt -b /dev/sg5
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 5 --bstype=sg --device-type=pt -b /dev/sg10

Bind the target to an initiator IP

tgtadm --lld iscsi --mode target --op bind --tid 1 -I <ip of Initiator>

Your Target Tape Library is now setup.

For further configuration options see man tgtadm (http://linux.die.net/man/8/tgtadm)

Initiator Setup

On the Initiator (Server running Amanda Enterprise) install packages for iscsiadm (RHEL/CENT use iscsi-initiator-utils DEB/UBUNTU use open-iscsi).

Start iscsid service

Run the following commands to initiate the iscsi mount on the Server:

iscsiadm -m discovery -t sendtargets -p <ip of target>
iscsiadm -m node -l all

For further configuration options with iscsiadm see man iscsiadm (http://linux.die.net/man/8/iscsiadm)

You should then be able to confirm the mount with lsscsi -g run on the server showing the same logical units you exported from the target.

At this point configuration of the ZMC will be the same as setting up a tape drive.

Any time you re-initiate the targets pay attention to what device the Tape Library is mounted to, as this is seldom the same each time, and will need to be adjusted accordingly in Admin|Devices in the ZMC.