From: Dirk Nehring <dnehring@marcant.net>
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 [thread overview]
Message-ID: <20261124200340.380381-1-dnehring@marcant.net> (raw)
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
next reply other threads:[~2026-11-24 20:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 20:03 Dirk Nehring [this message]
2026-11-26 18:39 ` [RFC] storage: SAN LUN view treats LUNs of third-party plugins as unused, so they can be wiped Ciro Iriarte
2026-11-27 18:30 ` Thomas Lamprecht
-- strict thread matches above, loose matches on Subject: below --
2026-11-27 8:27 Mohamed ALLOUACHE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124200340.380381-1-dnehring@marcant.net \
--to=dnehring@marcant.net \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox