"Reinstall LXC template" feature (I may be able to code it)

cosmicdan

New Member
Jul 8, 2017
5
0
1
37
Hi,

I have an interest in providing linux containers to other users, restricting their access only to what they need to manage their owned container(s). To my surprise I have found one glaring hole in the feature-set - an ability to reinstall the OS for a given container. Looking at the API and user privileges, the closest thing to this is deleting and recreating the container but that can't be restrained to any useful scope e.g. allow a user to only "own" a limited number of CT's (they cannot create more than that number).

I haven't worked on PHP or JS for about a decade and have barely touched the Perl language (I am a Java and C# developer by trade) but I'd be willing to dive in and try to take a crack at adding a button and privilege for reinstalling an LXC template on an existing container. I can't imagine it being that difficult; most of it would be copypasta from other parts of the UI. Behind the scenes it would just delete and recreate, since lxc itself doesn't seem to support "recreating" a container alone.

So before I went ahead, I thought I'd ask if there's any objections to this. I'll have to spend some time finding and reading the relevant code and other research - any pointers in the right direction to anything possibly useful would be appreciated.

I do have one direct question so far. On the dev environment setup doc there are hashes/pound symbols (#'s) before some of the projects listed as required. I am guessing these are either optional or obsolete? If so, do I need any of them for working with PVE5?

As I said I am not a web (or even Linux) developer by profession so I apologize if any of my questions are relatively elementary or tedious to answer. Thanks!
 
Last edited:
Pls follow https://pve.proxmox.com/wiki/Developer_Documentation

Personally I do not see a big use case for such a feature.

I am aware of the wiki article, I was asking about the commented-out git projects in the README though. Nevermind, guess I'll try it all out and see.

Interesting you feel that way, it prevents everyone but node administrators from resetting a container - something which is standard if you remotely manage a server (FYI I am setting up a system where people can safely "play" with Linux and I expect broken containers to occur regularly - thus am wanting a mechanism for users to start-over). Considering LXC is quickly becoming a more attractive solution than traditional hypervisors I'd have thought it would be more sought after.

I'm actually surprised that there isn't any existing requests for such a feature already, but that does indeed support your statement.

Does this mean that I needn't bother submitting a patch for such a feature as it probably won't be merged?
 
Please follow the wiki link, especially the part telling that all dev related questions should be discussed on the pve-devel mailing list.
 
Please follow the wiki link, especially the part telling that all dev related questions should be discussed on the pve-devel mailing list.

Oh, apologies. Consider this issue closed then. Thanks.
 
Personally I do not see a big use case for such a feature.

I stumbled on this a few times: It's for people, that make mistakes :-D
A simple mistake and you have to copy&past IP, MAC, Router, etc. to a file, delete the container, recreate the container with the previously stored values. After the second time you needed this, you wish for a "reinstall" feature.

Due to the lack thereof, I almost automatically snapshot the VM (if on ZFS) after provisioning, a reinstall would be a big plus.
 
I stumbled on this a few times: It's for people, that make mistakes :-D
A simple mistake and you have to copy&past IP, MAC, Router, etc. to a file, delete the container, recreate the container with the previously stored values. After the second time you needed this, you wish for a "reinstall" feature.

Due to the lack thereof, I almost automatically snapshot the VM (if on ZFS) after provisioning, a reinstall would be a big plus.

It would be useful for Proxmox to function like a control panel for clients of unmanaged servers, that reason is good enough. The idea was rejected by the developers though. I guess the Proxmox web GUI is not intended to be this kind of software (or they want to separate themselves from providing re-seller oriented functions). At least for the moment.

No matter - after learning more about the Proxmox API I realized it's better idea to design a control panel from scratch to suit my needs - there's lots of other things in the Web UI that are not at all optimal for non-administrator users.

For cases like yours, just making a backup of the container after a fresh install is good enough, really.
 
This is certainly a feature I've missed in Proxmox. It would be great when experimenting with installs to be able to easily reset to a clean slate, without having to redo the configuration.
 
  • Like
Reactions: Europetrader

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!