mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-10 14:06:39 +00:00
Partially-revert "cloudinit: add cloudinit section for current generated config"
This partially reverts commit 95a5135dad
.
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>
This commit is contained in:
parent
3de134ef4a
commit
0337d531a0
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user