]> git.proxmox.com Git - qemu-server.git/commitdiff
Partially-revert "cloudinit: add cloudinit section for current generated config"
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 Nov 2022 17:14:04 +0000 (18:14 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Nov 2022 17:17:07 +0000 (18:17 +0100)
This partially reverts commit 95a5135dad974c7eae249cf92b62b06fe911af33.
Particularly the unprotected write to the config when
generating the cloudinit file. We leave the rest as is for
now and update the callers to deal with the config later.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/QemuServer/Cloudinit.pm

index b616c7b9f51c6f963f6734de6d3c217f31c7c0de..f9bcbbcfc368fbc90f1225b96237e82b158ff9cc 100644 (file)
@@ -576,37 +576,6 @@ sub generate_cloudinitconfig {
 
        $generator->($conf, $vmid, $drive, $volname, $storeid);
     });
-
-    my $cloudinitconf = delete $conf->{cloudinit};
-    $cloudinitconf = {};
-
-    my @cloudinit_opts = keys %{PVE::QemuServer::cloudinit_config_properties()};
-    push @cloudinit_opts, 'name';
-
-    for my $opt (@cloudinit_opts) {
-
-       if ($opt =~ m/^ipconfig(\d+)/) {
-           my $netid = "net$1";
-           next if !defined($conf->{$netid});
-           $conf->{cloudinit}->{$netid} = $conf->{$netid};
-       }
-
-       $conf->{cloudinit}->{$opt} = $conf->{$opt} if $conf->{$opt};
-    }
-
-    $conf->{cloudinit}->{name} = "VM$vmid" if !$conf->{cloudinit}->{name};
-
-    for my $opt (keys %{$conf}) {
-       if (PVE::QemuServer::is_valid_drivename($opt)) {
-           my $drive = PVE::QemuServer::parse_drive($opt, $conf->{$opt});
-           if (PVE::QemuServer::drive_is_cloudinit($drive)) {
-               $conf->{cloudinit}->{$opt} = $conf->{$opt};
-           }
-       }
-    }
-
-    PVE::QemuConfig->write_config($vmid, $conf);
-
 }
 
 sub dump_cloudinit_config {