Restore

The Proxmox Plugin provides two targets for restore operations:

  • Restore to Proxmox hypervisor as new or original guest VM.

  • Restore to a local directory as Proxmox archive files (.vma or the pair of .tar and .conf files).

Restore to Proxmox

To use this restore method, the where= parameter of a Bacula restore is used. The guest VM archive will be sent to the Proxmox hypervisor and restored as a new guest VM if the VMID of the restored VM is already allocated. Otherwise, the guest VM will be restored with its original Proxmox.

To restore a VM or VMs to a Proxmox hypervisor, the administrator should execute the restore command and specify the where parameter as in this example:

* restore where=/

and then set any other required restore plugin parameters for the restore.

In the following restore session example, the sequentialvmid plugin restore option is set to “yes”:

* restore where=/
...
Run Restore job
JobName:         RestoreFiles
Bootstrap:       /opt/bacula/working/pve-dir.restore.1.bsr
Where:           /opt/bacula/archive/bacula-restores
Replace:         Always
FileSet:         Full Set
Backup Client:   pve-fd
Restore Client:  pve-fd
Storage:         File1
When:            2018-01-30 14:58:21
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no): mod
Parameters to modify:
     1: Level
     2: Storage
     3: Job
     4: FileSet
     5: Restore Client
     6: When
     7: Priority
     8: Bootstrap
     9: Where
    10: File Relocation
    11: Replace
    12: JobId
    13: Plugin Options
Select parameter to modify (1-13): 13
Automatically selected : proxmox: vmid=108 abort_on_error
Plugin Restore Options
storage:             *None*               (*Default locations*)
pool:                *None*               (*Default pool*)
sequentialvmid:      *None*               (*No*)
Use above plugin configuration? (yes/mod/no): mod
You have the following choices:
     1: storage (Storage location for restore)
     2: pool (Add the VM to the specified pool on restore)
     3: sequentialvmid (Allocate new vmid in sequential order)
Select parameter to modify (1-3): 3
Please enter a value for sequentialvmid: yes
Plugin Restore Options
storage:             *None*               (*Default locations*)
pool:                *None*               (*Default pool*)
sequentialvmid:      yes                  (*No*)
Use above plugin configuration? (yes/mod/no):

The restore job log will indicate which guest VM is restored and which new guest VM was created:

JobId 76: Start Restore Job RestoreFiles.2018-01-25_13.50.31_29
JobId 76: Using Device "FileChgr1-Dev1" to read.
JobId 76: Ready to read from volume "Vol-0004" on File device "FileChgr1-Dev1" (/opt/bacula/archive).
JobId 76: proxmox: VM restore: lxc/ubuntu-container/VM101 as VM222
JobId 76: End of Volume "Vol-0004" at addr=47137166325 on device "FileChgr1-Dev1" (/opt/bacula/archive).

The new guest VM created during the restore will get a new VMID (if the original VMID is not available anymore) but the name/hostname will stay the same as it was with the original VM.

All other guest VM configuration parameters will be restored as they were backed up, including network MAC Addresses. For this reason, it is recommended to inspect and possibly update a guest VMs configuration before it is started. Otherwise, resource conflicts may arise.

New guest VMs will get a new VMID which will be allocated by the Bacula Proxmox Plugin as a random value in a range between the maximum VMID already allocated \(+1\) and \(+11\). This procedure is intended to mitigate possible resource allocation conflicts which could be occur when two or more guest VM restores or creations are executed at the same time, as Proxmox has no conflict resolution mechanism itself for this situation.

Using the plugin restore option sequentialvmid this behavior can be modified so that the newly restore guest VM gets the next available VMID, which will help limiting the range of VMID assigned over time, but will make concurrent restores unreliable.

The Storage target to be used for the restored guest VM disk(s) can be set using the storage plugin restore option. If this option is not set, all guest VM disks will be restored to their original Storage.

To list available Storages, a listing mode is available.

If an improper (e. g., non-existent) Storage is chosen for a restore, the restore process will create the guest VM in the Proxmox hypervisors default Storage.

Restore to Local Directory

It is possible to restore the guest VM data to a file and not to pass the data to the hypervisor. To do so, the``where`` restore option should point to a directory where the Proxmox plugin is installed:

* restore where=/tmp/bacula/restores

If the path does not exist, it will be created by the Bacula Proxmox Plugin.

Check the following example for the test “VM local restore”:

JobId 90: Start Restore Job RestoreFiles.2018-01-30_15.04.12_05
JobId 90: Using Device "FileChgr1-Dev1" to read.
JobId 90: Forward spacing Volume "Vol-0001" to addr=45406565308
JobId 90: proxmox: VM local restore: qm/ubuntu-server/VM108

The restore job log will show that the restore was done to a local directory.

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.