From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8141BE06D for ; Thu, 21 Apr 2022 09:44:44 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 77D4A1BCC6 for ; Thu, 21 Apr 2022 09:44:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 994561BCBD for ; Thu, 21 Apr 2022 09:44:43 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6C1BE4265F for ; Thu, 21 Apr 2022 09:44:43 +0200 (CEST) Message-ID: <29ca4b42-5260-ecb2-0a5d-858dbf6a4b93@proxmox.com> Date: Thu, 21 Apr 2022 09:44:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: pve-devel@lists.proxmox.com, =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= References: <20220318075123.5445-1-f.ebner@proxmox.com> <1650457969.m5c6lqzh1t.astroid@nora.none> From: Fabian Ebner In-Reply-To: <1650457969.m5c6lqzh1t.astroid@nora.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 2.141 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -4.099 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server] migrate: keep VM paused after migration if it was before X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 07:44:44 -0000 Am 20.04.22 um 14:43 schrieb Fabian Grünbichler: > On March 18, 2022 8:51 am, Fabian Ebner wrote: >> Also cannot issue a guest agent command in that case. >> >> Reported in the community forum: >> https://forum.proxmox.com/threads/106618 >> >> Signed-off-by: Fabian Ebner >> --- >> >> Best viewed with -w. >> >> PVE/QemuMigrate.pm | 54 ++++++++++++++++++++++++++-------------------- >> 1 file changed, 31 insertions(+), 23 deletions(-) > > patch looks good to me - it might make sense to restructure the > conditionals a bit to log that resuming/fstrim was skipped though to > reduce confusion (user that paused VM and user doing the migration might > not be the same entity after all)? > > one other thing I noticed (pre-existing, but the changes here made me > look and my search came up short), inside phase2: > > - start block job(s) without autocompletion and wait for them to > converge > - start RAM/state migration without autocompletion and wait for it to > converge > X both source and target VMs are paused now with "identical" state, > irrespective of the source being paused or not initially > - cancel block job(s) (to close NBD writer(s) so that switchover can > proceed in phase3_cleanup) > > if something happens after X in phase2, we enter phase2_cleanup, and > attempt to cancel the migration If migrate_cancel actually cancels the migration, the VM will be running on the source node again :) If migrate_cancel fails, resume might also fail? There is an edge case however: If migration actually finished, but we aborted because of e.g. too many query-migrate failures, then migrate_cancel will succeed (because there is no active migration) and the VM will be in post-migrate state on the source node. Here, resume would help. > , remove the lock, cancel the block jobs > again, clean up bitmaps, stop the target VM, clean up remote disks, tear > down the tunnel, and effectively exit the migration at that point BUT - > we don't handle the paused state? is there a resume source (with this > patch, guarded by source was not paused) missing or am I missing > something? >