Any way to restore LXC container to original ID?

SamTzu

Renowned Member
Mar 27, 2009
525
17
83
Helsinki, Finland
sami.mattila.eu
Any way to restore LXC container to original ID?
I'm trying to "migrate" containers from one host to another host that has been upgraded.
When I try to restore the OpenVZ container with the original ID I get the error that ID is all ready in use on the other 3.x host that has not been yet upgraded to 4.x.
Any way to remove certain ID's from the new cluster database?
I could restore the dump with a new ID but I would prefer to keep the ID's the same.

Sam
 
The 3.X and 4.X host should not see each other VMs/Cts during that process so are you sure you have not already a VM/CT with that ID on your upgraded host?

As long as no such VM/CT with the ID existss on the NEW host it should be no problem to restore it with:

> pct restore ID ct-archive-file.tar.gz
 
I moved all containers to another host before upgrading the host so as to have minimal down time. That is why the "old" id's are hanging around in the new cluster database.
I managed to open the config.db (on the upgraded host) with sqlite database browser and delete the conf 112 line for VM 112 (after doing service pve-cluster stop first.)
That worked fine.
 
Ah OK I understand.

I managed to open the config.db (on the upgraded host) with sqlite database browser and delete the conf 112 line for VM 112 (after doing service pve-cluster stop first.)
Creative, but don't let such actions become the norm, it can also be risky to edit the "heart" of our cluster file system :)

But then also the config file should be on the host, if yes then you can simply delete it from /etc/pve the next time instead of opening config.db.
 

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!