[pve-devel] [PATCH 1/8 container] cloudinit: introduce config parameters

Fiona Ebner f.ebner at proxmox.com
Thu Feb 13 13:15:07 CET 2025


Am 10.02.25 um 13:07 schrieb Daniel Herzig:
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 5cc37f7..e3ed93b 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -450,6 +450,63 @@ my $features_desc = {
>      },
>  };
>  
> +my $cicustom_fmt = {
> +    user => {
> +	type => 'string',
> +	optional => 1,
> +	description => 'To pass a custom file containing all user data to the container via cloud-init.',
> +	format => 'pve-volume-id',
> +	format_description => 'volume',
> +    },
> +    vendor => {
> +	type => 'string',
> +	optional => 1,
> +	description => 'To pass a custom file containing all vendor data to the container via cloud-init.',
> +	format => 'pve-volume-id',
> +	format_description => 'volume',
> +    },
> +};
> +PVE::JSONSchema::register_format('pve-pct-cicustom', $cicustom_fmt);
> +
> +my $confdesc_cloudinit = {

Hmm, maybe we should rather move these into the Cloudinit module to
avoid bloating up the config module here. Then everything is collected
there.

>      },
>  };
>  
> +foreach my $key (keys %$confdesc_cloudinit) {
> +    $confdesc->{$key} = $confdesc_cloudinit->{$key};

And just access it here e.g. by declaring it as shared in the other module:

our $confdesc_cloudinit

> +}
> +
>  my $valid_lxc_conf_keys = {
>      'lxc.apparmor.profile' => 1,
>      'lxc.apparmor.allow_incomplete' => 1,





More information about the pve-devel mailing list