How to recover /var/lib/pve-cluster/config.db ?

Fathi

Well-Known Member
May 13, 2016
125
3
58
52
Tunis, Tunisia
Hello,
I was unlucky setting up a cluster of two proxmox nodes, so i looked for ways to revert back and partially followed the howto lokated at https://elkano.org/blog/how-to-reset-cluster-configuration-in-proxmox-2/
Now, in the proxmox gui version 4.1, none of my VMs nor lxc containers appears.
Is there any way to recover or recreate files under /var/lib/pve-cluster/ ?

My VMs are running and i can ssh to them, but in case of a proxmox reboot, i suppose none of them will be accessible.

TIA.
 
Last edited:
No that does not help him, you cannot just "reinstall" a whole node with running VM's, I have the same situation right now, and nobody wants to give some actual useful direction...
 
  • Like
Reactions: Fathi
No that does not help him, you cannot just "reinstall" a whole node with running VM's, I have the same situation right now, and nobody wants to give some actual useful direction...

I'd suggest to restore your backup of that file :p

Asking the question, I presume you do not have a backup, so reinstall your node (or install in a vm and only replace the file itself) and backup your server.
 
Same situation here.
I successful restore the files in /var/lib/pve-cluster/ from backup but still can't see any VM in the web.
Any suggestions ?
 
  • Like
Reactions: aadursun
Hi,

I am in a similar situation, broken proxmox host, I'd like to wipe it but recover a few of the VMs before that.
Found that /etc/pve/ is empty and that's because it was part of a cluster. The other computer in the cluster no longer exist.

I found that my VM configs are stored in /var/lib/pve-cluster/config.db

But how do you get that data out (rather than restoring the whole thing, which would probably break my new proxmox server).

Salvaging a proxmox server is quite difficult ! It seems to rely on backup rather than having an easy way to move, only the stuff you want to keep, over to the new server.
 
But how do you get that data out (rather than restoring the whole thing, which would probably break my new proxmox server).
It's a SQLite database, so you can just use SQL to get the data out.

Salvaging a proxmox server is quite difficult ! It seems to rely on backup rather than having an easy way to move, only the stuff you want to keep, over to the new server.
The easy way is this database file. There is also a chapter about the filesystem in the documentation. Harder is to migrate the data off your PVE box depending on the used storage technology.

I am in a similar situation, broken proxmox host, I'd like to wipe it but recover a few of the VMs before that.
Found that /etc/pve/ is empty and that's because it was part of a cluster. The other computer in the cluster no longer exist.
Most probably a quorum issue, have you tried set the expected nodes to 1?

Code:
pvecm expected 1
 
you can also use "pmxcfs -l" to start the pmxcfs that provides /etc/pve in "local mode" (don't do this in a real cluster that you want to continue using! but in your situation, for extracting config files and then reinstalling the whole system it is okay).
 
  • Like
Reactions: Fathi and LnxBil
Hello

I opened /var/lib/pve-cluster/config.db with
https://sqlitebrowser.org/ an open source sqlite browser

The format isn't too difficult, there is one table called tree.
Each entry has a name and a data field

Name is the file name that you would expect and data is the content of the text file


1710319487602.png
 
In this case I could not use pmxcfs -l because when I boot it, there is no more network, doesn't see the network card at all.
So I am extracting the data with debian installed before overwriting the system with proxmox installer.

This system was running on a hard drive with LVM2.
I am hoping that the proxmox installer only wipes pve/root and pve/data but not the VM themselves !

The stuff on there is not too important but I'd like to save it if possible.
However I have not found how to turn an LVM volume into a file that I could scp over the network.
 
the installer will format the whole disk you select as target, there is no partial re-install!
 
However I have not found how to turn an LVM volume into a file that I could scp over the network.
In Unix and Linux, everything is a file. The virtual disk content is a block device, which normally resides in /dev/<volume group name>/<volume name>. This has to be read with dd first, you cannot scp the device.

In this case I could not use pmxcfs -l because when I boot it, there is no more network, doesn't see the network card at all.
So I am extracting the data with debian installed before overwriting the system with proxmox installer.
You could just try to chroot in the other system and try to fix the problems you have at the moment.
 

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!