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 49C058AB9D for ; Fri, 19 Aug 2022 17:01:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 26B751BC7D for ; Fri, 19 Aug 2022 17:01:24 +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 for ; Fri, 19 Aug 2022 17:01:22 +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 9387443CED for ; Fri, 19 Aug 2022 17:01:22 +0200 (CEST) From: Aaron Lauterer To: pve-devel@lists.proxmox.com Date: Fri, 19 Aug 2022 17:01:18 +0200 Message-Id: <20220819150121.1633021-1-a.lauterer@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.015 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lvmthin.pm, lvm.pm, zfs.pm, diskmanage.pm, config.pm, directory.pm] Subject: [pve-devel] [PATCH storage v3 0/3] disks: add checks, allow add_storage on other nodes 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: Fri, 19 Aug 2022 15:01:54 -0000 This series deals mainly with 2 things, adding more checks prior to actually setting up a new local storage to avoid leaving behind half provisioned disks in case a storage (lvm, zfs, ...) of the same name already exists. Secondly, to change the behavior regarding the "Add Storage" flag. It allows to keep in enabled and will create the local storage and add the node to the nodes list of the PVE storage config if there already exists one in the cluster. The first patch is a prerequisite to be able to check if a mount path for the Directory storage type is already mounted. The second patch implements the actual checks. The third patch adds the changed behavior for the "Add Storage" part. More in the actual patches. changes since v2: - add comments about return value - moved VGs checks into worker - moved storage parameter checks into create_or_update with dry run option v1: - recommended changes by Dominik & Fabian E - some lines were in the wrong patches due to some mistakes during reordering the patches Aaron Lauterer (3): diskmanage: add mounted_paths disks: die if storage name is already in use disks: allow add_storage for already configured local storage PVE/API2/Disks/Directory.pm | 49 +++++++++++----- PVE/API2/Disks/LVM.pm | 39 +++++++++---- PVE/API2/Disks/LVMThin.pm | 40 +++++++++---- PVE/API2/Disks/ZFS.pm | 113 ++++++++++++++++++++++-------------- PVE/API2/Storage/Config.pm | 51 ++++++++++++++++ PVE/Diskmanage.pm | 13 +++++ 6 files changed, 224 insertions(+), 81 deletions(-) -- 2.30.2