Cloud Init user data script field

ultrasive

New Member
Oct 16, 2024
4
0
1
With using the Linux cloud-init settings is there any way to add another input field for a user data script so that I dont have to boot a VM and run the commands i need to install a few applications before turning it into a replicatable template because many of the cloud-init features only work on first boot otherwise you have to reset the cloud init.

I'm also a developer familiar with perl and js so I can probably make a pull request to insert multi line scripts into traditional cloud-init nocloud user-data or cloudbase-init systems. If thats something I can compromise on in order to have this as a feature I'm willing however I know a lot of commercial software denies all pull requests from third parties.
 
Hi @ultrasive , PVE allows you to specify arbitrary complex Cloud Init file via "cicustom".
If you insist on submitting code changes, you need to discuss this on PVE developer list, followed by the Developer agreement steps and then submit your patches.

https://www.proxmox.com/en/downloads/proxmox-virtual-environment/agreements
https://lists.proxmox.com/pipermail/pve-devel/

That said, the product already provides a stable way to do what you want (via custom CI). Your time will likely be better spent enhancing other parts of the product.

Good luck



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
PVE allows you to specify arbitrary complex Cloud Init file via "cicustom".
The thing is I just desire something simple in the UI to inject a script similar to how it would for cipassword into the predefined user-data file, if i have to go through the process of creating a disk to attach a datasource each time and create a new one for every one of my scripts that differ for each VM it would be much more painstakingly verbose.
 
if i have to go through the process of creating a disk to attach a datasource each time
An ISO gets generated with or without cicustom. Thats how standard/built-in CI is fed to the VM.
reate a new one for every one of my scripts that differ for each VM it would be much more painstakingly verbose.
You can use QEMU agent to inject a script, or prepare your template to fetch a script from external HTTP location.

If you'd like to extend existing PVE functionality - go for it. I already pointed out the resources you should get familiar with if you intended to submit your work for inclusion.
To be frank, your needs sound like a very niche use case which has already been solved in multiple ways.
If I were you, I'd start with PVE devel list - clearly state your case, how you would solve it, why you think this needs to change and how it will benefit the product overall.

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

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!