Bacula-users

Re: [Bacula-users] mounted tape not accepted if another one has already been recycled

2008-04-15 06:40:36
Subject: Re: [Bacula-users] mounted tape not accepted if another one has already been recycled
From: Tilman Schmidt <t.schmidt AT phoenixsoftware DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 15 Apr 2008 12:40:02 +0200
Ryan Novosielski schrieb:
I think you're going to have to prove it by getting into that situation
and showing the various status messages, an llist on the media, config,
stuff like that. It's very hard to fix a problem if one can't see what's
going on.

Ok, the situation reoccured last night, and this time I just cancelled
the hanging jobs instead of manually pruning the volume they should have
used, so the state shouldn't have changed too much. This is what the
Bacula log says about the incident:


14-Apr 23:05 vm-backup-dir JobId 547: Start Backup JobId 547, 
Job=vm-backup.2008-04-14_23.05.46
14-Apr 23:05 vm-backup-dir JobId 547: Max configured use duration exceeded. Marking 
Volume "Donnerstag" as Used.
14-Apr 23:05 vm-backup-dir JobId 547: Using Device "LTO1"
14-Apr 23:05 vm-backup-fd JobId 547: ClientRunBeforeJob: run command "su - backup -c 
/home/backup/bin/collect-remote-backups"
14-Apr 23:09 vm-backup-sd JobId 547: Warning: Director wanted Volume "Dienstag".
    Current Volume "Montag" not acceptable because:
    1998 Volume "Montag" status is Used, but should be Append, Purged or 
Recycle.
14-Apr 23:09 vm-backup-sd JobId 547: Please mount Volume "Dienstag" or label a 
new one for:
    Job:          vm-backup.2008-04-14_23.05.46
    Storage:      "LTO1" (/dev/nst0)
    Pool:         Daily
    Media type:   LTO1


This is what bconsole tells me about the volumes in the pool in question:


*llist volumes pool=Daily
          MediaId: 19
       VolumeName: Donnerstag
             Slot: 0
           PoolId: 3
        MediaType: LTO1
     FirstWritten: 2008-04-10 23:09:24
      LastWritten: 2008-04-11 10:34:04
        LabelDate: 2008-04-10 23:09:24
          VolJobs: 10
         VolFiles: 13
        VolBlocks: 94,456
        VolMounts: 7
         VolBytes: 6,093,609,984
        VolErrors: 0
        VolWrites: 440,053
 VolCapacityBytes: 0
        VolStatus: Used
          Enabled: 1
          Recycle: 1
     VolRetention: 518,400
   VolUseDuration: 57,600
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 1
          EndFile: 12
         EndBlock: 3,437
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 2
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

          MediaId: 21
       VolumeName: Montag
             Slot: 0
           PoolId: 3
        MediaType: LTO1
     FirstWritten: 2008-04-07 23:09:19
      LastWritten: 2008-04-07 23:42:00
        LabelDate: 2008-04-07 23:09:19
          VolJobs: 10
         VolFiles: 12
        VolBlocks: 74,628
        VolMounts: 4
         VolBytes: 4,814,466,048
        VolErrors: 0
        VolWrites: 339,724
 VolCapacityBytes: 0
        VolStatus: Used
          Enabled: 1
          Recycle: 1
     VolRetention: 518,400
   VolUseDuration: 57,600
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 1
          EndFile: 11
         EndBlock: 3,453
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 2
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

          MediaId: 22
       VolumeName: Dienstag
             Slot: 0
           PoolId: 3
        MediaType: LTO1
     FirstWritten: 1970-01-01 01:00:00
      LastWritten: 2008-04-01 23:42:30
        LabelDate: 2008-04-01 23:09:21
          VolJobs: 0
         VolFiles: 0
        VolBlocks: 0
        VolMounts: 5
         VolBytes: 1
        VolErrors: 0
        VolWrites: 342,514
 VolCapacityBytes: 0
        VolStatus: Recycle
          Enabled: 1
          Recycle: 1
     VolRetention: 518,400
   VolUseDuration: 57,600
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 1
          EndFile: 11
         EndBlock: 0
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 2
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

          MediaId: 23
       VolumeName: Mittwoch
             Slot: 0
           PoolId: 3
        MediaType: LTO1
     FirstWritten: 2008-04-09 23:09:32
      LastWritten: 2008-04-09 23:50:06
        LabelDate: 2008-04-09 23:09:32
          VolJobs: 10
         VolFiles: 13
        VolBlocks: 97,857
        VolMounts: 5
         VolBytes: 6,313,015,296
        VolErrors: 0
        VolWrites: 422,445
 VolCapacityBytes: 0
        VolStatus: Used
          Enabled: 1
          Recycle: 1
     VolRetention: 518,400
   VolUseDuration: 57,600
       MaxVolJobs: 0
      MaxVolFiles: 0
      MaxVolBytes: 0
        InChanger: 1
          EndFile: 12
         EndBlock: 3,460
         VolParts: 0
        LabelType: 0
        StorageId: 3
         DeviceId: 0
       LocationId: 0
     RecycleCount: 2
     InitialWrite: 0000-00-00 00:00:00
    ScratchPoolId: 0
    RecyclePoolId: 0
          Comment: NULL

*


This is my Director configuration:


Director {                            # define myself
  Name = vm-backup-dir
  DIRport = 9101                # where we listen for UA connections
  QueryFile = "/etc/bacula/query.sql"
  WorkingDirectory = "/var/lib/bacula/working"
  PidDirectory = "/var/run"
  Maximum Concurrent Jobs = 1
  Password = "..."
  Messages = Daemon
}

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = vm-backup-fd
  FileSet = "Full Set"
  Schedule = "WeeklyCycle"
  Storage = LTO1
  SpoolData = yes
  Messages = Standard
  Pool = Default
  Priority = 10
}

Job {
  Name = "vm-backup"
  Client = vm-backup-fd
  JobDefs = "DefaultJob"
  FileSet = "vm-backup"
  ClientRunBeforeJob = "su - backup -c /home/backup/bin/collect-remote-backups"
  ClientRunAfterJob = "su - backup -c /home/backup/bin/cleanup-remote-backups"
  Write Bootstrap = "/var/lib/bacula/working/vm-backup.bsr"
}

Job {
  Name = "BackupCatalog"
  JobDefs = "DefaultJob"
  Level = Full
  FileSet="Catalog"
  Schedule = "WeeklyCycleAfterBackup"
  RunBeforeJob = "/etc/bacula/make_catalog_backup bacula bacula ..."
  RunAfterJob  = "/etc/bacula/delete_catalog_backup"
  Write Bootstrap = "/var/lib/bacula/working/BackupCatalog.bsr"
  Priority = 11                   # run after main backup
}

Job {
  Name = "RestoreFiles"
  Type = Restore
  Client=vm-backup-fd
  FileSet="Full Set"
  Storage = File
  Pool = Default
  Messages = Standard
  Where = /tmp/bacula-restores
}

FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
    File = /
  }

  Exclude {
    File = /proc
    File = /tmp
    File = /.journal
    File = /.fsck
  }
}

FileSet {
  Name = "vm-backup"
  Include {
    Options {
      signature = MD5
    }
    File = /etc
    File = /home
  }
  Exclude {
    File = /home/backup/spool
    File = /home/vmware/Reha-activate/reha-activate-flat.vmdk
  }
}

FileSet {
  Name = "Windows Full"
  Include {
    Options {
      signature = MD5
      Exclude = yes
      IgnoreCase = yes

      WildDir = "[A-Z]:/Dokumente und 
Einstellungen/*/Anwendungsdaten/*/Profiles/*/*/Cache"
      WildDir = "[A-Z]:/Dokumente und 
Einstellungen/*/Anwendungsdaten/*/Profiles/*/*/Cache.Trash"
      WildDir = "[A-Z]:/Dokumente und Einstellungen/*/Cookies"
      WildDir = "[A-Z]:/Dokumente und Einstellungen/*/Recent"
      WildDir = "[A-Z]:/Dokumente und Einstellungen/*/Lokale 
Einstellungen/Verlauf"
      WildDir = "[A-Z]:/Dokumente und Einstellungen/*/Lokale Einstellungen/Temp"
      WildDir = "[A-Z]:/Dokumente und Einstellungen/*/Lokale Einstellungen/Temporary 
Internet Files"
      WildFile = "[A-Z]:/Dokumente und Einstellungen/All 
Users/Anwendungsdaten/Microsoft/Network/Downloader/qmgr[01].dat"

      WildDir = "[A-Z]:/WINDOWS/msdownld.tmp"
      WildDir = "[A-Z]:/WINDOWS/$Nt*Uninstall*"
      WildDir = "[A-Z]:/WINDOWS/Temp"

      WildDir = "[A-Z]:/RECYCLER"

      WildFile = "[A-Z]:/pagefile.sys"
      WildFile = "[A-Z]:/hiberfil.sys"
    }
    File = "C:/"
  }
}

