all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] cloud-init: don't regenerate ssh hosts key on config change when vm is running
@ 2021-01-13  9:01 Alexandre Derumier
  2021-01-13 11:26 ` Mira Limbeck
  2021-01-13 16:40 ` Gilles Pietri
  0 siblings, 2 replies; 6+ messages in thread
From: Alexandre Derumier @ 2021-01-13  9:01 UTC (permalink / raw)
  To: pve-devel

Currently, we always regenerate sshkeys on any config change.

It should be done only before the first vm start, but currently can't known that.

So, this patch only do it when vm is running.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 PVE/QemuServer/Cloudinit.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index 52a4203..dd643c1 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -135,6 +135,8 @@ sub cloudinit_userdata {
 	    $content .= "  - $k\n";
 	}
     }
+    $content .= "ssh_deletekeys: false\n" if PVE::QemuServer::check_running($vmid);
+
     $content .= "chpasswd:\n";
     $content .= "  expire: False\n";
 
-- 
2.20.1




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

end of thread, other threads:[~2021-01-15 11:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  9:01 [pve-devel] [PATCH qemu-server] cloud-init: don't regenerate ssh hosts key on config change when vm is running Alexandre Derumier
2021-01-13 11:26 ` Mira Limbeck
2021-01-14 15:20   ` aderumier
2021-01-15 11:08     ` aderumier
2021-01-13 16:40 ` Gilles Pietri
2021-01-14  8:45   ` aderumier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal