Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't see anything on cloud-init (did I miss some link?) while it works perfectly in Proxmox, see https://pve.proxmox.com/wiki/Cloud-Init_Support


It works, but anytime you have custom networking or more complex cloud-init configs, you'll have to go into "snippets" territory or referring to files in a local filesystem of the host. They don't have API support for making snippets the last time I checked. Where I ran into this was when trying to set up hosts with Terraform on Proxmox VE (which works well itself too).


The best way to handle this (which is really terrible, honestly, but it works) is to make configdrive2 ISOs locally, and upload those using the API. That is, don't give Proxmox a cloud-init snippet, but rather a fully-built cloud-init ISO. This is basically bypassing/reimplementing Proxmox's cloud-init features yourself, which is terrible. But it works really well.

There's a pretty neat Proxmox API library written in Go that can do this all for you: https://github.com/luthermonson/go-proxmox

There's a Terraform plugin planned, as well. Not sure what the status on it is, currently.

I also am slowly working on my own Proxmox CLI, consuming the go-proxmox library: https://github.com/perchnet/gomox

But unfortunately I don't have much software engineering experience, so it's a very slow process... :)


Using cloudinit in proxmox is godsend. I can spin up a fresh linux vm and login with my ssh key (and ansible) in less than a minute.


exactly!

I try to do everything without Ansible: cloud-init is pretty powerful, too, but I am reaching the 64k limit, so sooner then later will go "back" to Ansible.


If you're already familiar with Ansible, what about doing some stuff with cloud-init and then having cloud-init trigger a local ansible run? Then you don't have to worry about running into the limit.


Although its supported, its not well documented enough to be a good way to learn about cloud-init in my experience. I tried configuring a K3's cluster across three proxmox nodes via cloud-init to get some exposure to it and eventually gave up and just configured them manually


I had the same issue at the beginning, and unfortunately stopped on it for over a year: then I went back and got it and now I cannot think of provisioning a VM by hand anymore

Have a look at this script for example https://github.com/francescor/swarm/blob/main/create_swarm_v... which is the "proxmox" side of cloud-init, that then load an ordinary cloud-init https://github.com/francescor/swarm/blob/main/cloud-init/clo...


lol (looking at cloud init for ubuntu 22...)

  ...
  # remove snapd trash
  - snap remove lxd
  - snap remove core20
  - snap remove snapd
  - systemctl stop snapd.service
  - systemctl stop snapd.socket
  - systemctl stop snapd.seeded.service
  - systemctl disable snapd.service
  - systemctl disable snapd.socket
  - systemctl disable snapd.seeded.service
  - systemctl stop snapd.service
  - systemctl stop snapd.socket
  - systemctl stop snapd.seeded.service
  - rm -rf /var/cache/snapd/
  - apt autoremove --purge snapd -y
  - rm -rf /root/snap
  # remove apport trash
  ...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: