How to restore vm DISKS back to VMs without .conf files?

turdor

Member
Apr 2, 2017
52
1
13
45
PVE 5-2-1
Video cards passthrough

I have a bunch of raw vm-xxxx-disk-x disk images, and have NO .conf files for them. Some are win and some are mac, may be one are linux.

Any way to restore em except trying one by one attaching to a similar new VM(s) plz?

They where created on a lost server.
No screen shots of server list.
VM naming was self-explainatory but I recon it was lost longside .conf files? Any way to restore it from raw?

tyvm for any tip!
t
 
Last edited:
Is the server completely gone?
If you still have the disk of the PVE installation you could grab the configs from the pmxcfs or its database (see https://pve.proxmox.com/pve-docs/chapter-pmxcfs.html#_recovery)

As for the names - you can start a vm with a live-cd, and pass the raw-image inside, mount it there and try to get the hostname from the mounted ystem

The name of the VM is only stored in the conf file as you guessed

hope this helps!
 
thanx for quick reply Stoiko!!!

Is the server completely gone?
yep - it was gone gone on corrupted zfs (( was no way to login even from USB... but good to know! tyvm!

As for the names - you can start a vm with a live-cd, and pass the raw-image inside, mount it there and try to get the hostname from the mounted ystem
not really clear what do you mean by a hostname? server name? do I need it? or you mean operating sys running?

but anyway - is isn't it will be easier just to attach those disks to existing VMs on a running host? I'm writing you from VM on this running host... Also I use similar VMs, so they have to be if not identical then very similar.

best ak
 
As for the names - you can start a vm with a live-cd, and pass the raw-image inside, mount it there and try to get the hostname from the mounted ystem


hope this helps!
how I would do that? "pass the raw image inside, mount it there" especially plz?
 
OK - got it, make a VM, start it w live CD and try disks there...
Q: What live CD? You mean any WIN Live CD, so at least I can recon WIN VMs?!
 
How did that happen?
multiple hard resets due to hw failure (power failure on mb) = HOST ZFS DIED
- I know it is bad,
- I know I should use at least hw mirror raid on a system host SSD,
- I know I better to backup data from host (THIS IS A BLOODY HARD PART - I NEED TO PRACTICE HOW TO BKP-RSTR PVE HOST W ALL CFG - ANY SUGGESTIONS PLZ???!?! BETTER STEP BY STEP INSTRUCTIONS LINK OR ANY BOOK SUGGESTED?)
so PVE on SSD died that much so cannot be accessed even via PVE USB - I never use again ZFS on a host, also it is way faster now for guests and no bottlenecks - I just not knowing enough to use ZFS at the moment...

anyway - fortunately I just finished to cloning/moving all VM disks to an external ZFS HDD - it was months ago, then I checked all the data is accessible on HDD and put it apart... it's died exactly on cloning operation by the way and all the host was hanging a lot by the way - probably due to poorly configured ZFS as I was reading lately

Anyway thad SSD is formatted and PVE reinstalled long ago, so now I need to access those VMs disks/restore VMs... as to my poor ZFS understanding - there is no way to access files directly on messed ZFS (its basically a kinda RIAD, not files itself), so no way to get VMs .conf to be restored manually from there?

so now HDD/ZFS seems to be functional and attached to a new PVE on identical hw - I can see all the content but cannot manipulate it from PVE web interface (like clone), I guess PVE need to see em over some .conf files attached to VMs?
 
Last edited:
- I know I better to backup data from host (THIS IS A BLOODY HARD PART - I NEED TO PRACTICE HOW TO BKP-RSTR PVE HOST W ALL CFG - ANY SUGGESTIONS PLZ???!?! BETTER STEP BY STEP INSTRUCTIONS LINK OR ANY BOOK SUGGESTED?)

It's easy: use ZFS :p

Anyway thad SSD is formatted and PVE reinstalled long ago, so now I need to access those VMs disks/restore VMs... as to my poor ZFS understanding - there is no way to access files directly on messed ZFS (its basically a kinda RIAD, not files itself), so no way to get VMs .conf to be restored manually from there?

If your ZFS is not a backup (vzdump files) then there is no configuration. The configuration is only present in a "real" backup (vzdump) or in the PVE host itself in the sqlite database backing the /etc/pve fuse filesystem (https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs))

Your ZFS pool is/was not mirrored or some level of RAIDz and then something broke? Yeah, that is really bad and you will have to learn how ZFS works and try to recover stuff (very, very hard and time consuming.... use zdb for debugging) or give the disk to a data rescue company that knows how to handle ZFS. For your next ZFS build, use at least mirrored disks.
 
  • Like
Reactions: Stoiko Ivanov
OK - got it, make a VM, start it w live CD and try disks there...
Q: What live CD? You mean any WIN Live CD, so at least I can recon WIN VMs?!
I don't have too much experience with recovering Data from Windows I'm afraid - but maybe setup a Windows VM - and add the disk of the vm you need to get the data from:
* You need to do this from the commandline since you cannot add a disk belonging to a different vmid (say 4000) to a vm with vmid 1000
* add a line:
`ide1: storage:vm-4000-disk-0,size=32G`
to the config of vmid 1000
* start it
* find out what you need to find out to recreate the old vm config (on linux that would probably be the network configuration and the hostname)
* stop the vm 1000 and remove the line you added! (this is important otherwise you will eventually corrupt the disk)
* recreate VM 4000 by creating a new VM with appropriate config and then putting the disk-image in its config file

Hope this helps!
 

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!