Better cloud-init support - ideas

muhaha

New Member
May 17, 2018
8
1
1
35
  1. Upload IMG (cloud-init image file) with API endpoint
  2. Import IMG as disk with API endpoint
  3. Upload snippet (cloud-init) to datastore with API endpoint
  4. Support for nocloud v2 to enable ens NIC names
  5. Use phone-home feature of cloud-init (https://cloudinit.readthedocs.io/en/latest/topics/modules.html#phone-home) to get done status of cloud-init provisioning available with API endpoint. Its also possible to check `cloud-init status --wait` or use /run/cloud-init/result.json or /run/cloud-init/status.json I guess, but this is probably available only for qemu guest agent which is not installed at provisioning time with read-file API endpoint

- I want to spin VM with API only ( more cloud native approach )
- I dont want to prepare own ISO with baked cloud-init ( very hard to do versioning of this ISO )
- I dont want to use ssh to do some hacks ( users will not have root access )

Any other ideas?


EDIT:
BTW, if I will use qemu/config endpoint everytime with same cipassword, it will be (probably)be always hashed differently, this will cause that cloud-init needs to regenerate ci image and VM must be restarted for applying changes.

EDIT2: Is there any API endpoint for Regenerate Image functionality ?
 
Last edited:
  • Like
Reactions: dermorz
I am sorry for necroing this old thread, but it looks like these questions/requirements are already a few years old. Has anything changed in that regard? Currently I am planning similar things as OP but I am also missing key functionalities for that.

After opting for VM template creation and cloning because importing cloud-images as disks is not really supported via API, I am now hitting the next wall: Uploading cloud-init snippets to a proxmox storage via API.

Is there a way to achieve the usage of one cloud-init snippet per created/cloned VM?

1. Clone VM
2. Resize to needs
3. Generate cloud-init yaml for this VM
4. Upload to storage
5. Set this cloud-init snippet as drive in cloned VM

It's not viable to have one cloud-init sipped used by many VMs, so pre-baking them into the template is not an option. Also manual upload via UI for each and every created VM is not an option (in auto scaling scenarios for example).

/Edit: I just found https://bugzilla.proxmox.com/show_bug.cgi?id=2208 and I am confused. It seems like the hold-back of snippet uploads via API is that snippets are not only used for cloud-init yaml files. So if there was a clear separation and uploaded snippets were somehow typed and only usable as cloud-image user data… would there still be security concerns against that? It seems (similar to iso/image upload) there are different things thrown in the same bucket here and this blur is blocking very useful features. :(
 
Last edited:

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!