Bacula-users

Re: [Bacula-users] Difficulties with tape rotation/recycling

2008-04-09 20:26:42
Subject: Re: [Bacula-users] Difficulties with tape rotation/recycling
From: Wil Cooley <wcooley AT nakedape DOT cc>
To: bacula-users <Bacula-users AT lists.sourceforge DOT net>
Date: Wed, 09 Apr 2008 17:25:54 -0700
On Wed, 2008-04-09 at 12:44 -0400, Ryan Novosielski wrote:

> Part of the problem is it sort of sounds like you may not have read any
> of the rest of the manual, which contains a lot on operational tasks.
> Read on some.

I have read lots of the manual; it's just been in very small sessions
over a long period and often when I was severely frustrated and probably
in a hurry. It tough to retain in that situation. The workflow of
time-based configuration makes it hard to keep up with.

> You need to find out why not. "Whatever reason" is absolutely something
> that needs to be known before you can figure this out, and I don't think
> anyone on the list will be able to tell you. It helps to draw this out
> on a piece of paper. Bacula will save the volume for the retention
> period. Everything you should need to figure out how long that is can be
> gotten from 'llist media=<name>'. Figure out when a tape is due to
> expire. The time values are written in seconds.

The tape in question has a LastWritten date of "2008-03-21 00:59:57" and
retention and duration of 1209600 (14 days). Oddly enough, the director
claims that it logged that it actually recycled the tape Saturday:

05-Apr 23:35 spartacus-dir: Recycled volume "TR5-2007-08-21"

but I am positive that '[l]list media' showed VolStatus "Full" until
Sunday or Monday night, when I manually purged it. There seemed to be a
job on this tape from the 26th which for some reason had not completed. 

Hm, it seems that the last job ended up needing to span tapes, but due
to error on my part it ended up timing out because I did not exchange
the tape after 5+ days (this is my personal stuff, not a
business-critical operation). So even though all of the actual data on
the tape was last-written on the 21st, the job itself did not end (with
an error) until the 26th, so it wouldn't have expired until today or
early tomorrow.

This explains why the tape did not get recycled as soon as I expected,
but not why the jobs that were waiting for an appendable tape did not
start using it. Maybe I just did not wait long enough?

> > I have found previously that once I got the tape to "Recycled" or 
> > "Purged" state (sometimes by manually pruning/purging), Bacula would use 
> > the tape if I restarted the director (or maybe restarted the storage?). 
> > Damn, I just restarted them both to check and now there are no jobs 
> > waiting on the tape and the tape is no longer in state "BLOCKED waiting 
> > for mumblemumble". I guess I'll so if they run tonight.
> 
> No, this is wrong -- you never restart the daemon to deal with tape
> manipulations. Have you read the tutorial section of the manual? A mount
> is all you need.

Sorry, I was not clear. I was restarting the director because I changed
the config file and noticed this as a side-effect. I know about mounting
and unmounting the tape. The new tape was definitely recognized, just
not seemingly appendable.

Nevertheless, restarting *does* cause things to change. When I started
writing the first e-mail, the tape was marked recycled in 'list media',
the "device status" section of 'status media' showed that a new tape was
being waited for, and there was a queue of jobs in the "Jobs waiting to
reserve a drive". I foolishly restarted and the output of 'status media'
changed--the queued jobs are gone and the device status no longer has a
message about waiting for an appendable volume. (An errant use of 'show'
or 'llist' shortly afterwards caused me to lose the actual messages,
because they scrolled off the top of my buffer.)

> > At any rate, here are the important bits of my configuration; perhaps 
> > someone can tell me if I am doing something boneheaded.
> > 
> > My clients are all basically the same as this, with the exception of 
> > name, address and password:
> > 
> > Client {
> >    Name      = myhost
> >    Address   =  myhost
> >    FDPort    = 9102
> >    Catalog   = MyCatalog
> >    Password  = "xxx"
> >    File Retention = 14 days
> >    Job Retention = 14 days
> >    AutoPrune = yes
> > }
> > 
> > Pool sets my volume size, count, retention period and use duration. Hm, 
> > is "Recycle Current Volume = yes" what I am missing? Or would "Recycle 
> > Oldest Volume" be better, so pruning doesn't happen on the tape that 
> > needs to be swapped out if it takes me a few days to do it (which it 
> > does sometimes)?
> 
> - From what you said above, it sounds like you've done the required
> reading here, but do not necessarily have a good grasp of how this
> works. I'm not sure what's in that chapter, as I haven't read it myself
> lately.
> 
> What you need to document is how exactly you're getting to this point.
> It's not clear what you intended to do with that label format directive.
> As you only have 2 volumes, it looks like it will never be used. You
> have not shown us your volumes though, so I couldn't tell you.

The label format isn't used; it is the remnant of following an example
that turned out not to be what I wanted. I included it for the sake of
completeness; sometimes things that are innocuous turn out to not be so
innocuous...

> The key principle to automatic recycling is that you will have a finite
> number of volumes (which here, you do), a finite limit of how long/much
> they will be used, and retention periods that are not longer than the
> amount of time it will take to need another volume.
> 
> FYI, however, I found 2 volumes was very problematic. I can't be more
> specific, but I found out there was always difficulty with my retention
> periods unless I had that third volume as a buffer.

Hm, interesting. I am wondering if I shouldn't just scrap daily tape
backups and use disk backups on a daily basis and then periodically
migrate to tape or DVD (or encrypt and upload them to gmail ;).

Thanks for your help!

Wil


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users