Recover Bare Metal Backup to VM

Hunv

New Member
Jul 25, 2022
9
0
1
Hi,

we are currently testing the Proxmox Backup Server and already have Backups in place. VM Backup and Recovery works pretty well.
We are now trying to recover a Bare Metal Backup to a VM. My problem is: HOW?
I cannot find any documentations about a full Bare Metal Recovery (doesn't matter if to VM or to Hardware).

Is there anywhere any kind of documentation how to do this? Or is this not possible?

Regards
Kristian
 
How did you backup the bare metal host? Using the proxmox-backup-client I guess? Did you backup it on file or block level? Didn't tried myself to restore a bare metal block level backup to a VM but I think I would first do a block level backup of the whole physical disk using the proxmox-backup-client, then create a VM with settings that matches your physical host the most. Make sure theavirtual disk is as big as the physical disk. Then run the proxmox-backup-client on the PVE host and restore that disk image to the virtual disk device while the VM is stopped (for example restore to /dev/zdXYZ in case of a zvol).
 
there is no built-in way to do that yet. one way that should work is:
- create VM without disks
- use proxmox-backup-client map ... to map the backup as block device on the PVE host
- use qm set -scsi0 target-storage:0,import-from=/path/to/mapped/backup,other_options (change parameters as desired/needed)
- after the import is done, don't forget to unmap the block device again ;)

Edit: @Dunuin 's approach should work as well, but has a bit more potential to go wrong (wrong target device, wrong size, ..)
 
Last edited:
there is no built-in way to do that yet. one way that should work is:
- create VM without disks
- use proxmox-backup-client map ... to map the backup as block device on the PVE host
- use qm set -scsi0 target-storage:0,import-from=/path/to/mapped/backup,other_options (change parameters as desired/needed)
- after the import is done, don't forget to unmap the block device again ;)

Edit: @Dunuin 's approach should work as well, but has a bit more potential to go wrong (wrong target device, wrong size, ..)
Hi @fabian,

I tried this,
I am trying to mount the backup using proxmox-backup-client map "host/webserver/2022-08-08T06:45:12Z" webserver.pxar:/ --repository root@pam@192.168.1.100:backupdrive and get the output: Can only mount/map pxar archives and drive images.
I don't understand what the problem is, as this is a pxar image.
The Snapshot in the PBS Console has 3 files in it: catalog.pcat1.didx, index.json.blob and webserver.pxar.didx. The last one is the biggest one with 130GB.
 
OK, after some reading, I think you don't mean proxmox-backup-client map... but proxmox-backup-client mount, right?
If I do so using proxmox-backup-client mount "host/webserver/2022-08-08T06:45:12Z" webserver.pxar /mnt/webserver --repository root@pam@192.168.1.100:backupdrive and try to run qm set 101 -scsi0 local-ds:0,import-from=/mnt/webserver after, it fails with can't find file 'mnt/webserver'.
 
you are talking about bare metal backups of VMs, but now you have a pxar host backup? VMs in PVE are never managed on the file level by PVE, only on the block level. so you'd need a "foobar.img.fidx" backup, not a "something.pxar.didx" ;)

if by "bare-metal" you mean a "host" backup (in PBS parlance) of a directory tree, you can't restore or import that directly to a VM. you'd need to create your basic VM, and then restore inside the VM using proxmox-backup-client restore .. or proxmox-backup-client mount .. and manual copying/rsyncing/..
 
Hi @fabian,
Thanks for the hint. I changed it to a blocklevel backup and using this two commands I can restore it.
I have a bare metal host with Debian installed, which can potentially crash. For disaster recovery, I want to restore that backup in a VM.

Using this two commands, I can recover the backup and attach it to the VM. But I cannot boot from it:
proxmox-backup-client map "host/webserver/2022-08-08T13:29:02Z" webserver.img --repository root@pam@192.168.1.99:BackupDisk
qm set 102 -scsi0 local-lvm:0,import-from=/dev/loop0

I create the backup using this command:
/usr/bin/proxmox-backup-client backup webserver.img:/dev/md2 --repository user@pbs@192.168.1.99:BackupDisk

I think the problem is, that not the full disk was backuped but just "md2". usind "md" instead does not work. So: how to backup the full disk to be able to fully restore the server?
 
"md2" is not physical disk, but a software raid block device. you'd probably need to backup the underlying disks (e.g., '/dev/sda' and '/dev/sdb', but which and how many you have to find out yourself ;)) and then map and restore each of them if you want to just boot it as is. alternatively, backing up the MD block device should work as well, but you likely need to adjust some things after restoring (like bootloader settings, initramfs contents) - and of course you then lose the redundancy that mdraid provided (at that level - which is usually not the level you'd do RAID in a virtualized setting anyway!).
 
Hi @fabian ,
I created a backup using
/usr/bin/proxmox-backup-client backup webserver.img:/dev/nvme0p1 --repository user@pbs@192.168.1.99:BackupDisk
which seems to backup the underlying disk.

After that finally succeeded if just have webserver.img.fidx file and a blob file in the backup. If I try to map it with the command posted before, it tells me, that cannot map the fidx file.
What I understood is, that the fidx file should just be an index file, but it is the size of the data that were backuped. I miss the real .img file.
How to get to the img file?
 
PVE stores everything deduplicated as small chunk files. There is no big single image file.
 
OK, that makes sense. But how to recover the backup if I cannot map it to restore it?
 
You can map your "webserver.img". There is just no big real img file. Only a img.fidx file as a index pointing to the chunks and then thousands/millions of chunk files.
 
You can map your "webserver.img". There is just no big real img file. Only a img.fidx file as a index pointing to the chunks and then thousands/millions of chunk files.
And where do I find it? If I map the snapshot, it tells me that the img file is not present. That is also what I see in the UI.
 
please provide the full command you use for mapping and the whole output! thanks
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!