Recovering VM config files

altano

Well-Known Member
Apr 6, 2019
54
17
48
41
California, US
alan.norbauer.com
I pulled a drive from a Proxmox host without backing anything up. If I stick it in a new host I can see the LVM-Thin that has the VM disk images, but what about the configs? I don't even care about restoring them as-is, I just want to look at the old configs for reference.

Is this possible?
 
The actual task you asked for is actually rather simple, the issue is that you likely have duplicate VG names now which you need to fix first.
Use vgdisplay to get the IDs and then use something like vgrename OLDID pveold. I'm not sure how to tell which one's the old though.
You then need to mount the old root volume somewhere with something like
Bash:
mkdir -p /mnt/pveold
mount /dev/pveold/root /mnt/pveold
I have a little script here that can extract the configs from the cluster database. I suppose you can also start pmxcfs in local mode.
Make sure you use the /mnt/pveold/var/lib/pve-cluster/config.db path or run cd /mnt/pveold/var/lib/pve-cluster/ first.
I don't know a lot about your setup and this is written from memory with certain assumptions so take this as what it is.
 
Last edited:
If you’re going to have automated backup you should probably just use the one built into Proxmox, right? I believe that includes the VM config. That’s how I have my nodes setup usually.

Oh I suppose if you absolutely can’t spare the drive space and the disk data doesn’t matter, and only the config does? That would be a weird case though.