cloud-init user data for containers?

tok1

Member
May 3, 2020
12
5
23
55
Hi,

I had great success with using cloud-init enabled images (specifically Ubuntu minimal cloud images) for virtual machines and custom user data (cicustom and own YAML) to tailor my deployments, using the Wiki guide.

However, how is it possible to use the cloud-init approach for Proxmox containers? For example, I want/need containers prepared for further Ansible treatment (same I do with VMs) and therefore want to deploy a specific user+key, including sudo rule, and ideally some package prep.

I could not find anything in the admin docs nor in the pct manpage, so I'd appreciate any hint.

Regards, tok1
 
Hi,

For containers, this extra step with ansible is not necessary.
You can use 'pct push <vmid> <file> <destination>' to copy files to the container and "pct exec" to run commands in the container.
 
  • Like
Reactions: tok1
Thanks, wolfgang! Good to know, yet having "the same" approach in both worlds (i.e. cloud-init user data) would've been nice. ;)

Regards
 
I agree, this would be a great feature, in fact, LXD has this option available. The cloud-init configuration works with both vms and containers.
 

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!