Bacula-users

Re: [Bacula-users] mtx-changer loaded issues

2009-03-06 10:28:45
Subject: Re: [Bacula-users] mtx-changer loaded issues
From: "(private) HKS" <hks.private AT gmail DOT com>
To: bacula-users <Bacula-users AT lists.sourceforge DOT net>
Date: Fri, 6 Mar 2009 10:20:28 -0500
Thanks for the response.

On Fri, Mar 6, 2009 at 3:12 AM, Arno Lehmann <al AT its-lehmann DOT de> wrote:
> Hi,
>
> 05.03.2009 21:57, (private) HKS wrote:
>> Hello,
>>
>> I'm introducing a Dell Powervault 124T autochanger to my Bacula
>> config, and am having a bit of trouble with the mtx-changer script.
>>
>> Bacula 2.2.8 on OpenBSD 4.4.
>
> Hmm... OpenBSD is not something I'm very familiar with. IIRC, the tape
> and autochanger interfaces behave a bit differently than what you see
> under linux and solaris.
>
>> The problem is that "mtx-changer /dev/ch0 loaded 0 /dev/nrst0 0" does
>> not work as expected. Here's a quick cut/paste that shows what I mean.
>> ----
>> # chio status -v
>
> Yup... you see, mtx-changer is supposed to use a generic SCSI
> interface - /dev/sgX under linux - and it might be possible that the
> /dev/chX interface works differently (under solaris this does not seem
>  to be an issue, by the way).
>
> There's a changer control script suitable for chio somewhere in the
> Bacula distribution - you might try that.


The OpenBSD port of Bacula has mtx-changer already modified to work
with chio, but it's incomplete. Or, perhaps, my 124T doesn't respond
like most.


>> <...snip...>
>> drive 0: <ACCESS,FULL> voltag: <000015L3:0>
>> # ./mtx-changer /dev/ch0 loaded 0 /dev/nrst0 0
>>
>> # btape -c /etc/bacula/bacula-sd.conf 124T-Drive
>> Tape block granularity is 1024 bytes.
>> btape: butil.c:285 Using device: "124T-Drive" for writing.
>> 05-Mar 15:49 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0" 
>> command.
>> 05-Mar 15:49 btape JobId 0: 3302 Autochanger "loaded? drive 0",
>> result: nothing loaded.
>>
>> ----
>>
>> The key seems to be that mtx-changer loaded is expecting a different
>> format than my system is returning. I modified mtx-changer so I'm now
>> getting the voltag when I check what's loaded, but now btape believes
>> the voltag indicates the slot that's loaded (whatever that means):
>
> Obviously the output format is different to what mtx-changer expects.
>
>> ----
>>
>> # ./mtx-changer /dev/ch0 loaded 0 /dev/nrst0 0
>> 000015L3
>> # btape -c /etc/bacula/bacula-sd.conf 124T-Drive
>> Tape block granularity is 1024 bytes.
>> btape: butil.c:285 Using device: "124T-Drive" for writing.
>> 05-Mar 15:52 btape JobId 0: 3301 Issuing autochanger "loaded? drive 0" 
>> command.
>> 05-Mar 15:52 btape JobId 0: 3302 Autochanger "loaded? drive 0", result
>> is Slot 15.
>>
>> ----
>>
>> This causes issues because Bacula tries to unload the tape into slot
>> 15, which is not the right slot. Also, my barcodes go higher, so
>> there's going to be some weirdness when it tries to do this with a
>> barcode number greater than the number of slots.
>>
>> What exactly is Bacula expecting from the mtx-changer loaded command?
>> Is it supposed to be just a true-false value, an empty slot number,
>> what?
>
> The slot number where the tape came from (and which should be empty,
> but that's not verified).
>
> In your above output "voltag: <000015L3:0>" , guess the 0 behind the
> colon is the slot. If that's the case, fixing mtx-changer to return
> that number would not be too hard.
>
> I don't have access to an OpenBSD box or some sample outputs from chio
> / mtx there, but I believe modifying mtx-changer to correctly use the
> output generated there should be easy enough - if you know a bit about
> awk or sed.
>
> Arno

Ugh, so there's an expectation that the tape in the drive still be
associated with the slot it came from. Unfortunately, that isn't done
by the OS. Here's the full output of chio status -v:
----
# chio status -v
picker 0:  voltag: <:0>
slot 0: <ACCESS> voltag: <:0>
slot 1: <ACCESS> voltag: <:0>
slot 2: <ACCESS> voltag: <:0>
slot 3: <ACCESS> voltag: <:0>
slot 4: <ACCESS,FULL> voltag: <000013L3:0>
slot 5: <ACCESS,FULL> voltag: <000012L3:0>
slot 6: <ACCESS> voltag: <:0>
slot 7: <ACCESS,FULL> voltag: <000011L3:0>
slot 8: <ACCESS> voltag: <:0>
slot 9: <ACCESS> voltag: <:0>
slot 10: <ACCESS> voltag: <:0>
slot 11: <ACCESS> voltag: <:0>
slot 12: <ACCESS> voltag: <:0>
slot 13: <ACCESS> voltag: <:0>
slot 14: <ACCESS,FULL> voltag: <000015L3:0>
slot 15: <ACCESS> voltag: <:0>
drive 0: <ACCESS,FULL> voltag: <000014L3:0>
----

I made some simple modifications to the mtx-changer script that sets
it to associate the tape with the first empty slot on the changer, but
that leads me to some followup questions. I may be misunderstanding
the manual, but I couldn't quite figure these out from the
documentation.

1 - Even though this drive and these tapes are barcode enabled (hence
the voltag), does Bacula operate on them by slot?
2 - I have four sets of five tapes each for offsite backups. All are
barcode labeled (used to be on a Backup Exec system). Will Bacula
expect that the same tapes are in the same slots each time?
3 - Does ALL of Bacula's interaction with the autochanger take place
via mtx-changer?

Thanks again for the help.

-HKS




>
>> Thanks for the help.
>>
>> -HKS
>>
>> ------------------------------------------------------------------------------
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>> -Strategies to boost innovation and cut costs with open source participation
>> -Receive a $600 discount off the registration fee with the source code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users AT lists.sourceforge DOT net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>
>
> --
> Arno Lehmann
> IT-Service Lehmann
> Sandstr. 6, 49080 Osnabrück
> www.its-lehmann.de
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users