cloud-init user data for containers?

tok1

Member
May 3, 2020
12
6
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.