Bacula-users

Re: [Bacula-users] Restoring from volumes on multiple storages

2009-02-26 09:25:52
Subject: Re: [Bacula-users] Restoring from volumes on multiple storages
From: Graham Keeling <graham AT equiinet DOT com>
To: bacula-users AT lists.sourceforge DOT net, bacula-devel AT lists.sourceforge DOT net
Date: Thu, 26 Feb 2009 14:23:04 +0000
On Thu, Feb 26, 2009 at 01:30:36PM +0100, Uwe Schuerkamp wrote:
> On Wed, Feb 25, 2009 at 05:37:05PM +0000, Graham Keeling wrote:
> > Hello,
> > 
> > Here I'm using bacula-2.2.8.
> > 
> > I have a bacula storage daemon, 'Disk 1' (Device 'Disk 1.0') and a bacula
> > storage daemon, 'BPL2Disk 1' (Device 'BPL2Disk 1.0').
> > There is one backup job allowed per volume.
> > 
> > 'BPL2Disk 1' has a full backup and several incrementals.
> > 'Disk 1' has the latest incremental.
> > 
> > When I try to restore a job that needs four volumes in total including the
> > latest one on 'Disk 1', it seems as if bacula doesn't bother trying to find
> > the last volume on the second storage. It just tries the first and gives up.
> > 
> > I have attached the .bsr file that was produced for the restore job. You can
> > see that it has got the device names correct.
> > 
> > The attached file 'log' shows the commands that I entered for the restore 
> > job
> > into bconsole, the questions that it asked me, and the messages that bacula
> > logged when it tried to run the restore.
> > It clearly shows that bacula knows where the different volumes are, but it
> > then ignored that information and tried to find all the volumes on
> > 'BPL2Disk 1'.
> > 
> > Have a found a bug, a limitation, a feature, or am I doing it wrong?
> 
> Hi Graham,
> 
> sorry I cannot help you with your question, but I was under the
> impression that bacula is able to handle multiple storages and
> devices in a pool just fine (or are your volumes in different backup
> pools?). 
> 
> As we'll be adding a 2nd tape library / changer to an existing bacula
> installation next week I'd be very interested in some comments from
> the list gurus. 

Hello,

In the Job resource, I had a pool for Fulls, a pool for Incrementals, and
a Storage.
After leaving it for a couple of weeks, I changed the Job so that it was now
using a different Storage.

So, it did a single Full backup and several Incrementals to the first Storage,
then some more Incrementals on the second Storage.

When I run the restore, the bacula director knows perfectly well what Storages
the volumes are on, but it creates a single .bsr file and only sends it to the
first Storage. The first Storage can't find one of the volumes that has been
told about, and the director hangs around waiting for a 'mount request' until
the Job times out.


I've now looked at the bacula code a bit, and what I think it does is this
(bear in mind that I'm not one of the proper bacula development guys, so I
might be talking utter rubbish here):

When you tell it to restore something, it creates a single .bsr file.
Though the director knows the Storage that has each volume, the .bsr file
does not contain that information.
The director then takes that .bsr file and sends a "run job=" command back
through the bconsole interface, like this (with the %s bits filled in -
src/dird/ua_restore.c):

         "run job=\"%s\" client=\"%s\" restoreclient=\"%s\" storage=\"%s\""
          " bootstrap=\"%s\" files=%u catalog=\"%s\""

As you can see, the Storage is set outside of the bootstrap file, and I think
you can only specify one of them. So, that single Storage gets told to restore
from all of the volumes, even if the director knows that some of the volumes
shouldn't be there.
I suppose that it's possible that if there was a volume in that place with the
correct label, it would happily restore from it and give you odd files.

One kludgy solution that I may have a go at trying is to make the director
write out a separate .bsr file containing the correct set of volumes that it
needs for each Storage, and then doing multiple "run job=" commands. This
will set off multiple restores and you'd end up with multiple confirmation
messages.
It might all go horribly wrong if you're using plugins, mind.


------------------------------------------------------------------------------
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