From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id AE3AF1FF066 for ; Tue, 24 Nov 2026 21:04:05 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B16F121520; Tue, 24 Nov 2026 21:04:01 +0100 (CET) ARC-Authentication-Results: i=1; mx-gate39-hz2.hornetsecurity.com 1; spf=pass reason=mailfrom (ip=217.14.160.69, headerfrom=marcant.net) smtp.mailfrom=marcant.net smtp.helo=rossini.marcant.net; dkim=pass header.d=marcant.net header.s=gandalf header.a=rsa-sha256; dmarc=pass header.from=marcant.net orig.disposition=pass ARC-Message-Signature: a=rsa-sha256; bh=DG0rIy0ANhgHLWcVb2mnQPlIilrPGHpz0eaWsI12FmQ=; c=relaxed/relaxed; d=hornetsecurity.com; h=from:to:date:subject:mime-version; i=1; s=hse1; t=1795550624; b=ZjQrab2o0YWOVsZRYWIb0j9Bbc882i4fKjHWLgBHCWjldLU+OmYuAeDeyqp22BlOJyvsg2sc biUfB3bNcrp9f8ELRJ8iitTPczpxGRef4u0rVY2zgSsk0O7w9nAGhH68zfs/IRW8G8FjvPySdn5 uJf5/6W25kulZw7nNt/Q1ODu4Y+Jyv7QQnajX8yDlPpmmdkiDE0ULY9OUY8ZO3uwo063gM756QU wcDpKL+o0PCzJs7Rv9H7l8KNjdp2H/5TSLJcM7EEdDvyYAFcy+B7QNp5rOPfQ81jxTvn1RbFZcF VvfWo8sf9D3eqMl0ClIsA0Y/BkA/vSYBVN2qQiZN37NHA== ARC-Seal: a=rsa-sha256; cv=none; d=hornetsecurity.com; i=1; s=hse1; t=1795550624; b=RoK8T1YpIMsjaikJ3GJEbCyOpSLs3C5WwngCXhZsWLXS8OFJUyc7rzuc+2vZ92KFpy3sahXa 86ytv49Udi3fS+w7jRiFT7pWH3U6hxA9cA7CjftBpKnZpKtJvHdzrlOkfDkuFaWc2HVuWuo70Na VOBgIwFDGuYgqYL3vqN8KOrgBwh+MZJPDYH5e/ekkz7UwP8+YiVB8qmvpSDEMCXQj0EnVd0Q7Ih ij20XoZhurACsNcxippRqjayjaGDz0XNJVa5Dyl+N18rrJskidEdhlyLXV+P6pXiEaxe5+xbEdB /tekKkQc9p239Rnid09YmvTedt7FQu8dZrACcdMh5+LRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marcant.net; s=gandalf; t=1795550620; bh=DG0rIy0ANhgHLWcVb2mnQPlIilrPGHpz0eaWsI12FmQ=; h=From:To:Subject:Date:From; b=eWORlqZXow64yJtJCVRZqIuxqQegA4gKRQHRzAQEV1Hf8WqXvCIOPB8I+yK5i4t2E ervU0aXw4BLYl+QswUwskNN05EGpZecfzNcuKK/l9SRHjDEFkN2h2ZA05lMSlsoPMH 46Xdm9kG7gVzaLnofjfPf+zPHoAD564t6P9Y0Ms8= From: Dirk Nehring To: pve-devel@lists.proxmox.com Subject: [RFC] storage: SAN LUN view treats LUNs of third-party plugins as unused, so they can be wiped Date: Tue, 24 Nov 2026 21:03:40 +0100 Message-ID: <20261124200340.380381-1-dnehring@marcant.net> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-cloud-security-sender: dnehring@marcant.net X-cloud-security-recipient: pve-devel@lists.proxmox.com X-cloud-security-Mailarchiv: E-Mail archived for: dnehring@marcant.net X-cloud-security-Mailarchivtype: outbound X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mx-gate39-hz2 with 4jYtzc67LKz2BfLx X-cloud-security-connect: rossini.marcant.net[217.14.160.69], TLS=1, IP=217.14.160.69 X-cloud-security-Digest: 1bc5a219d0df55159e769640279861db X-cloud-security: scantime:1.529 DKIM-Signature: a=rsa-sha256; bh=DG0rIy0ANhgHLWcVb2mnQPlIilrPGHpz0eaWsI12FmQ=; c=relaxed/relaxed; d=marcant.net; h=content-type:mime-version:subject:from:to:message-id:date; s=hse1; t=1795550623; v=1; b=YYy1rC1HJAinPFVmLv/mz3bTky+5xpdPntv8T9pJx9STe78E7nxTqHBlMZ7JMw6ZVDr+PEv2 6SJGw/ks/D6zPxSARF2+lrCs04OgtmSA2HJdtRyivBcZe2g5mnFAdrFCUO3ROQ94TbBmJ9+ujAa Y5DqeTOXfACrc5K1r6Qx9p3HqtNfBRxY33T3qCigLwkruGExDQyzzlNZWNwtTEGqqBdWGOVjgMg LZUyBSoMqhJfcqJcIyoC5fqPFp5L2YVgvgH1xVAQkok1rWV8I+I9bNYwtgL9BASzZfLLe1a8bxi VXgtm7WVH8YZnY+97unqBwFBXUXkN+fs00z/BprzzoAkw== X-SPAM-LEVEL: Spam detection results: 0 AWL -0.351 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_HOSTKARMA_W -2.5 Sender listed in HOSTKARMA-WHITE RCVD_IN_MSPIKE_H5 0.001 Excellent reputation (+5) RCVD_IN_MSPIKE_WL 0.001 Mailspike good senders SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record WEIRD_PORT 0.001 Uses non-standard port number for HTTP Message-ID-Hash: 25IOUEQKQFNXLC3UIYEPID7MW674MSG5 X-Message-ID-Hash: 25IOUEQKQFNXLC3UIYEPID7MW674MSG5 X-MailFrom: prvs=078124c58a=dnehring@marcant.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, reading the new SAN code in pve-storage (git 2c98567, 9.1.24), I think it can wipe the disk of a running guest when the disk is a LUN of a third-party storage plugin. I have not tested it yet: the packages are not in the repositories yet, so this is from the code only. Our plugin (NetApp ONTAP, iSCSI/FC/NVMe-TCP) gives every guest disk its own LUN or namespace. It maps that LUN to one igroup that holds every node of the cluster, so each node sees each LUN all the time, as a dm-multipath map (WWID 3600a0980...) or as a namespace of one subsystem. The TrueNAS plugin works the same way. The storage section of such a plugin has none of the keys the new code looks for: there is no `target`, `vgname`, `base` or nvmeof `subsysnqn`. What the new code does with such a LUN: - PVE::Storage::SAN::scan_luns() takes the owner of a LUN only from `base`, `vgname`, `target` (when the storage serves images) or the `subsysnqn` of an nvmeof storage. A LUN of a third-party plugin therefore has no `used-by-storage`. Its usage stays 'unused' unless a process on *this* node has it open. The comment in scan_luns() names third-party plugins as one way a guest uses a LUN, but the check that follows looks only at local openers and partitions. - wipe_lun() calls assert_lun_unreferenced(), which knows the same four keys, and then assert_lun_paths_unused(), which looks only at local openers, holders and mounts. LVMPlugin.pm:388 runs the same check before a volume group is created on a LUN. Scenario: VM 100 runs on node A with its disk on LUN X. On node B, LUN X is listed as unused under Node > SAN, because nothing on node B has it open. A wipe there passes every check and destroys the disk of the running guest. The same happens to every disk of a stopped VM, and on every node. The local opener check cannot fix this: the guest that uses the LUN runs on another node, or does not run at all. Nothing in the storage config tells core which LUNs a third-party plugin owns. Only the plugin knows. Proposal: an optional plugin method that core asks for every enabled storage of a plugin that implements it, in scan_luns() and in assert_lun_unreferenced(). For example: # Returns true if this storage owns the LUN or namespace. # $lun: the WWID, and when known the iSCSI target or NVMe subsystem. sub san_lun_owned { my ($class, $storeid, $scfg, $lun) = @_; ... } or a list form, so that scan_luns() needs one call per storage and not one per LUN: # WWIDs (SCSI) and namespace IDs (NVMe) of the volumes on this storage. sub san_volumes { my ($class, $storeid, $scfg) = @_; ... } A die in the method should count as "owned", so that an unreachable array never makes its LUNs wipeable. Until plugins implement the method, a warning in the wipe and VG dialogs would already help: a LUN without an owner can still belong to a third-party storage that core cannot see. Our plugin can answer either form from data it already caches, and we would implement the method and test it on our clusters once there is an interface. If I misread the code and there is already a way for a plugin to claim its LUNs, I would be glad to hear it. Thanks, Dirk Nehring MARCANT AG