Start LXC on demand

popallo

Well-Known Member
Jul 2, 2019
36
6
48
France
apacher.eu
Hello everyone and sorry if this has already been requested on this forum (I did not find or not searched with the right keywords maybe).

I was wondering if, on any chance, it would be possible to start a container (lxc) on demand, much like what is done on some aws instances.

Basically, a container hosts content, it is turned off (because not in use), someone queries the url (http / https) which normally points to this container and this container starts for a certain period of time.

My wish is there but I have absolutely no idea if it is possible and if so how to do it :).

Thank you in advance for your ideas on this :)
 
hi,

I was wondering if, on any chance, it would be possible to start a container (lxc) on demand, much like what is done on some aws instances.
it is doable, but you would need to give your users API access (maybe with an API token [0]) and the necessary permissions on the container [1].

i'd suggest you to take a look at our API [2] [3]. in your case the most interesting endpoints will probably be:
Code:
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc/{vmid}
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc/{vmid}/status

hope this helps!

[0]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens
[1]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_permission_management
[2]: https://pve.proxmox.com/pve-docs/api-viewer/index.html
[3]: https://pve.proxmox.com/wiki/Proxmox_VE_API
 
  • Like
Reactions: popallo
ok thanks for the quick reply and the i will look at immediately.
I will come and give feedback if I find something to do with what I want to do, with example.

Thank you very much :)
 

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!