HELP!? Lost container configuration files, how can I regenerate/restore them?

oeginc

Member
Mar 21, 2009
133
0
16
Ok, first - before I get chewed out for doing this, I know what I did was wrong and I will not doing it again.. At least by accident.

So what I did was rebuilt all of my machines destroying my old cluster, migrating machines to new hosts as needed to reformat and reinstall fresh on the other hosts.

Once I was done, I started creating a new cluster. I went to add my second machine (I have 8 total right now) but it already had VM's running and complained.

I checked the documentation and it said something like: Make sure you don't have any VM's running.. blah blah... Something or another... And then it said something about it could cause a conflict in ID's.

Well, *all* of my ID's are unique across *all* of my hosts, so I figured that wouldn't be a problem for me. So I -force'd the node to get added to the cluster and then, *BAM* noticed that *ALL* of my host configuration files were magically gone (which in the big scheme of things makes sense).

Why did I do this? Well, to be honest - it's a production environment and I couldn't afford to take the time to migrate or backup/restore all of the hosts (about 18-25 of them) on every server I needed to add to the cluster. As long as my ID's don't conflict, I don't understand why that's necessary...

Anyways.. The containers appear to still be running, but I can't do anything with them because pvectl wants the /etc/pve/id.conf files to exist first.

I have some older backups of most of the containers, there has to be some way of generating these config files from the backups without actually restoring every backup - right? How/where does vzdump and vzrestore keep the container information?

Also, on a side note... Would this have worked okay if I backed up my /etc/pve/*.conf files and then restored them to /etc/pve/nodes/<node> or whatever after adding to the cluster?

Thanks in advanced!
 
I feel your pain . :( Knowledge gained from mistakes are the best ones. But painful to learn them nonetheless.

Once I was done, I started creating a new cluster. I went to add my second machine (I have 8 total right now) but it already had VM's running and complained.
So do you have 2 clusters right now? And all your VMs are still on the old cluster?
 
No, my old cluster is gone (I have physically reformatted all of the boxes).

So... After a little experimenting and reading thru the PVE libraries I found that the VPS configuration file *IS* stored in the backup archive (as I had expected) in /etc/vzdump/vps.conf

So I am going thru each backup, extracting ./etc/vzdump/vps.conf and then moving that file to /etc/pve/openvz/<CTID>.conf

It *seems* to be working so far, but I'm not sure if there are any long-term "bad things" gonna happen...

I have also noticed that there seems to be a backup or two missing (not sure why), is there some way to recreate the container configuration from a running container, or do I just have to do it manually and hope I guess the parameters correctly?
 
I am not too familiar with Container so cannot comment on that. I am sure there is a command for CLI to see status of running Container.

Just out of curiosity, when you were killing old cluster, where were your VMs?
 
As I mentioned originally, I migrated them off to the other nodes and kept moving them around until I had everything reformatted and reinstalled. It worked just fine (you can migrate to nodes that aren't in your cluster) - it just took a very long time to complete and I was hoping not to have to do that again to create the new cluster.
 

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!