Run VM without restoring / directly from backup

Apr 14, 2025
4
1
3
On Veeam I used the 'instant restore' option to start VMs directly from backup, to e.g. test an nextcloud upgrade on a multi-TB VM, without restoring the VM.

In case someone did the same and is missing this possibility from PBS: It's easily possible to do this in PBS:
  1. Create a new VM <NEWVMID> with the desired CPU/RAM/Network but without disks
  2. Map the disk(s) on the PVE
    1. proxmox-backup-client list --repository <pbs-server>:<datastore> | grep <VMID-to-run-from-backup>
    2. proxmox-backup-client map --repository <bps-server>:<datastore> "vm/<VMID>/<SNAPSHOTID from above>" drive-scsi0.img
  3. The mapped snapshot is readonly, so we only use it as backing for a new image
    1. mkdir -p /var/lib/vz/images/$NEWVMID
    2. qemu-img create -f qcow2 -b /dev/loop0 -F raw /var/lib/vz/images/$NEWVMID/vm-$NEWVMID-disk-0.qcow2
  4. Add the new disk to our VM
    • qm set $NEWVMID --scsi0 local:$NEWVMID/vm-$NEWVMID-disk-0.qcow2
  5. Run VM, do stuff, shutdown VM
  6. Remove disk from VM
    • qm unlink $NEWVMID --force --idlist scsi0
  7. Unmap disk
    • proxmox-backup-client unmap /dev/loop0