Recover Deleted VM config

deathslay

New Member
Sep 10, 2019
3
0
1
27
I was trouble shooting errors and I accidentally deleted my Ubuntu VM Config, is there a way to recover this? I still have all the data on my hard drive but no way to access it because (unless im blind) I can't create a VM with an existing VM Disk Container
1568068783590.png
Trying to recover VM 100. I've attempted to run testdisk on the SSD Proxmox is installed on but can't find the config.

Any suggestions would help!
 
i had the reverse a few days before, i killed a LUN on my storage which held the disk of a CT , trying to delete it gave the 'error unable to find storage xxxxx' and the CT remained

what i bluntly did was go into /etc/pve/lxc and delete the *.conf file ... PVE picked it up and removed the CT from the GUI view.

i would say the opposite is also possible, introducing a <vmnumber>.conf into the correct dir with the correct references should get you back up and running.

As i have not had the situation as you describe before my answer is pure speculation ... be carefull what you do and take precautions (save the disk to a backup-location etc..)..
 
I had a halfway done backup that I restored from and I at least got VM 100 Created but it i guess the main issue im running into is I can't just attach a storage device to a VM without setting a GB limit. 1568079769589.png
This is a picture I grabbed from another article: https://forum.proxmox.com/threads/adding-an-existing-virtual-disk-image.7614/

All I want to do is mount this hard drive in a VM without creating a HDD space, I want to use an existing. (Similar to how you can 'sometimes' unplug a SSD with the OS on it, and put it in the new PC and it boots)
 
i am at the end of a very long day .... so can partially help.

you lost vm 100 .

then created 105 and are trying to use those disks?

i am not sure how your storage is set up. please send out put of
Code:
cat /etc/pve/storage.cfg

use cli to fix this issue.

you'll need to move the 100 disks to the 105 directory, making sure not to clobber what is there.

then you'll need to edit /etc/pve/qemu-server/105.conf and add the disks.

PS:
after all fixed set up rsnapshot to backup /etc/pve/ so the .conf file will be available in the future. ask me about that later.
 
I had two VM, Plex on vm 100 running ubuntu with a zpool of two 4tb hard drives. vm 106 was my win10 torrent vm.

Log of Cat /etc/pve/storage.cfg

Code:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@pve:~# cat /etc/pve/storage.cfg
dir: local
        path /var/lib/vz
        content iso,vztmpl,backup

lvmthin: local-lvm
        thinpool data
        vgname pve
        content images,rootdir

zfspool: Disk4tb1
        pool myzpool
        content images,rootdir
        sparse 0

dir: backupHDD
        path /mnt/data/backup
        content iso,rootdir,images,snippets,vztmpl,backup
        maxfiles 1
        shared 0

dir: backupppp
        path /backup
        content images,backup,vztmpl,iso,snippets,rootdir
        maxfiles 1
        shared 0

You can ignore the last two disks as those are attempts from me trying to backup my data. Proxmox has been crashing randomly for a few days, started at once a day and after a week it was multiple time per day. (a reboot fixed everything) But i'm still Diagnosing hardware to see if thats the issue.

Had an error where I couldn't snapshop a VM, and somewhere in the process of fixing it I deleted the VM_100.config file. thats ALL that was deleted.

So right now I'm just focused on getting all my info off the server and onto a 8TB external.
 
try this
make a new vm 101 . make it all the same as 100 , except you do not need the disk to be larger then say 4 g
do a minimal install of ubuntu. server only to make it quick.

add a disk to it

then from cli
Code:
cp  /etc/pve/qemu-server/101.conf /etc/pve/qemu-server/100.conf

then edit /etc/pve/qemu-server/100.conf and change the disk names to have 100 instead of 101.
 
I don't mean to revive a dead post... but I just went through an accidental conf-deletion. I was able to get everything back up and running and I hope this helps someone in the future. I just dumped the running processes for qemu-server and pulled out each component manually... I largely used the same configurations as this is my homelab.. and I didn't really do snapshots or deviate much from a baseline OS-clone I use (CentOS/Ubuntu). Anyway, hope this helps.

Code:
### dump running info ###
ps -aux | grep qemu-server > ~/ps-qemu-server-dump.txt


### manually build confs ###
nano /etc/pve/qemu-server/XXX.conf

agent: 1
bootdisk: scsi0
cores: XXX
memory: XXX
name: XXX
net0: virtio=XXX,bridge=vmbrXXX
numa: 0
ostype: XXX
scsi0: local-lvm:vm-XXX-disk-0,size=XXX
scsihw: virtio-scsi-pci
smbios1: uuid=XXX
sockets: 2
vmgenid: XXX
 

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!