public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Ciro Iriarte <cyruspy@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Dirk Nehring <dnehring@marcant.net>, t.lamprecht@proxmox.com
Subject: Re: [RFC] storage: SAN LUN view treats LUNs of third-party plugins as unused, so they can be wiped
Date: Thu, 26 Nov 2026 15:39:25 -0300	[thread overview]
Message-ID: <20261126153925.sanlun-reply@cyruspy.gmail.com> (raw)
In-Reply-To: <20261124200340.380381-1-dnehring@marcant.net>

On 24/11/2026 21:03, Dirk Nehring wrote:
> 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 read SAN.pm on current master and came to the same conclusion.
scan_luns() sets used-by-storage only from base, vgname, target and
the nvmeof subsysnqn, and assert_lun_unreferenced() checks the same
keys. For anything else, the only protection is a writable opener on
the node doing the check.

I maintain pve-FCLUPlugin, which uses the same layout over Fibre
Channel: one array volume per guest disk, currently with a Hitachi
VSP driver. It is less exposed than an igroup with every node, because
it maps a volume only to the node that activates it and unmaps it on
deactivate. A LUN can still stay mapped on a node that no longer has
it open. If deactivate fails after a migration or backup, or a node
crashes or loses access to the array, the mapping stays in place until
cleaned up. On that node, the SAN view shows the disk as unused while
the guest runs elsewhere.

> 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) = @_; ... }

I prefer the list form. The plugin keeps a cluster-wide volume registry
in pmxcfs that already records each volume's device identity, so it can
answer without querying the array. That matters if the check runs when
the GUI lists LUNs. Volumes created for snapshots can be mapped as well,
so the list should cover every volume the plugin may map, not just
current images.

> A die in the method should count as "owned", so that an unreachable array
> never makes its LUNs wipeable.

Agreed. A related case is a storage whose plugin fails to load, since
core cannot query it either. Refusing a wipe whenever such a storage
is configured may be too strict, but the dialog could at least warn
about it. If that case matters enough, an alternative is for core to
keep the WWIDs itself, recorded by the plugin on alloc and free, so the
SAN view does not depend on the plugin being reachable at all.

If an interface like this is accepted, I'll implement it in
pve-FCLUPlugin and test it on our lab cluster (PVE 9.3, FC multipath),
including the stale mapping cases above.

Ciro



  reply	other threads:[~2026-11-26 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 20:03 [RFC] storage: SAN LUN view treats LUNs of third-party plugins as unused, so they can be wiped Dirk Nehring
2026-11-26 18:39 ` Ciro Iriarte [this message]
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=20261126153925.sanlun-reply@cyruspy.gmail.com \
    --to=cyruspy@gmail.com \
    --cc=dnehring@marcant.net \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal