public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v7 1/7] pending changes: allow skipping cloud-init
Date: Thu, 17 Nov 2022 14:33:40 +0100	[thread overview]
Message-ID: <20221117133346.737686-5-f.gruenbichler@proxmox.com> (raw)
In-Reply-To: <20221117133346.737686-1-f.gruenbichler@proxmox.com>

in case of remote migration, we use the `update_vm_api` helper for
checking permissions on the incoming config. this would also cause an
incoming cloud-init image to be overwritten, since the VM is not running
yet at this point.

provide a parameter which can be set by an incoming *remote* migration
to avoid having inconsistent cloud init images on the source and target
side.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---

Notes:
    new in v7

 PVE/QemuServer.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index dd3d3512..dea5f251 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5193,7 +5193,7 @@ sub vmconfig_delete_or_detach_drive {
 
 
 sub vmconfig_apply_pending {
-    my ($vmid, $conf, $storecfg, $errors) = @_;
+    my ($vmid, $conf, $storecfg, $errors, $skip_cloud_init) = @_;
 
     return if !scalar(keys %{$conf->{pending}});
 
@@ -5226,7 +5226,7 @@ sub vmconfig_apply_pending {
 
     PVE::QemuConfig->cleanup_pending($conf);
 
-    my $generate_cloudnit = undef;
+    my $generate_cloudnit = $skip_cloud_init ? 0 : undef;
 
     foreach my $opt (keys %{$conf->{pending}}) { # add/change
 	next if $opt eq 'delete'; # just to be sure
@@ -5241,7 +5241,7 @@ sub vmconfig_apply_pending {
 
 	    if (is_valid_drivename($opt)) {
 		my $drive = parse_drive($opt, $conf->{pending}->{$opt});
-		$generate_cloudnit = 1 if drive_is_cloudinit($drive);
+		$generate_cloudnit //= 1 if drive_is_cloudinit($drive);
 	    }
 
 	    $conf->{$opt} = delete $conf->{pending}->{$opt};
-- 
2.30.2





  parent reply	other threads:[~2022-11-17 13:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 13:33 [pve-devel] [PATCH-series container/qemu-server v7 0/10] remote migration Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH container v7 1/3] migration: add " Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH container v7 2/3] pct: add 'remote-migrate' command Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH container v7 3/3] migrate: print mapped volume in error Fabian Grünbichler
2022-11-17 13:33 ` Fabian Grünbichler [this message]
2022-11-17 13:33 ` [pve-devel] [PATCH qemu-server v7 2/7] pending: fix typo in variable name Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH qemu-server v7 3/7] mtunnel: add API endpoints Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH qemu-server v7 4/7] migrate: refactor remote VM/tunnel start Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH qemu-server v7 5/7] migrate: add remote migration handling Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH qemu-server v7 6/7] api: add remote migrate endpoint Fabian Grünbichler
2022-11-17 13:33 ` [pve-devel] [PATCH qemu-server v7 7/7] qm: add remote-migrate command Fabian Grünbichler
2022-11-17 13:39 ` [pve-devel] [PATCH-series container/qemu-server v7 0/10] remote migration Fabian Grünbichler
2022-11-17 14:23 ` [pve-devel] applied-series: " Thomas Lamprecht

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=20221117133346.737686-5-f.gruenbichler@proxmox.com \
    --to=f.gruenbichler@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