Cluster Support Configuration

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_cluster as the unix user bacula

    # /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 cluster option is used to name the resources that will be created. The node option 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_reload can activate the changes automatically.

    scan_proxmox_cluster --cluster cluster1 --node prox1 --jobdefs ProxmoxJobs --commit_and_reload
    
  • Schedule the scan_proxmox_cluster for 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 file Get credentials from a file (default: /opt/bacula/etc/pve.conf)

  • --profile=name Profile name to use in the pvefile

  • --username string Proxmox server username

  • --password string Proxmox server password

  • --host string Proxmox server host

  • --realm pam or pve

  • --director string Director name. If not provided, the first Director is used

  • --jobdefs string JobDefs 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=value FileSet options such as: signature, compression …

  • --plugin_option key=value FileSet plugin options such as abort_on_error, index …

  • --vm value Virtual machine to backup (don’t use with vms_(include|exclude))

  • --pool value Pool value to backup

  • --node value Node to backup

  • --type value Host type (lxc, qemu)

  • --vms_include pattern Regular expression to include virtual machines

  • --vms_exclude pattern Regular expression to exclude virtual machines

  • --commit_and_reload Commit changes and reload just after resources are created

  • --description New jobs’ description

  • --remove_jobs Remove jobs instead of disabling them

  • --json Print 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=string Proxmox server username (default “root”)

  • password=string Proxmox server password

  • host=string Proxmox server host

  • realm=string pam or pve

  • cluster=string Name of the cluster (used to generate resources)

  • skip_certificate Do not check SSL certificates

  • Other parameters used in pve_get_address program

  • failback=string Address returned when the virtual machine is not found

  • base=string Used 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

See also

Go back to the main Proxmox Plugin operations.

Go back to the main Proxmox Plugin page.

Go back to the main Dedicated Backup Solutions page.