Bacula-users

Re: [Bacula-users] vchanger interaction.

2014-05-19 21:45:40
Subject: Re: [Bacula-users] vchanger interaction.
From: Bill Arlofski <waa-bacula AT revpol DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 19 May 2014 21:43:25 -0400
On 05/19/14 21:12, Steven Haigh wrote:> On 19/05/14 23:45, Josh Fisher wrote:
>> On 5/19/2014 3:56 AM, Steven Haigh wrote:
>>> On 18/05/14 12:50, Steven Haigh wrote:
>>>> Hi Vizo,
>>>>
>>>> If I use the UUID:blah format, vchanger can't find the drives.
>>>>
>>>> I found on another post to this list in the archives (via google) that
>>>> the following method worked - but I'm unsure if any further problems
>>>> were encountered.
>>>>
>>>> It seems to be a problem with libuuid or similar?
>>> Hi all,
>>>
>>> Following on from this, I've had a problem with every restore with
>>> Bacula throwing an error because it thinks the volume is online (when
>>> the drive may be ejected).
>>>
>>> I wrote a perl script that can be used with udev to automatically start
>>> / eject volumes. It makes a few assumptions, such as that you'll only
>>> add to the END of magazines = blah in the vchanger config.
>>>
>>> I've attached it for reference.
>>>
>>> Looking at the structure of the SQL for volumes, would it be better to
>>> set the 'InChanger' to 0 instead of Enabled = 0 when a volume is
>>> removed? Then set InChanger = 1 when the volume is added back?
>>
>> Actually I believe it is better to us bconsole commands from a shell
>> script to do this. bconsole will always be kept in sync with the
>> database version. The 'update slots' command should be executed any time
>> disks are attached or removed and should be all that is needed.
>
> As a side note, 'update slots' does not seem to work in this scenario. a
> manual 'vchanger slots' shows all slots as empty - but does not set
> InChanger=0 when a slot is empty. This leaves bacula still thinking that
> the slots are populated.

Hi Steve... There was a conversation on this list last year when I wrote that
script:

Subject: "vchanger attempts to mount 5 volumes before stopping and requesting
magazine change"

If memory serves me correctly, I used the Enabled field to prevent Bacula from
even attempting to consider a volume for use (pretty sure that is also what
Josh was using in the script(s) he wrote - from which I drew  inspiration).
Maybe that's the the solution to your problem too?

I also remember a short conversation with Kern as to doing this a a slightly
different way - I can't seem to find that thread right now though.

Also, I do not get failed emails that you mentioned in your prior email.   If
a volume is needed, but is not "Enabled", Bacula asks for intervention via
console and operator email.

So, I run my script as an "Admin type" job in a "Runs Before" script as my
first nightly job, followed by a  update slots storage=c0 drive=0  bconsole
run before console command.

Then, if Bacula needs a volume later on, I get notified via email, swap the
drive and then manually run my script, and a bconsole update slots command and
everything continues on.



Hope this helps!

Bill



-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users