Bacula-users

Re: [Bacula-users] Labeling when using native virtual autochanger

2015-09-04 15:37:41
Subject: Re: [Bacula-users] Labeling when using native virtual autochanger
From: Dan Langille <dan AT langille DOT org>
To: "Ana Emília M. Arruda" <emiliaarruda AT gmail DOT com>
Date: Fri, 4 Sep 2015 15:34:54 -0400

On Sep 3, 2015, at 12:26 AM, Ana Emília M. Arruda <emiliaarruda AT gmail DOT com> wrote:

Hello Dan,

On Wed, Sep 2, 2015 at 11:06 PM, Dan Langille <dan AT langille DOT org> wrote:

On Aug 25, 2015, at 6:55 PM, Ana Emília M. Arruda <emiliaarruda AT gmail DOT com> wrote:

Hello Dan,

Heitor is right :)

Thank you.

Ana: what are you using to quickly test these configurations?  I suspect a VM or similar.

​You're welcome. Yes, I have VMs for testing purposes :).​
 


I run tests with exactly your configuration and had the same issue. The drive index 0 must exist and belongs to the autochanger resource. You have an Index 0 drive in your configuration: vRestore. But it is not in the Autochanger definition. If you put it there, it will work:

Autochanger {
Name = VirtualDisk
Changer Device = /dev/null
Changer Command = /dev/null
Device = vRestore, vDrive-1, vDrive-2, vDrive-3, vDrive-4, vDrive-5
}

I tried defining the vRestore drive with "autoselect = no" (this work for physical autochangers). But it seems to make no sense when dealing with virtual disk autochangers.

Do we need vRestore in there?  Instead, I renumbered my Drive Index fields from zero.

​No, I just added it to the device list because vRestore was configured as an autochanger drive with index 0. I think your solution is better, since we cannot select a specific drive for restores in the case of virtual autochangers.
 

Autochanger {
  Name = VirtualDisk

  Changer Device  = /dev/null
  Changer Command = /dev/null

  Device          = vDrive-1, vDrive-2, vDrive-3, vDrive-4, vDrive-5
}


FYI, I made a change.  I now use vDrive-0 .. vDrive-4

I renamed the devices to match the drive indexes. There is no technical reason for this.  I did it because I like the matching numbers.


Device {
  Name           = vDrive-1
  Media Type     = File
  Archive Device = /usr/local/bacula/volumes
  LabelMedia     = yes
  Random Access  = yes
  AutomaticMount = yes
  RemovableMedia = no
  AlwaysOpen     = no

  Autochanger    = yes
  Drive Index    = 0

  Maximum Concurrent Jobs = 1
  Volume Poll Interval    = 15
}

Device {
  Name           = vDrive-2
...same as above
  Autochanger    = yes
  Drive Index    = 1

  Maximum Concurrent Jobs = 1
  Volume Poll Interval    = 15
}

Device {
  Name           = vDrive-3
...same as above
  Autochanger    = yes
  Drive Index    = 2

  Maximum Concurrent Jobs = 1
  Volume Poll Interval    = 15
}

Device {
  Name           = vDrive-4
...same as above
  Autochanger    = yes
  Drive Index    = 3

  Maximum Concurrent Jobs = 1
  Volume Poll Interval    = 15
}

Device {
  Name           = vDrive-5
...same as above
  Autochanger    = yes
  Drive Index    = 4

  Maximum Concurrent Jobs = 25
  Volume Poll Interval    = 15
}



Having a single drive for restores worked for me. I was able to restore files from jobs/volumes that used the autochanger for backup.
 
​​
Device {
Name = Restore
​-Drive​
Media Type = File
Archive Device = /usr/local/bacula/volumes
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = yes
AlwaysOpen = yes
​​
}

I have this in my bacula-sd.conf:

Device {
  Name           = Restore-Drive
  Media Type     = File
  Archive Device = /usr/local/bacula/volumes
  LabelMedia     = yes
  Random Access  = yes
  AutomaticMount = yes
  RemovableMedia = no
  AlwaysOpen     = no

  Maximum Concurrent Jobs = 1
  Volume Poll Interval    = 15
}

When I run a restore job, it selects vDrive-1 automatically.

​Yes, if you select the virtual autochanger storage for restore, the drive index 0 will be selected for the restore.​
 

How did you get the restore to use Restore-Drive?

I configured the Restore-Drive as a storage in bacula-dir.conf (both Restore-Drive and VirtualDisk drives configured with the same archive device). This way we can choose the Restore-Drive for restoring files that are in volumes in the same mount point as the virtual autochanger.


That is what I suspected, but I wanted to make sure I did not misunderstand.  I've done the same and can restore from the Restore-Drive.

------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users