Amanda-Users

Re: changer problems with 2.6.1

2009-02-17 23:36:52
Subject: Re: changer problems with 2.6.1
From: "Dustin J. Mitchell" <dustin AT zmanda DOT com>
To: stan <stanb AT panix DOT com>
Date: Tue, 17 Feb 2009 23:33:12 -0500
On Tue, Feb 17, 2009 at 11:06 PM, stan <stanb AT panix DOT com> wrote:
> When we upgraded from 2.5.1p2 to 2.5.2p1, we had to copy the chg-multi script
> from the 2.5.1p1 release into the new tree, as the newer script did not
> work correctly.

Interesting -- did you submit patches?

> 2.5.1p2 chg-multi does not work with 2.6.1. We have observed a couple of
> things. First it seems that the tape handler that we were using, ammt from
> the earlier amanda release is depricated. Since this mahcine is a Linux 
> machine we are back to the bad old days of trying to figure out wheter to use 
> mt-st or
> gnu-mt, and I honestly cannot remember which one of those used to work.

I'm curious - what do you need mt for?

> In addition, we seem to be having problems with some syntax in chg-multi. 
> There are lines that look like this:
>
> echo `_ '$var'` >> $logfile
>
> I (nor my sh interperter) understand these. Looks to me like we are trying
> to execute something called + which does not exist.

It's a rather ill-advised attempt at internationalization.  It's not
pretty, especially in shell.

> So since we are no longer going to be able to use ammt, what commands can
> we expect mt to be involed with & what are the expected returns. Cause both
> versions of the Linux mt commands (gnu-mt & mt-st) available for Ubuntu
> return something different for an, mt -f /dev/nst0 status than ammt -f
> /dev/nst0 status (none of the three match results).

Amanda does not use mt at all at this point.  I do notice that
chg-multi still begins with:

 51 if ! error=try_find_mt; then
 52     echo <none> $error
 53     exit 2
 54 fi

but the result ($MT) is never used.  I'd rip that out if I weren't
about to delete the whole file :)

> We got past the syntax
> problem after getting rid of all the '_ ' in chg-multi & then amcheck which
> calls the changer script fails to be able to find a valid slot. We suspect
> that this is because chg-multi expects different behavior from mt than
> it used to get from ammt. We tried forcing the existing, working 2.5.2p1,
> that normally uses chg-multi from 2.5.1p2 and ammt to not find ammt & so
> use the system mt. It reproduces the same error just described (confirmed
> suspicion that Ubuntu gnu-mt & mt-st are incompatible with the changer
> code)

OK, a few pieces of Amanda history may be relevant to your investigations here.

First, Amanda no longer assumes it is using a tape drive (that is,
something which 'mt' might be able to operate).  This is a part of the
Device API which was introduced in 2.6.0.  The only point at which
changer scripts need to interact with a device is to determine whether
it's ready or not -- in chg-zd-mtx and chg-manual.  For this, these
scripts now use amdevcheck.  This has brought its own set of issues,
but is fully functional and does not involve 'mt' in any way.

Second, there are a number of other changes to the changer API in
2.6.1 -- see amanda-changers(7) and
http://wiki.zmanda.com/index.php/Changer_API for a taste.  Among lots
of other interesting action, we're deprecating and removing all of the
old shell scripts.  At the moment, the new Changer API is *always*
used, via a C-to-perl (and old-to-new) wrapper script
(changer-src/chg-glue.pl[1]) and a perl-to-shell (and new-to-old)
wrapper script (perl/Amanda/Changer/compat.pm).  There's room for
problems at several points along this chain.  I'm busily at work
rewriting changers into the new API, and rewriting the Amanda taper in
Perl so that it can utilize the new API directly.  You can see the new
Amanda::Changer::rait at
http://github.com/djmitche/amanda/tree/chg-rait-pl/perl/Amanda/Changer/rait.pm
(and, if you're willing to build Amanda from source, you may be able
to use this to fix your chg-multi problems).

I woul suggest looking into the source of chg-multi to see where it
puts its debugging information, and potentially adding more debugging
echo's as necessary to see what it's doing.  Also look at the taper
debug log to see what commands it's sending to the changer.  You may
be able to run simpler operations using 'amtape', rather than running
an entire amdump just to replicate the failure.

Good luck, happy hunting, and, if you've got some Perl-fu, please
consider coding up a new-style Amanda::Changer::multi!

Dustin

[1] You can find the source at http://github.com/nikolasco/amanda/tree/

-- 
Storage Software Engineer
http://www.zmanda.com