[SOLVED] Cloud-init platform compatibility

societus

New Member
Feb 19, 2023
9
1
3
Hi there, I have a couple of old blade servers running Ubuntu Servers, that were my original hypervisors before I started moving into Proxmox. I was curious if the cloud-init settings that can be used allow for importing an existing, complete cloud-init yaml that worked on a standard KVM install?

I've read the cloud init guide at https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_cloud_init but one thing that was not really clear is whether I could just import the full existing cloud-init yaml from my existing server and have it work with 100% parity through Proxmox by adding it as a -cicustom

If I can do this, should I be importing it as vendor= or is there a more accurate way? If I can't import a full cloud-init, how would I be able to integrate the import of multiple wireguard configs (hybrid cloud web servers) and connection at startup using tools available with PVE's implementation?

Many thanks in advance, I have been putting off migrating these last VMs but the metal they run on are going to be donated soon, and would rather not fiddle with getting the minimal image ubuntu setup that has worked for years and risk having to rebuild a template up from scratch.
 
It depends on what you've configured.
If everything in those files can be configured at setup time, then `vendor` would probably the right one.

If you're mixing different things (User settings, Network settings) you'll have to split up your yaml file into multiple ones and add those via the corresponding cicustom parameter.
 
Just wanted to pass along my findings so far, and how I ultimately resolved the scenario. I tried using the yaml as a user= cicustom, and tried splitting the relevant sections up and loading them individually. It seemed like the only sections that did nothing regardless how they were set up are under the "write_files" block. Regardless if I rewrite the original import of the wireguard configuration file loaded by cloud-init from its original base64 hash into the proper yaml format under content: | , those blocks never get imported to the running OS.

I tried to go old school and build it up using a preseed and bootstrap type setup, which got in the way of the cloud-init but mostly worked.

In the end, I took what was working, and snapshot+cloned to a new VM in proxmox, then setup the wireguard tunnel and systemd config, and made a new template. That way, even though the cloud image is immutable, it is stuck at my desired config and nothing that worked in the cloud-init could break it since it won't overwrite the config files.

Thanks for the pointers, I am pretty sure part of my problem stems from having a VM that has gradually been upgraded from ubuntu 18 to current, and that was even before I moved into Proxmox. At some point, I will probably just start over on a fresh VM, no cloud images,