public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH qemu-server] cloud-init: don't regenerate ssh hosts key on config change when vm is running
Date: Wed, 13 Jan 2021 12:26:28 +0100	[thread overview]
Message-ID: <f67fb47b-a902-0fbe-49d3-52c43dd58476@proxmox.com> (raw)
In-Reply-To: <20210113090132.3889308-1-aderumier@odiso.com>

We could add vendor data and put the ssh keys there:

https://cloudinit.readthedocs.io/en/latest/topics/vendordata.html


On 1/13/21 10:01 AM, Alexandre Derumier wrote:
> 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";
>   




  reply	other threads:[~2021-01-13 11:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  9:01 Alexandre Derumier
2021-01-13 11:26 ` Mira Limbeck [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f67fb47b-a902-0fbe-49d3-52c43dd58476@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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