Schedule {
  Name = "WeeklyCycle"
  Run = Level=Full Pool=Monthly 1st fri at 23:05
  Run = Level=Full Pool=Weekly 2nd-5th fri at 23:05
  Run = Level=Incremental Pool=Daily mon-thu at 23:05
}

Schedule {
  Name = "WeeklyCycleAfterBackup"
  Run = Level=Full Pool=Monthly 1st fri at 23:10
  Run = Level=Full Pool=Weekly 2nd-5th fri at 23:10
  Run = Level=Full Pool=Daily mon-thu at 23:10
}

FileSet {
  Name = "Catalog"
  Include {
    Options {
      signature = MD5
    }
    File = /var/lib/bacula/bacula.sql
  }
}

Client {
  Name = vm-backup-fd
  Address = vm-backup
  FDPort = 9102
  Catalog = MyCatalog
  Password = "..."
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}

Storage {
  Name = File
  Address = vm-backup.phnxsoft.com   # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "..."
  Device = FileStorage
  Media Type = File
}

Storage {
  Name = LTO1
  Address = vm-backup.phnxsoft.com   # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "..."
  Device = LTO1                      # must be same as Device in Storage daemon
  Media Type = LTO1                  # must be same as MediaType in Storage 
daemon
  Autochanger = no                    # enable for autochanger device
}

Catalog {
  Name = MyCatalog
  dbname = bacula; user = bacula; password = "..."
}

Messages {
  Name = Standard

  mailcommand = "/usr/sbin/bsmtp -h posthamster -f \"Bacula <%r>\" -s \"Bacula: %t %e of 
%c %l\" %r"
  operatorcommand = "/usr/sbin/bsmtp -h posthamster -f \"Bacula <%r>\" -s \"Bacula: 
Intervention needed for %j\" %r"
  mail = backup AT phnxsoft DOT com = all, !skipped
  operator = backup AT phnxsoft DOT com = mount
  console = all, !skipped, !saved
  append = "/var/lib/bacula/working/log" = all, !skipped
}

Messages {
  Name = Daemon
  mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon 
message\" %r"
  mail = root@localhost = all, !skipped
  console = all, !skipped, !saved
  append = "/var/lib/bacula/working/log" = all, !skipped
}

Pool {
  Name = Default
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Retention = 91  days         # three months
}

Pool {
  Name = Daily
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Use Duration = 16 hours      # use only for one run
  Volume Retention = 6 days           # one week minus one day
}

Pool {
  Name = Weekly
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Use Duration = 3 days        # mark as used after weekend
  Volume Retention = 24 days          # four weeks minus one weekend
}

Pool {
  Name = Monthly
  Pool Type = Backup
  Recycle = yes                       # Bacula can automatically recycle Volumes
  AutoPrune = yes                     # Prune expired volumes
  Volume Use Duration = 3 days        # mark as used after weekend
  Volume Retention = 360 days         # one year minus two days (leap year) 
minus one weekend
}

Console {
  Name = vm-backup-mon
  Password = "..."
  CommandACL = status, .status
}

@/etc/bacula/clients/geneva.conf
@/etc/bacula/clients/gollum.conf
@/etc/bacula/clients/chewbacca.conf
@/etc/bacula/clients/lx1.conf
@/etc/bacula/clients/posthamster.conf
@/etc/bacula/clients/vm-lamp-01.conf
@/etc/bacula/clients/w2k3-web-dmz.conf
@/etc/bacula/clients/rufer.conf


The included files contain additional Client, FileSet and Job resources.
I can post them too if you need them.

Expected behaviour: The mounted volume "Montag", whose retention period
ended at 2008-04-07 23:42:00 (LastWritten) + 6 days (VolRetention) =
2008-04-13 23:42:00, should have been pruned, resulting in all records
being pruned, moved to status "Purged", and used for the backup.

Actual behaviour: The mounted volume "Montag" status is rejected because
its status is "Used". No attempt is made to promote its status to one of
the acceptable states (Append, Purged or Recycle). Instead, the Director
emits periodic requests to mount volume "Dienstag" which is already in
status "Recycle".

Do you need anything else?

Thanks,
Tilman

--
Tilman Schmidt
Phoenix Software GmbH                               Tel. +49 228 97199 0
Adolf-Hombitzer-Str. 12                            Fax  +49 228 97199 99
53227 Bonn, Germany                               www.phoenixsoftware.de

Attachment: signature.asc
Description: OpenPGP digital signature

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