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 3F3377EC52 for ; Thu, 11 Nov 2021 13:57:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 279BDBB0C for ; Thu, 11 Nov 2021 13:57:26 +0100 (CET) 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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 7546FBB01 for ; Thu, 11 Nov 2021 13:57:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 355ED43038 for ; Thu, 11 Nov 2021 13:57:25 +0100 (CET) To: =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= , pve-devel@lists.proxmox.com References: <20211105130359.40803-1-f.gruenbichler@proxmox.com> <20211105130359.40803-22-f.gruenbichler@proxmox.com> <23b3c77c-e946-b7ae-c330-83ae7a451aae@proxmox.com> <1636629713.r0pg1k3q56.astroid@nora.none> From: Fabian Ebner Message-ID: <4c389a91-751d-2585-869e-2be1b42375e1@proxmox.com> Date: Thu, 11 Nov 2021 13:57:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <1636629713.r0pg1k3q56.astroid@nora.none> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 2.198 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 -3.999 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 09/10] migrate: add remote migration handling 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, 11 Nov 2021 12:57:56 -0000 Am 11.11.21 um 13:25 schrieb Fabian Grünbichler: > On November 10, 2021 12:17 pm, Fabian Ebner wrote: >> Am 05.11.21 um 14:03 schrieb Fabian Grünbichler: >>> >>> # set environment variable useful inside network script >>> - $ENV{PVE_MIGRATED_FROM} = $migratedfrom if $migratedfrom; >>> + if ($migrate_opts->{remote_node}) { >>> + $ENV{PVE_MIGRATED_FROM} = $migrate_opts->{remote_node}; >>> + } elsif ($migratedfrom) { >>> + $ENV{PVE_MIGRATED_FROM} = $migratedfrom; >>> + } >> >> But the network script tries to load the config from that node and if >> it's not in the cluster that doesn't work? >> > > this is a bit confusing, yeah. > > $migratedfrom contains the source node, which is unusable on the remote > cluster > remote_node contains the target node, which actually has the full config > when we start the VM there over the tunnel (in contrast to a local > migration, where the target node doesn't yet have the config!) > > so this should be correct? but even easier would be to just not set it > (for remote migrations), since the start MUST happen on the node where > mtunnel is running/the config is located. Yes, sorry, I think I might've misread the code yesterday ;) > >>> >>> PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'pre-start', 1); >>> >>> @@ -5621,7 +5625,7 @@ sub vm_start_nolock { >>> >>> my $migrate_storage_uri; >>> # nbd_protocol_version > 0 for unix socket support >>> - if ($nbd_protocol_version > 0 && $migration_type eq 'secure') { >>> + if ($nbd_protocol_version > 0 && ($migration_type eq 'secure' || $migration_type eq 'websocket')) { >>> my $socket_path = "/run/qemu-server/$vmid\_nbd.migrate"; >>> mon_cmd($vmid, "nbd-server-start", addr => { type => 'unix', data => { path => $socket_path } } ); >>> $migrate_storage_uri = "nbd:unix:$socket_path"; >>> >>