So I'm currently setting up Bareos with Amazon AWS Storage Gateway Virtual Tape 
Library (VTL).  There are very few guides out there for doing this, so I'm 
assuming it hasn't been tried much yet.  I have managed to get over quite a few 
obstacles, but I have hit a major roadblock for which I can't seem to find any 
information.

The setup so far:

I have installed Bareos director, storage daemon, and file daemon services on 
an Amazon AWS EC2 instance running Ubuntu 14.04.3 LTS.  I have attached the VTL 
to this machine using open-iscsi, which mounted the VTL as a number of SCSI 
devices, namely one auto-changer and 10 tape drives.  Using udev rules, I was 
able to provide static names for each device (as generic and standard /dev 
names tend to change/scramble on reboot) and set them up in the Bareos storage 
daemon configuration.

Output of # lsscsi -g >

[2:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st3   /dev/sg7 
[3:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st0   /dev/sg0 
[4:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st1   /dev/sg10
[5:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st2   /dev/sg1 
[6:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st4   /dev/sg9 
[7:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st9   /dev/sg8 
[8:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st7   /dev/sg4 
[9:0:0:0]    tape    IBM      ULT3580-TD5      0103  /dev/st8   /dev/sg6 
[10:0:0:0]   tape    IBM      ULT3580-TD5      0103  /dev/st5   /dev/sg2 
[11:0:0:0]   tape    IBM      ULT3580-TD5      0103  /dev/st6   /dev/sg3 
[12:0:0:0]   mediumx AWS      Gateway-VTL      0100  /dev/sch0  /dev/sg5

Output of # ls /dev/tape/by-path >

ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-mediachanger-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-02-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-02-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-03-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-03-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-04-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-04-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-05-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-05-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-06-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-06-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-07-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-07-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-08-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-08-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-09-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-09-lun-0-nst
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-10-lun-0
ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-10-lun-0-nst

On recommendation from some other articles I read, I used the 'nst' names when 
creating each device resource to prevent a corruption problem described when 
using a tape drive that auto-rewinds.  I set up the auto-changer and device 
directives as follows:  >

Autochanger {
  Name            = I2M-AWS-TDC
  Device          = I2M-AWS-TD0
  Device          = I2M-AWS-TD1
  Device          = I2M-AWS-TD2
  Device          = I2M-AWS-TD3
  Device          = I2M-AWS-TD4
  Device          = I2M-AWS-TD5
  Device          = I2M-AWS-TD6
  Device          = I2M-AWS-TD7
  Device          = I2M-AWS-TD8
  Device          = I2M-AWS-TD9
  Changer Command = "/usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"
  Changer Device  = 
"/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-mediachanger-lun-0"
}

Device {
  Name                    = I2M-AWS-TD0
  Archive Device          = 
"/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst"
  Device Type             = Tape
  Media Type              = ULTRIUM5
  Autochanger             = yes
  Drive Index             = 0
  Check Labels            = yes
  Automatic Mount         = yes
  Label Type              = IBM
  Label Media             = yes
  Maximum Concurrent Jobs = 100
  Maximum Open Wait       = 3600
  Always Open             = yes
}

... (TD1-TD8 here; identical to above) ...

Device {
  Name                    = I2M-AWS-TD9
  Archive Device          = 
"/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-10-lun-0-nst"
  Device Type             = Tape
  Media Type              = ULTRIUM5
  Autochanger             = yes
  Drive Index             = 9
  Check Labels            = yes
  Automatic Mount         = yes
  Label Type              = IBM
  Label Media             = yes
  Maximum Concurrent Jobs = 100
  Maximum Open Wait       = 3600
  Always Open             = yes
}

All configuration seemed to work at this point, so I created/loaded some 
virtual tapes into slots 1-5 and started testing one of the tape drives, 
according to the Bareos documentation.  I used mtx to mount a blank tape in 
drive 0:

# mtx -f 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-mediachanger-lun-0
 load 4 0
Loading media from Storage Element 4 into drive 0...done

and proceeded with the TAR test:

# mt -f 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0
 rewind

(no output = all is well)

# tar cvf 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0
 .

(omitted list of directories here -- tar completed successfully)

# mt -f 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0
 rewind

(again, no output = all is well)

# tar tvf 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0

(omitted list of directories here -- spat back the same list I put in)

So all was fine up to that point.  Then I shut down the storage daemon and 
proceeded to run the btape test:

# btape -v -c /etc/bareos/bareos-sd.conf 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst
Tape block granularity is 1024 bytes.
btape: butil.c:274-0 Using device: 
"/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst"
 for writing.
btape: btape.c:487-0 open device "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst):
 OK
*test

=== Write, rewind, and re-read test ===

I'm going to write 10000 records and an EOF
then write 10000 records and an EOF, then rewind,
and re-read the data to verify that it is correct.

This is an *essential* feature ...

btape: btape.c:1172-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:619-0 Wrote 1 EOF to "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst)
btape: btape.c:1188-0 Wrote 10000 blocks of 64412 bytes.
btape: btape.c:619-0 Wrote 1 EOF to "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst)
btape: btape.c:1230-0 Rewind OK.
12-Feb 20:02 btape JobId 0: Error: block.c:1003 Read error on fd=3 at file:blk 
0:0 on device "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst).
 ERR=Input/output error.
btape: btape.c:1250-0 Read block 1 failed! ERR=Input/output error
*

And this is the error I've gotten every time I've gone through the above 
procedure.  The write portion of the test succeeds (or at least it appears to), 
but the read portion fails with the same above error every time.

I have also attempted to mount/label the volume in bconsole:

*label storage=I2M-AWS-Offsite-Storage volume=I2M-AWS-BCM-Catalog-Backup-1 
pool=I2M-AWS-BCM-Pool slot=4
Automatically selected Catalog: include-aws-i2m-bcm-cat
Using Catalog "include-aws-i2m-bcm-cat"
Select Drive:
     1: Drive 0
     2: Drive 1
     3: Drive 2
     4: Drive 3
     5: Drive 4
     6: Drive 5
     7: Drive 6
     8: Drive 7
     9: Drive 8
    10: Drive 9
Select drive (1-10): 1
Connecting to Storage daemon I2M-AWS-Offsite-Storage at 
i2m-bcm.include-im.com:9103 ...
Sending label command for Volume "I2M-AWS-BCM-Catalog-Backup-1" Slot 4 ...
3914 Failed to label Volume (no media): ERR=generic_tape_device.c:140 Unable to 
open device "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst):
 ERR=No medium found

Label command failed for Volume I2M-AWS-BCM-Catalog-Backup-1.
Do not forget to mount the drive!!!
*

This was with the slot 4 tape unmounted from drive 0 -- I was expecting Bareos 
to mount it automatically to do the labeling, but it appeared not to work, so 
then I tried mounting it myself with mtx before running the label command:

# mtx -f 
/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-mediachanger-lun-0
 load 4 0
Loading media from Storage Element 4 into drive 0...done

*label storage=I2M-AWS-Offsite-Storage volume=I2M-AWS-BCM-Catalog-Backup-1 
pool=I2M-AWS-BCM-Pool slot=4
Select Drive:
     1: Drive 0
     2: Drive 1
     3: Drive 2
     4: Drive 3
     5: Drive 4
     6: Drive 5
     7: Drive 6
     8: Drive 7
     9: Drive 8
    10: Drive 9
Select drive (1-10): 1
Connecting to Storage daemon I2M-AWS-Offsite-Storage at 
i2m-bcm.include-im.com:9103 ...
Sending label command for Volume "I2M-AWS-BCM-Catalog-Backup-1" Slot 4 ...
generic_tape_device.c:140 Unable to open device "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst):
 ERR=No medium found
ansi_label.c:319 ANSI Volume label name "I2M-AWS-BCM-Catalog-Backup-1" longer 
than 6 chars.
3912 Failed to label Volume: ERR=generic_tape_device.c:140 Unable to open 
device "I2M-AWS-TD0" 
(/dev/tape/by-path/ip-172.30.0.99:3260-iscsi-iqn.1997-05.com.amazon:sgw-f4896c9d-tapedrive-01-lun-0-nst):
 ERR=No medium found

Label command failed for Volume I2M-AWS-BCM-Catalog-Backup-1.
Do not forget to mount the drive!!!
*

--and came up with the same error.

I haven't been able to find much of anything on this situation in 
searches...most of the remotely similar problems were with physical tape drives 
with completely different configurations, and none of them exactly matched the 
output I'm getting here.

I've searched through various logs and also did a 200-level debug output from 
the Bareos storage daemon, but there is nothing obvious telling me what the 
problem is.

In the interest of not flooding this message with any more screen output than I 
already have, I will provide files/outputs to anyone who specifies what they 
would like to see.  Hopefully someone out there has possibly dealt with this or 
may have an idea as to what's going on.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to