public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server manager] cloudinit: make automatic upgrades toggleable
@ 2023-05-04 10:55 Leo Nunner
  2023-05-04 10:55 ` [pve-devel] [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot Leo Nunner
  2023-05-04 10:55 ` [pve-devel] [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades Leo Nunner
  0 siblings, 2 replies; 5+ messages in thread
From: Leo Nunner @ 2023-05-04 10:55 UTC (permalink / raw)
  To: pve-devel

Until now, we explicitly enabled "package_upgrade" in our generated
cloud-init configuration. This has been requested to be changed several
times, and it seems like making it toggleable will be the best choice.

qemu-server:

Leo Nunner (1):
  fix #3428: cloudinit: add parameter for upgrade on boot

 PVE/QemuServer.pm           | 5 +++++
 PVE/QemuServer/Cloudinit.pm | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

manager:

Leo Nunner (1):
  fix #3428: cloud-init: add toggle for automatic upgrades

 www/manager6/qemu/CloudInit.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

-- 
2.30.2





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot
  2023-05-04 10:55 [pve-devel] [PATCH qemu-server manager] cloudinit: make automatic upgrades toggleable Leo Nunner
@ 2023-05-04 10:55 ` Leo Nunner
  2023-06-07 16:27   ` [pve-devel] applied: " Thomas Lamprecht
  2023-05-04 10:55 ` [pve-devel] [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades Leo Nunner
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Nunner @ 2023-05-04 10:55 UTC (permalink / raw)
  To: pve-devel

up until now, we did an automatic upgrade after the first boot in our
standard cloud-init config. This has been requested to be toggleable
several times [1][2]. With this patch, "package_upgrade" is disabled by
default, and needs to be enabled manually, diverging from the previous
behaviour.

[1] https://forum.proxmox.com/threads/how-to-prevent-automatic-apt-upgrade-during-the-first-boot-with-cloud-init.68472/
[2] https://forum.proxmox.com/threads/cloud-init-ohne-package-upgrade.123841/

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
---
 PVE/QemuServer.pm           | 5 +++++
 PVE/QemuServer/Cloudinit.pm | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c1d0fd2..3317fc4 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -780,6 +780,11 @@ my $confdesc_cloudinit = {
 	    .' recommended. Use ssh keys instead. Also note that older cloud-init versions do not'
 	    .' support hashed passwords.',
     },
+    ciupgrade => {
+	optional => 1,
+	type => 'boolean',
+	description => 'cloud-init: do an automatic package upgrade after the first boot.'
+    },
     cicustom => {
 	optional => 1,
 	type => 'string',
diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index a0c3d60..10962b5 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -146,7 +146,7 @@ sub cloudinit_userdata {
 	$content .= "  - default\n";
     }
 
-    $content .= "package_upgrade: true\n";
+    $content .= "package_upgrade: true\n" if $conf->{ciupgrade};
 
     return $content;
 }
-- 
2.30.2





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades
  2023-05-04 10:55 [pve-devel] [PATCH qemu-server manager] cloudinit: make automatic upgrades toggleable Leo Nunner
  2023-05-04 10:55 ` [pve-devel] [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot Leo Nunner
@ 2023-05-04 10:55 ` Leo Nunner
  2023-06-07 16:27   ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Nunner @ 2023-05-04 10:55 UTC (permalink / raw)
  To: pve-devel

to control the newly introduced "ciupgrade" config parameter.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
---
 www/manager6/qemu/CloudInit.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index 77ff93d4..c9065a84 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -286,6 +286,24 @@ Ext.define('PVE.qemu.CloudInit', {
 		},
 		defaultValue: '',
 	    },
+	    ciupgrade: {
+		header: gettext('Upgrade packages'),
+		iconCls: 'fa fa-archive',
+		renderer: Proxmox.Utils.format_boolean,
+		defaultValue: '',
+		editor: {
+		    xtype: 'proxmoxWindowEdit',
+		    subject: gettext('Upgrade packages on boot'),
+		    items: {
+			xtype: 'proxmoxcheckbox',
+			name: 'ciupgrade',
+			uncheckedValue: 0,
+			defaultValue: 0,
+			fieldLabel: gettext('Upgrade packages'),
+			labelWidth: 140,
+		    },
+		},
+	    },
 	};
 	var i;
 	var ipconfig_renderer = function(value, md, record, ri, ci, store, pending) {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot
  2023-05-04 10:55 ` [pve-devel] [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot Leo Nunner
@ 2023-06-07 16:27   ` Thomas Lamprecht
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2023-06-07 16:27 UTC (permalink / raw)
  To: Proxmox VE development discussion, Leo Nunner

Am 04/05/2023 um 12:55 schrieb Leo Nunner:
> up until now, we did an automatic upgrade after the first boot in our
> standard cloud-init config. This has been requested to be toggleable
> several times [1][2]. With this patch, "package_upgrade" is disabled by
> default, and needs to be enabled manually, diverging from the previous
> behaviour.
> 
> [1] https://forum.proxmox.com/threads/how-to-prevent-automatic-apt-upgrade-during-the-first-boot-with-cloud-init.68472/
> [2] https://forum.proxmox.com/threads/cloud-init-ohne-package-upgrade.123841/
> 
> Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
> ---
>  PVE/QemuServer.pm           | 5 +++++
>  PVE/QemuServer/Cloudinit.pm | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
>

applied, thanks!

> diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
> index a0c3d60..10962b5 100644
> --- a/PVE/QemuServer/Cloudinit.pm
> +++ b/PVE/QemuServer/Cloudinit.pm
> @@ -146,7 +146,7 @@ sub cloudinit_userdata {
>  	$content .= "  - default\n";
>      }
>  
> -    $content .= "package_upgrade: true\n";
> +    $content .= "package_upgrade: true\n" if $conf->{ciupgrade};

should false get rather spelled out too? i.e., if CI changes the default here someday?

No hard feelings and can be easily followed-up though..

>  
>      return $content;
>  }




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pve-devel] applied: [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades
  2023-05-04 10:55 ` [pve-devel] [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades Leo Nunner
@ 2023-06-07 16:27   ` Thomas Lamprecht
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2023-06-07 16:27 UTC (permalink / raw)
  To: Proxmox VE development discussion, Leo Nunner

Am 04/05/2023 um 12:55 schrieb Leo Nunner:
> to control the newly introduced "ciupgrade" config parameter.
> 
> Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
> ---
>  www/manager6/qemu/CloudInit.js | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-07 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 10:55 [pve-devel] [PATCH qemu-server manager] cloudinit: make automatic upgrades toggleable Leo Nunner
2023-05-04 10:55 ` [pve-devel] [PATCH qemu-server] fix #3428: cloudinit: add parameter for upgrade on boot Leo Nunner
2023-06-07 16:27   ` [pve-devel] applied: " Thomas Lamprecht
2023-05-04 10:55 ` [pve-devel] [PATCH manager] fix #3428: cloud-init: add toggle for automatic upgrades Leo Nunner
2023-06-07 16:27   ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal