Cluster Support Configuration
EnterpriseBacula Enterprise Only
This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.
Bacula’s Proxmox cluster support is available with BWeb Management Console.
In this example, we have a cluster named cluster1 with 3 nodes,
prox1, prox2 and prox3. 5 virtual machines are defined,
vm1, vm2, vm3, vm4, vm5.
The following steps are needed to activate the support:
Install a Bacula Enterprise FileDaemon on each node of the Proxmox cluster (prox1, prox2 and prox3)
Install and configure BWeb Enterprise Management Configuration Module (Configuration -> Configure Bacula -> Complete the Configuration Wizard)
Define one Client resource per cluster member in the Director configuration file
bacula-dir.conf. For simplicity, the Bacula Client name can match the DNS Promox server name (example “prox1”).Define a JobDefs with the parameters shared by the Proxmox jobs (Schedule, Storage, Priority, …)
Configure Proxmox access in
/opt/bacula/etc/pve.conf(click here for more information)# chown bacula /opt/bacula/etc/pve.conf # chmod 600 /opt/bacula/etc/pve.conf # cat /opt/bacula/etc/pve.conf [default] username=root password=password_of_root host=prox1 skip_certificate realm=pam
Execute the
scan_proxmox_clusteras the unix userbacula# /opt/bweb/bin/scan_proxmox_cluster --cluster cluster1 --node prox1 --jobdefs ProxmoxJobs INFO Using Job Client directive to prox1 tar: Removing leading `/' from member names INFO Doing a backup of the previous configuration tree in bacula-etc.2019-05-06_10:15.tar.gz INFO Job Modification Summary: Added: - j_cluster1_vm1 - j_cluster1_vm2 - j_cluster1_vm3 - j_cluster1_vm4 - j_cluster1_vm5 Disabled: Existing: Removed:
The
clusteroption is used to name the resources that will be created. Thenodeoption is used to select the virtual machines to create. The list of the changes will be displayed in the output of the script. In the BWeb Management Configuration Module, a workset for the Proxmox cluster will be displayed with the list of the changes to apply to the configuration. The option--commit_and_reloadcan activate the changes automatically.scan_proxmox_cluster --cluster cluster1 --node prox1 --jobdefs ProxmoxJobs --commit_and_reload
Schedule the
scan_proxmox_clusterfor each node of the Proxmox cluster at a regular interval with a Bacula Admin Job for example.
It is possible to set various options for the Job or the Fileset.
If the Proxmox node name is not equal to the Bacula Client name, it is
possible to specify --directive Client=name in the command line.
Example:
scan_proxmox_cluster --cluster cluster1 --node prox1 --jobdefs DefaultJob --directive Client=prox1-fd
Example of a complete configuration will be:
#### Configuration for the Cluster
Client {
Name = prox1
Password = xxx
Address = prox1
File Retention = 5 years
Job Retention = 5 years
Catalog = MyCatalog
}
Client {
Name = prox2
Password = xxx
Address = prox2
File Retention = 5 years
Job Retention = 5 years
Catalog = MyCatalog
}
JobDefs {
Name = PromoxJobs
Priority = 10
Type = Backup
Storage = File
Schedule = AtNight
Pool = Default
Messages = Standard
}
Job {
Name = UpdateCluster1
Type = Admin
JobDefs = ProxmoxJobs
Schedule = BeforeNight
RunBeforeJob = "/opt/bweb/bin/scan_proxmox_cluster --cluster cluster1 --node prox1 --commit_and_reload --jobdefs ProxmoxJobs"
RunBeforeJob = "/opt/bweb/bin/scan_proxmox_cluster --cluster cluster1 --node prox2 --commit_and_reload --jobdefs ProxmoxJobs"
RunBeforeJob = "/opt/bweb/bin/scan_proxmox_cluster --cluster cluster1 --node prox3 --commit_and_reload --jobdefs ProxmoxJobs"
}
################################################################
#### The following example configuration snippet was generated by the scan_proxmox_cluster program
Fileset {
Name = fs_pve_vm1
Include {
Plugin = "proxmox: vm=vm1"
}
}
Job {
Name = j_pve_vm1
Client = prox1
Fileset = fs_pve_vm1
JobDefs = ProxmoxJobs
}
Fileset {
Name = fs_pve_vm2
Include {
Plugin = "proxmox: vm=vm2"
}
}
Job {
Name = j_pve_vm2
Client = prox1
Fileset = fs_pve_vm2
JobDefs = ProxmoxJobs
}
...
Command Line Options
--pvefile fileGet credentials from a file (default: /opt/bacula/etc/pve.conf)--profile=nameProfile name to use in the pvefile--username stringProxmox server username--password stringProxmox server password--host stringProxmox server host--realmpam or pve--director stringDirector name. If not provided, the first Director is used--jobdefs stringJobDefs resource name--job ’job_%v’Jobs resource name pattern (--fileset ’fs_%v’Filesets resource name pattern (--directive key=value(storage|client|schedule …)=value definition--fs_option key=valueFileset options such as: signature, compression …--plugin_option key=valueFileset plugin options such as abort_on_error, index …--vm valueVirtual machine to backup (don’t use with vms_(include|exclude))--pool valuePool value to backup--node valueNode to backup--type valueHost type (lxc, qemu)--vms_include patternRegular expression to include virtual machines--vms_exclude patternRegular expression to exclude virtual machines--commit_and_reloadCommit changes and reload just after resources are created--descriptionNew jobs’ description--remove_jobsRemove jobs instead of disabling them--jsonPrint output as JSON string
Storing Proxmox Credentials on Disk
The --pvefile argument can refer to a configuration file stored on
disk. This file may contain the information used to connect to the
Proxmox Cluster. It is possible to store multiple Proxmox server
profiles and reference them with the --profile option.
username=stringProxmox server username (default “root”)password=stringProxmox server passwordhost=stringProxmox server hostrealm=stringpam or pvecluster=stringName of the cluster (used to generate resources)skip_certificateDo not check SSL certificatesOther parameters used in pve_get_address program
failback=stringAddress returned when the virtual machine is not foundbase=stringUsed to determine the Virtual Machine name from a pattern
# cat /opt/bacula/etc/pve.conf
[cluster1]
password=pass1
host=prox1
realm=pam
skip_certificates
cluster=cluster1
[cluster2]
password=pass3
host=prox3
realm=pam
skip_certificate
cluster=test
Go back to: Cluster Support.