[pve-devel] [PATCH qemu-server 2/2] cloudinit: restore previous default for package upgrades

Fiona Ebner f.ebner at proxmox.com
Wed Jun 21 12:04:32 CEST 2023


Commit efa3355d ("fix #3428: cloudinit: add parameter for upgrade on
boot") changed the default, but this is a breaking change. The bug
report was only about making the option configurable.

The commit doesn't give an explicit reason for why, and arguably,
doing the upgrade is not an issue for most users. It also leads to a
different cloud-init instance ID, because of the different setting,
which in turn leads to ssh host key regeneration within the VM.

Reported-by: Friedrich Weber <f.weber at proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/QemuServer.pm           | 2 +-
 PVE/QemuServer/Cloudinit.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 91aab21c..c9c1936a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -786,7 +786,7 @@ my $confdesc_cloudinit = {
 	optional => 1,
 	type => 'boolean',
 	description => 'cloud-init: do an automatic package upgrade after the first boot.',
-	default => 0,
+	default => 1,
     },
     cicustom => {
 	optional => 1,
diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index cd5cc242..7449993a 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -148,7 +148,7 @@ sub cloudinit_userdata {
 	$content .= "  - default\n";
     }
 
-    $content .= "package_upgrade: true\n" if $conf->{ciupgrade};
+    $content .= "package_upgrade: true\n" if !defined($conf->{ciupgrade}) || $conf->{ciupgrade};
 
     return $content;
 }
-- 
2.39.2






More information about the pve-devel mailing list