Can someone help me recover my Cluster Config after deleting by mistake?

erasmo0284

New Member
Jul 26, 2024
23
2
3
Hello, I have lost my 1 CT and 1 VM after running these 2 commands
rm -rf /var/lib/pve-clusterrm -rf /etc/corosync/*
I was trying to remove a cluster, Now I don't see my casaos-100 and ubuntu-101 VM
is there any way I can recover my CT and VM if I don't have a Backup?
 
Last edited:
Hello, I have lost my 1 CT and 1 VM after running these 2 commands
Code:
rm -rf /var/lib/pve-cluster; rm -rf /etc/corosync/*
I was trying to remove a cluster, Now I don't see my casaos-100 and ubuntu-101 VM
is there any way I can recover my CT and VM if I don't have a Backup?

Is this a cluster? If so, what about your other node(s)? They should still have it. If not, all you have really removed are the configurations, the VM drives are all there, you can recreate just the config files manually.
 
  • Like
Reactions: erasmo0284
Thank you for the Reply esi_y.
May I know how I can recreate the configuration? I'm very new to proxmox

First, I just want to say - if you have another cluster node, you could copy the config from there, but based on your reply, I just assume it is a single node install or you lost the other nodes where the identical configs would be.

When you create a VM or CT, there's a config file stored in /etc/pve/qemu-server/ (or /lxc/). You probably do not care for the full documentation [1][2], but what you can do is create new VM and CT - do NOT number them the same, give them some other number, e.g. 200, 201, you will later delete them.

Afterwards, have a look into the directories, you will find the config files for the newly created VM/CT there. Copy it and edit the contents - you basically need to point them to your retained "disks".

[1] https://pve.proxmox.com/wiki/Manual:_qm.conf
[2] https://pve.proxmox.com/wiki/Manual:_pct.conf
 
  • Like
Reactions: erasmo0284
I had 2 clusters, the main one for me i7-12650h, and another one named Ryzen9-5950x
I tried to remove the Ryzen9-5950x but after restarting I never see again my CTs and VM inside the i7-12650h
The Ryzen9-5950x disappears as a cluster if you see my screenshot.
Thanks for the help, I will try what you told me even though I don't know what I'm doing lol
 

Attachments

  • Screenshot_5.png
    Screenshot_5.png
    72.3 KB · Views: 4
I had 2 clusters, the main one for me i7-12650h, and another one named Ryzen9-5950x
I tried to remove the Ryzen9-5950x but after restarting I never see again my CTs and VM inside the i7-12650h
The Ryzen9-5950x disappears as a cluster if you see my screenshot.
Thanks for the help, I will try what you told me even though I don't know what I'm doing lol

You would save yourself the manual work if you can carve out the deleted file from the other node (I supposed you had one cluster, 2 nodes). And by that I mean connecting directly to the node that you do not see in the GUI. Is that other machine running? They should be two separately accessible machines. I would best connect by SSH (if you are on Windows, you will need e.g. PuTTY app for that). You can also literally sit in front of the machine and check its own console (i.e. monitor ;)). And look if there's a file in /var/lib/pve-cluster named config.db.
 
  • Like
Reactions: erasmo0284
Just to give you more information to see if it makes more sense to you, The only thing I want is to have the virtual machine and the casaos container under i7-12650h. I think that's what you called Node. The Node I want is visible and I have access to the Terminal on Proxmox because the one I wanted to delete the Ryzen9-5950x is gone and I don't need it. But the one Visible now i7-12650h I don't see my Virtual Machine and CasaOS Container
 
Last edited:
Just to give you more information to see if it makes more sense to you, The only thing I want is to have the virtual machine and the casaos container under i7-12650h. I think that's what you called Node. The Node I want is visible and I have access to the Terminal on Proxmox because the one I wanted to delete the Ryzen9-5950x is gone and I don't need it. But the one Visible now i7-12650h I don't see my Virtual Machine and CasaOS Container

I think I understood you fine, cluster is a set of machines working together, also called nodes. And all I say is that if those two were part of one cluster, they had the same config replicated. So if you accidentally deleted it from the machine you want to keep, you can still copy out the useful config from the other machine because it is most likely still there. :)
 
  • Like
Reactions: erasmo0284
Your information is most appreciated and your time to answer me too. Thank you again. I will try to recreate it like you mentioned :)
 
I have try this command or config but its not working, I see the files inside the directory but I don't know if my config is correct.

Here is what I have in place:
boot: order=scsi0
memory: 16384
meta: creation-qemu=8.1.5,ctime=1726513734
name: casaos
net0: virtio=BC:24:11:E7:9F:E8,bridge=vmbr0
ostype: l26
scsi0: /dev/pve/vm-100-disk-0,size=50G
smbios1: uuid=054a3357-f348-4250-97da-d67c17cbea53
vmgenid: 6a425d1b-07b8-451a-a3d4-504aad037369
bios: ovmf

Can someone help me here?
 

Attachments

  • Capture.PNG
    Capture.PNG
    7.7 KB · Views: 3
I have try this command or config but its not working, I see the files inside the directory but I don't know if my config is correct.

Here is what I have in place:
Code:
boot: order=scsi0
memory: 16384
meta: creation-qemu=8.1.5,ctime=1726513734
name: casaos
net0: virtio=BC:24:11:E7:9F:E8,bridge=vmbr0
ostype: l26
scsi0: /dev/pve/vm-100-disk-0,size=50G
smbios1: uuid=054a3357-f348-4250-97da-d67c17cbea53
vmgenid: 6a425d1b-07b8-451a-a3d4-504aad037369
bios: ovmf

Can someone help me here?

Where did you get the config from - this is the whole config? I think with ovmf bios you need and efidisk:

https://pve.proxmox.com/pve-docs/chapter-qm.html#qm_bios_and_uefi
 
I executed this command
# qm set <vmid> -efidisk0 <storage>:1,format=<format>,efitype=4m,pre-enrolled-keys=1
but I have the same issue
 
I executed this command
# qm set <vmid> -efidisk0 <storage>:1,format=<format>,efitype=4m,pre-enrolled-keys=1
but I have the same issue

The good news is that the command is a template and it starts with # which means it's meant to be run as root (which you are in PVE install), but it also is a leading character for a comment, so ... you executed a comment.

Now if you put away the #, you will not win just yet because the command is a template, with <values> being placeholders - you would need to adapt them according to your VM.

Now I do not know what your storage is and also - I asked how you got that config because I remember suggesting you create new empty VMs then re-use their configs, but those VMs have to be identical and your VM config somehow appears manually put together instead?
 
I created a new container as the previous one and copied its config file , renamed it and edit it like screenshot but it doesn't work.
I also provide you a screenshot of my storage architecture
 

Attachments

  • Capture.PNG
    Capture.PNG
    18.2 KB · Views: 2
  • Capture2.PNG
    Capture2.PNG
    16.7 KB · Views: 1
I am a bit more confused now, sorry. :) The first output was from a VM config, the screenshot now is a container.

What exactly you are trying to revive in which way? Are you perhaps trying to run what was a VM as a CT now?
 
I decided to re-do all the work again and learn from this lesson. Unfortunately, I do not know how to restore the configuration but thank you again for your help.
 
  • Like
Reactions: esi_y

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!