From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 600A71FF16F for ; Fri, 15 Nov 2024 16:35:18 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DFF7318E6D; Fri, 15 Nov 2024 16:35:19 +0100 (CET) From: Christian Ebner To: pve-devel@lists.proxmox.com Date: Fri, 15 Nov 2024 16:35:00 +0100 Message-Id: <20241115153500.307528-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.031 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH installer] install: zfs: rename pre-existing `rpool` also if in degraded state 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" If a subset of disks associated with a pre-existing ZFS pool are selected for installation, the pool might still be importable (required for the rename) but will be in a `degraded` state. Currently, only pools in `online` state will be considered for renameing, leading a possibly clashing pool named `rpool` behind. Therefore, a reboot after installation will fail because of the duplicate names. To partially fix this behaviour, also rename `rpool` in `degraded` state. Note: This however does not cover the case when a pool can no longer be imported because the number of required replicas is not available. Renaming by zpool import is not possible for that case. Partially-fixes: 43591049 ("low-level: install: check for already-existing `rpool` on install") Signed-off-by: Christian Ebner --- Proxmox/Install.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm index 2f9f28d..d409577 100644 --- a/Proxmox/Install.pm +++ b/Proxmox/Install.pm @@ -177,7 +177,10 @@ sub zfs_ask_existing_zpool_rename { my $exported_pools = Proxmox::Sys::ZFS::get_exported_pools(); foreach (@$exported_pools) { - next if $_->{name} ne $pool_name || $_->{state} ne 'ONLINE'; + # Pool will be in degraded state if a subset of the associated disks have been wiped by the + # installer, but the pool can still be imported (required for the rename). + next if $_->{name} ne $pool_name || + not ($_->{state} eq 'ONLINE' || $_->{state} eq 'DEGRADED'); my $renamed_pool = "$_->{name}-OLD-$_->{id}"; my $do_rename = Proxmox::Install::Config::get_existing_storage_auto_rename(); -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel