Restore from VM Disks?

RCNunya

Renowned Member
Nov 17, 2011
22
0
66
OK, today I reloaded my primary Proxmox NVME. The machine still has 2 other drives in it with files. I was able to restore my "important" docker VM from backup and get it going. Just now realized the other machines were not being backed up, but the SSD has the qcow2 and raw files for them? Is there anyway to get them back? I would assume I could create a new VM and point it to the disks, but then I would have to know which OS each was running as well. Any other way?

1752358973138.png
 
You can recover your VMs from the remaining .qcow2 and .raw disk files by recreating the VMs manually, skipping the default disk creation, and then attaching the existing disks via CLI. For example, to restore VM 102:
Bash:
qm set 102 -scsi0 /path/to/vm-102-disk-0.raw
qm set 102 -scsi1 /path/to/vm-102-disk-1.qcow2
qm set 102 -scsi2 /path/to/vm-102-disk-2.raw
Use -scsiX, -sataX, or -ideX based on how the disks were originally attached

Then, open the Options tab for the VM in the WebUI and configure the Boot Order:
  • Add the attached disk(s).
  • Uncheck devices like ide2 (CD-ROM) or net0 (network boot) to avoid boot issues.
Try starting the VM and check if the OS boots.
 
Does it matter what OS I choose when creating the VM? How would I know how the disks were originally attached?
 
Hi,

Since you still have the .qcow2 and .raw disk files, you can likely recover the VMs.

You can do this by:
  1. Creating a new VM in Proxmox (with similar specs).
  2. Deleting the new empty disk it creates.
  3. Moving or linking your old disk file (like vm-101-disk-0.qcow2) into the new VM's folder.
  4. Re-attaching the disk to the VM using the Proxmox GUI or CLI.
Then try starting the VM.
 
When your old nvme isn't totally dead you can mount the old one on your new pve too (/<mountpath>/var/lib/pve-cluster/config.db) and extract the pve db for your vm configs and maybe old etc/network/interfaces (+ interfaces.d/sdn) is useful also. Search in forum for db read howto if that case is still valid and relevant for you.
 
Last edited: