cloud init: add comment regarding 3 MiB size limit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Mira Limbeck <m.limbeck@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-11-04 13:14:09 +01:00
parent 101beafe0d
commit 115cb432bc

View File

@ -235,6 +235,8 @@ sub generate_configdrive2 {
$meta_data = configdrive2_gen_metadata($user_data, $network_data); $meta_data = configdrive2_gen_metadata($user_data, $network_data);
} }
# we always allocate a 4MiB disk for cloudinit and with the overhead of the ISO
# make sure we always stay below it by keeping the sum of all files below 3 MiB
my $sum = length($user_data) + length($network_data) + length($meta_data) + length($vendor_data); my $sum = length($user_data) + length($network_data) + length($meta_data) + length($vendor_data);
die "Cloud-Init sum of snippets too big (> 3 MiB)\n" if $sum > (3 * 1024 * 1024); die "Cloud-Init sum of snippets too big (> 3 MiB)\n" if $sum > (3 * 1024 * 1024);
@ -489,6 +491,8 @@ sub generate_nocloud {
$meta_data = nocloud_gen_metadata($user_data, $network_data); $meta_data = nocloud_gen_metadata($user_data, $network_data);
} }
# we always allocate a 4MiB disk for cloudinit and with the overhead of the ISO
# make sure we always stay below it by keeping the sum of all files below 3 MiB
my $sum = length($user_data) + length($network_data) + length($meta_data) + length($vendor_data); my $sum = length($user_data) + length($network_data) + length($meta_data) + length($vendor_data);
die "Cloud-Init sum of snippets too big (> 3 MiB)\n" if $sum > (3 * 1024 * 1024); die "Cloud-Init sum of snippets too big (> 3 MiB)\n" if $sum > (3 * 1024 * 1024);