From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id E9B5C1FF0B4 for ; Fri, 27 Nov 2026 19:30:59 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1555F21754; Fri, 27 Nov 2026 19:30:57 +0100 (CET) Message-ID: <0f733242-c11a-41a5-8bee-f6cb0f560af9@proxmox.com> Date: Fri, 27 Nov 2026 19:30:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [RFC] storage: SAN LUN view treats LUNs of third-party plugins as unused, so they can be wiped To: Ciro Iriarte , pve-devel@lists.proxmox.com References: <20261124200340.380381-1-dnehring@marcant.net> <20261126153925.sanlun-reply@cyruspy.gmail.com> Content-Language: en-US From: Thomas Lamprecht Autocrypt: addr=t.lamprecht@proxmox.com; keydata= xsFNBFsLjcYBEACsaQP6uTtw/xHTUCKF4VD4/Wfg7gGn47+OfCKJQAD+Oyb3HSBkjclopC5J uXsB1vVOfqVYE6PO8FlD2L5nxgT3SWkc6Ka634G/yGDU3ZC3C/7NcDVKhSBI5E0ww4Qj8s9w OQRloemb5LOBkJNEUshkWRTHHOmk6QqFB/qBPW2COpAx6oyxVUvBCgm/1S0dAZ9gfkvpqFSD 90B5j3bL6i9FIv3YGUCgz6Ue3f7u+HsEAew6TMtlt90XV3vT4M2IOuECG/pXwTy7NtmHaBQ7 UJBcwSOpDEweNob50+9B4KbnVn1ydx+K6UnEcGDvUWBkREccvuExvupYYYQ5dIhRFf3fkS4+ wMlyAFh8PQUgauod+vqs45FJaSgTqIALSBsEHKEs6IoTXtnnpbhu3p6XBin4hunwoBFiyYt6 YHLAM1yLfCyX510DFzX/Ze2hLqatqzY5Wa7NIXqYYelz7tXiuCLHP84+sV6JtEkeSUCuOiUY virj6nT/nJK8m0BzdR6FgGtNxp7RVXFRz/+mw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sLnmQ9AzRcMMJUXjTNEDxEYbF55SdGBHHOAcZtA kEQKub86e+GHA+Z8oXQSGeSGOkqHi7zfgW1UexddTvaRwE6AyZ6FxTApm8wq8NT2cryWPWTF BDSGB3ujWHMM8ERRYJPcBSjTvt0GcEqnd+OSGgxTkGOdufn51oz82zfpVo1t+J/FNz6MRMcg 8nEC+uKvgzH1nujxJ5pRCBOquFZaGn/p71Yr0oVitkttLKblFsqwa+10Lt6HBxm+2+VLp4Ja 0WZNncZciz3V3cuArpan/ZhhyiWYV5FD0pOXPCJIx7WS9PTtxiv0AOS4ScWEUmBxyhFeOpYa DrEx In-Reply-To: <20261126153925.sanlun-reply@cyruspy.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795804252760 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.147 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JHF6VL32PFS6OEMPM7JQ2VQCLEDAU3HE X-Message-ID-Hash: JHF6VL32PFS6OEMPM7JQ2VQCLEDAU3HE X-MailFrom: t.lamprecht@proxmox.com 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 CC: Dirk Nehring X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 26.11.26 um 19:39 schrieb Ciro Iriarte: > 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. FYI, the web UI is now more clear about this, that was the simplest stop gap. > 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. [...] > >> 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. Agreed on the list form and on including every LUN a storage may map (guest disks, snapshots, clones, and stale mappings). I'd do it like this (with APIVER 18, APIAGE 9 compat bump): $info = $class->backing_devices($storeid, $scfg, $opts) It returns the WWIDs the storage owns (or device paths, iSCSI targets, NVMe subsystems, or LVM VGs), for example: { wwids => { '3600a098038314c4a' => { volid => "$storeid:vm-100-disk-0" }, 'eui.0123456789abcdef' => { native => 1, nodes => [$node] }, }, } Each WWID entry can optionally return `paths-expected`, `native` (for native NVMe multipath namespaces), and `nodes` (so per-host attached LUNs are not flagged as missing on other nodes in cluster SAN status). The returned hashref defaults to `status => 'complete'`, so `{}` is a valid empty result. `$opts` would be a hashref telling the plugin how it is being called: `$opts->{live}` would be `0` for listing and status views (under a short timeout budget, so plugins stay local-only and can return `status => 'partial'` with whatever is cached locally), and `1` before destructive operations (wipe, VG create/remove, last-path NVMe-oF disconnect), where core would call third-party plugins once outside locks and plugins may query their backend. On `live => 1` calls, core may also pass `$opts->{candidates}` (`{ wwids => [...], devices => [...] }`) as an optional hint so plugins can do point lookups instead of listing every LUN. Core would still never write multipathd config for third-party plugins. >> 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. In the proposed series, any LUN a plugin reports as in use would always be blocked from wipes and VG creation, even if the storage is disabled or restricted to other nodes. If a plugin dies, times out, returns `status => 'partial'` or `'unknown'`, or failed to load on the node, core would refuse the operation while that storage is enabled here and print a hint to disable or restrict it so one broken backend does not block unrelated LUNs. Existing plugins that do not implement `backing_devices()` would inherit `undef` and fall back to `storage.cfg` fields plus a live `list_images()`/`path()` check. Starting with `backing_devices()` avoids a separate core WWID registry in pmxcfs that would have to be kept in sync across crashes and array-side changes, i.e. many foot-guns and error potential and not scaling well on a bigger cluster. > 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. I'll probably send the patch series to the list in the next days; early feedback on the interface would be already welcome though. - Thomas