Bacula-users

Re: [Bacula-users] vchanger question. designed for concurrency?

2008-05-05 11:17:23
Subject: Re: [Bacula-users] vchanger question. designed for concurrency?
From: Josh Fisher <jfisher AT pvct DOT com>
To: Thomas Krwawecz III <tom AT bluegravity DOT com>
Date: Mon, 05 May 2008 11:12:25 -0400
Thomas Krwawecz III wrote:
> I've been going through the vchanger code and have an autochanger setup 
> (working) - but without concurrency. Bacula only uses one device assigned to 
> the autochanger (the other is listed, but not available). From what I can 
> tell vchanger wasn't made with concurrency in mind. Since only 1 mountpoint 
> is defined per "vchanger" config, this seems to be the case. I know it's 
> really for swapping out USB drives but I'm rewriting it in Perl with 
> additional functionality. Does anyone have this setup with multiple devices 
> being used concurrently in their autochanger? I just want to confirm I'm on 
> the right track.
>   

Yes, it does support concurrency by supporting multiple virtual drives. 
I use it with concurrent jobs, however a bug in Bacula's volume 
selection code affects multi-drive virtual autochangers and is currently 
being fixed. (See bug 1083)

Each Autochanger definition in bacula-sd.conf has one or more associated 
Device definitions. Each device defines a (different) ArchiveDevice. The 
ArchiveDevice specifies the path to a "virtual drive", which is a file, 
not a directory. This is because Bacula expects a Bacula volume on the 
ArchiveDevice, and a Bacula volume is (for disk) a file. The 
"mountpoint" specified in the vchanger config is not used by Bacula, and 
as you mention, is simply where the USB drive gets mounted. The vchanger 
script maintains a symlink for each virtual drive to the Bacula volume 
"loaded" in that drive. The USB drive partition is a virtual magazine. 
Each file on the partition is virtual slot containing a Bacula volume.

Maybe a description of what it does for each command would help. First, 
keep in mind that for each autochanger, files are maintained in a 
separate state directory. For example, say the vchanger config specifies 
a state directory at /var/lib/bacula/vchanger1 and a mountpoint of 
/mnt/vchanger1/magazine:

-$ ls -l /var/lib/bacula/vchanger1
lrwxrwxrwx 1 bacula disk    31 2008-05-05 08:10 drive0 -> 
/mnt/vchanger1/magazine/m03s022
lrwxrwxrwx 1 bacula disk    31 2008-05-05 00:31 drive1 -> 
/mnt/vchanger1/magazine/m03s023
-rw-rw---- 1 bacula disk     3 2008-05-05 08:10 loaded0
-rw-rw---- 1 bacula disk     3 2008-05-05 00:31 loaded1

The loadedN file contains the slot number currently loaded into drive N, 
or zero if drive N is unloaded. The driveN symlink points to the file 
that is the Bacula volume in "slot" N. Assume the mountpoint defined for 
the autochanger is /mnt/vchanger1/magazine and the statedir is 
/var/lib/bacula/vchanger1.

For the command "load 12 /var/lib/bacula/vchanger1/drive0 0" command, 
the script would create the symlink /var/lib/bacula/vchanger1/drive0 
pointing to /mnt/vchanger1/magazine/m01s012 and place the value "12" 
into file /var/lib/bacula/vchanger1/loaded0. This is how magazine 1 slot 
12 is "loaded" into drive 0.

For the command "unload 12 /var/lib/bacula/vchanger1/drive0 0", the 
script would delete the symlink /var/lib/bacula/vchanger1/drive0 and 
place the value "0" into file /var/lib/bacula/vchanger1/loaded0. This is 
how virtual drive 0 us "unloaded" and the volume "moved" back into slot 12.

Note that the script supports concurrent jobs by providing more than one 
Bacula device, which allows multiple jobs to write at the same time, 
even with spooling turned off. There is however other factors that 
determine whether jobs can write concurrently. The jobs must have the 
same start time, they must have the same priority, etc. The user manual 
goes into that pretty thoroughly.

Hope this helps.

--- Josh Fisher

> Thomas Krwawecz III
> --
> Blue Gravity Communications, Inc.
> 3495 Haddonfield Rd, Suite 6
> Pennsauken, NJ 08109
>
> Toll Free: 1-877-8 HOSTING
> Tel: (856) 662-9100, Fax: (856) 662-9101
> Web: http://www.bluegravity.com
>
>
> -------------------------------------------------------------------------
> 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
>   

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