I'll reply to myself then...read below
* Jean-Francois Malouin <[email protected]> [20120727
14:44]:
> Hi,
>
> I've read the online wiki howto's about setting up virtual tapes in a
> RAIT but I can't wrap my head around how to label the volumes.
>
> I first setup a single vtape changer with
>
> define changer "vtapes-1" {
> tpchanger "chg-disk:/vtapes-1"
> property "num-slot" "30"
> property "auto-create-slot" "yes"
> }
> tpchanger "chg-disk:/vtapes-1"
>
> I then labeled the tapes and all is fine.
>
> Now I add a second disk and configure the RAIT as:
>
> define changer "vtapes-1" {
> tpchanger "chg-disk:/vtapes-1"
> property "num-slot" "30"
> property "auto-create-slot" "yes"
> }
> define changer "vtapes-2" {
> tpchanger "chg-disk:/vtapes-2"
> property "num-slot" "30"
> property "auto-create-slot" "yes"
> }
> tpchanger "chg-rait:{vtapes-1,vtapes-2}"
>
> Now how do I proceed? I have enabled autolabel so I thought it would
> do things automatically but amcheck tells me:
>
> ~# /home/amanda/sbin/amcheck vtapes-home
> Amanda Tape Server Host Check
> -----------------------------
> slot {1,1}: Volume not labeled
> amcheck-device: Can't call method "make_new_tape_label" on an
> undefined value at /home/amanda/perl/Amanda/Changer.pm line 1611.
>
> Server check took 0.418 seconds
>
> Amanda Backup Client Hosts Check
> --------------------------------
> Client check: 1 host checked in 1.105 seconds. 0 problems found.
>
> (brought to you by Amanda 3.3.2)
>
> Thanks!
> jf
I think I got things working.
Just for future reference here it is in a nutshell:
First define this in the config for "vtapes"
tapecycle 30 tapes
autolabel "vtapes-%%%"
labelstr "^vtapes-[0-9][0-9]*$"
tpchanger "chg-disk:/vtapes-1"
Create the slots and the labels for the 1st part of the mirror:
~># for i in `seq 1 30`; do su amanda -c "mkdir /vtapes-1/slot$i"; done
~># for i in `seq 1 30`; do su amanda -c "~amanda/sbin/amlabel vtapes slot $i";
done
Reading label...
Found an empty tape.
Writing label 'vtapes-001'...
Checking label...
...
Reading label...
Found an empty tape.
Writing label 'vtapes-030'...
Checking label...
Success!
Then modify the tpchanger to point to the second part of the mirror
(ie s/vtapes-1/vtapes-2):
tpchanger "chg-disk:/vtapes-2"
Force (-f) the labeling of the tapes in the 2nd changer with:
~># for i in `seq 1 30`; do su amanda -c "mkdir /vtapes-2/slot$i"; done
~># for i in `seq 1 30`; do su amanda -c "~amanda/sbin/amlabel -f vtapes slot
$i"; done
Reading label...
Found an empty tape.
Writing label 'vtapes-001'...
...
Reading label...
Found an empty tape.
Writing label 'vtapes-030'...
Checking label...
Success!
Change the tpchanger definition to use the chg-rait:
tpchanger "chg-rait:{chg-disk:/vtapes-1,chg-disk:/vtapes-2}"
amanda is now happy:
~># # su amanda -c "~amanda/sbin/amcheck vtapes"
Amanda Tape Server Host Check
-----------------------------
slot {5,5}: volume 'vtapes-5'
Will write to volume 'vtapes-5' in slot {5,5}.
NOTE: skipping tape-writable test
Server check took 1.037 seconds
Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 0.129 seconds. 0 problems found.
(brought to you by Amanda 3.3.2)
One final note: I don't think the labeling script located at
http://wiki.zmanda.com/index.php/File:Createvtapes.sh.txt
and referenced at:
http://wiki.zmanda.com/index.php/How_To:Set_Up_Virtual_Tapes
is very useful as it stands. It should either be fixed or removed.
regards!
jf