LXC containers, cloud-init, and hook scripts?

steevestroke

New Member
May 29, 2022
22
7
3
Howdy, folks.

Can I get an affirm on this? Proxmox does not support cloud-init for LXC containers, correct? I'm looking at the API docs and they seem to suggest as much as the endpoints and parameters available on the QEMU VM API are not reflected on the container endpoints.

Also, I did some digging into hook scripts as possible alternative. The docs are a bit thin on this feature but it looks to me like hook scripts execute on the Proxmox server for various lifecycle events for both containers and VMs however they **do not** execute in the container or VM. They execute in VE itself. So this is not an escape hatch for lack of cloud-init in containers.

If I have all of this correct, how they do people do deploy-time adjustments to their containers? Most of the time, I would think, there are going to be deploy-time things that need to be adjusted which cannot be pre-baked into custom container images.

Very interested to hear what people have to share.
 
  • Like
Reactions: verbbis and lutian
Hmm...

I was hoping to be able to bootstrap these things from Terraform and so that would require the necessary pieces being available via the PVE API. I'll probably stick with VMs for now. Kinda disappointing.

Feels like I might have some luck running Nomad on PVE w/ Clients w/ nested virtualization and just coming at the container-y workloads that way.
 
I've since rotated to deploying Nomad control plane and workers on TrueNAS SCALE because the OpenTofu Provider is more complete for that platform. Nomad does have the ability to schedule LXC containers and so I may loop back to this at some point with Nomad spinning the Proxmox LXC containers. It looks like the options for post-deploy config/mutation are more flexible by having Nomad in the mix. Around the horn for sure but my need for LXC is rather limited and I do most of what I need with other container tech.
 

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!