Bug 628694

Summary: Labeling volumes: when using variable in label format, volume number is missing
Product: [Fedora] Fedora Reporter: Michal Bruncko <michal.bruncko>
Component: baculaAssignee: Andreas Thienemann <andreas>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: andreas, dnovotny, fschwarz, jgorig, limburgher, mmcgrath, rvokal, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-24 10:37:20 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Michal Bruncko 2010-08-30 15:32:32 EDT
Description of problem:
When I use in Pool directive "Label Format" something like this: Label Format = "${Client}-Configuration-Vol", bacula have'nt appended volume number at the end of label format in backup process. I am using fresh installation of bacula with postgresql with empty database and I was trying this as first job (id=1).
From director report (snip):
30-Aug 20:55 bacula-dir JobId 1: Start Backup JobId 1, Job=apollo-Configuration.2010-08-30_20.55.53_03
30-Aug 20:55 bacula-dir JobId 1: Created new Volume "apollo-Configuration-Vol" in catalog.
30-Aug 20:55 bacula-dir JobId 1: Using Device "FileStorage"
30-Aug 20:55 bacula-sd JobId 1: Labeled new Volume "apollo-Configuration-Vol" on device "FileStorage" (/var/backup).
30-Aug 20:55 bacula-sd JobId 1: Wrote label to prelabeled Volume "apollo-Configuration-Vol" on device "FileStorage" (/var/backup)
30-Aug 20:55 bacula-dir JobId 1: Volume used once. Marking Volume "apollo-Configuration-Vol" as Used.

backup was completed successfuly, but I missed volume number after label, something like this: "apollo-Configuration-Vol0001"

When I try to backup apollo client without using variable expansion in Label Format directive (Label Format = "Configuration-Vol"), volume number is appended correctly (but in this case, without client name): "Configuration-Vol0001".

Part of configuration:
Pool {
  Name = Configuration
  LabelFormat = "${Client}-Configuration-Vol"
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Retention = 28 days
  Recycle Oldest Volume = yes
  Maximum Volumes = 450
  Maximum Volume Jobs = 1
  Use Volume Once = yes
JobDefs {
  Name = "ConfigurationJob"
  Type = Backup
  FileSet = "Configuration"
  Schedule = "WeeklyCycle"
  Storage = sd-backup
  Pool = Configuration
  Messages = Standard
  Where = /tmp/bacula-restores
  Write Bootstrap = "/var/spool/bacula/%c.bsr"
Job {
  Name = "apollo-Configuration"
  Type = Backup
  Client = apollo
  JobDefs = "ConfigurationJob"

Is this correct behaviour? I am using this "configuration" pool for multiple clients and I want to differentiate between volumes by its labels (client and volumenumber names).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. in description above
Actual results:

Expected results:

Additional info:
Comment 1 Jan Görig 2010-11-24 10:37:20 EST
This behaviour is correct. Please see bacula manual (http://www.bacula.org/5.0.x-manuals/en/main/main/Configuring_Director.html#Label).

If you want to use Variable expansion and counter, you must define counter explicitly in Counter resource.

But as written in manual, Label format is deprecated and should by replaced by Python scripting.