Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Idea: LXC / VM ID Changer for Proxmox #7961

SunFlowerOwl started this conversation in Ideas
Discussion options

Idea: LXC / VM ID Changer for Proxmox

An interesting idea for Proxmox helper-scripts would be a tool to change the ID of an LXC container or a VM. Currently, there’s no straightforward way to rename IDs without manually editing configuration files and storage paths, which can be risky and error-prone.

Features this script could include:

  • Automate ID changes for both LXCs and VMs
  • Check for conflicts with existing IDs before making changes
  • Automatically update storage paths and configuration references

Benefits:

  • Reorganize a lab or production environment
  • Standardize container and VM numbering
  • Avoid ID conflicts during migrations or cloning
You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

I have an private Script for this, but its not easy. I think it causes more problems than it helps.

You must be logged in to vote
3 replies
Comment options

I dont want to be liable if such a script messes things up tbh.

Comment options

I have an private Script for this, but its not easy. I think it causes more problems than it helps.

Oh, ok. Basically I was trying something like this:

  • Clone the LXC with the new ID and stop it

  • Copy the original last_id.conf to /tmp/new_id.conf and replace the disk reference with the new LXC one

  • Replace /etc/lxc/new_id.conf with /tmp/new_id.conf

  • Restsart the lxc

But I ran into issues when cloning, because it couldn’t handle my mounted point...

Maybe there are other issues too, but one possible approach would be to remove all custom definitions in the lxc.conf before applying this procedure, and then restore them afterward.

What do you think about this procedure?

Finally, to be safe, we could also keep the last LXC with the old ID so the user can verify that the new container is fully working before removing it manually.

Comment options

Could you possibly share your script so I can use at my own risk? I have been wanting to write a script like this for awhile now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /