]> git.proxmox.com Git - qemu-server.git/commitdiff
write config: only write out special cloudinit config if the vm has it
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Nov 2022 11:50:29 +0000 (12:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Nov 2022 11:50:58 +0000 (12:50 +0100)
this is only for the current in use CI stuff, not the actual cloud
init config itself.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 3db73c8df717bf1ea19e7e86c6782aeafc72b54b..759f36231a47cda60b819118c28299392d87ccd8 100644 (file)
@@ -2609,7 +2609,7 @@ sub write_vm_config {
        $raw .= &$generate_raw_config($conf->{pending}, 1);
     }
 
-    if (scalar(keys %{$conf->{cloudinit}})){
+    if (scalar(keys %{$conf->{cloudinit}}) && PVE::QemuConfig->has_cloudinit($conf)){
        $raw .= "\n[special:cloudinit]\n";
        $raw .= &$generate_raw_config($conf->{cloudinit});
     }