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 677EB1FF0E1 for ; Mon, 16 Nov 2026 02:27:51 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B4F1021A75; Mon, 16 Nov 2026 02:25:07 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v5 manager 32/36] ui: node: san: wipe a LUN that no storage uses Date: Mon, 16 Nov 2026 02:23:41 +0100 Message-ID: <20261116012355.3187417-33-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116012355.3187417-1-t.lamprecht@proxmox.com> References: <20261116012355.3187417-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794792243150 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.206 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: OSV3QUZZUWJHNXLWBCC3SOXXMDHFVVFA X-Message-ID-Hash: OSV3QUZZUWJHNXLWBCC3SOXXMDHFVVFA 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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: A recycled LUN often still carries a volume group or partitions from its previous use and cannot be set up again until those are gone. Let root@pam, the only user the wipe API accepts, wipe a LUN from Node > SAN. The dialog shows what the node knows about the content of the LUN and asks for its name as confirmation. The button is disabled for a LUN that the list attributes to a storage. The list shows cached state, so the check that the node does for the wipe itself stays the one that counts. Signed-off-by: Thomas Lamprecht --- www/manager6/Makefile | 1 + www/manager6/node/SANLuns.js | 14 ++++++++ www/manager6/window/SANLunWipe.js | 53 +++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 www/manager6/window/SANLunWipe.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 723007220..19433ef9c 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -137,6 +137,7 @@ JSSRC= \ window/Restore.js \ window/SafeDestroyGuest.js \ window/SafeDestroyStorage.js \ + window/SANLunWipe.js \ window/Settings.js \ window/Snapshot.js \ window/StartupEdit.js \ diff --git a/www/manager6/node/SANLuns.js b/www/manager6/node/SANLuns.js index dc659dd24..b290488a6 100644 --- a/www/manager6/node/SANLuns.js +++ b/www/manager6/node/SANLuns.js @@ -157,6 +157,20 @@ Ext.define('PVE.node.SANLunList', { success: reload, }), }, + { + xtype: 'proxmoxButton', + text: gettext('Wipe'), + iconCls: 'fa fa-eraser', + disabled: true, + enableFn: (rec) => Proxmox.UserName === 'root@pam' && !rec.get('used-by-storage'), + handler: (button, event, rec) => + Ext.create('PVE.window.SANLunWipe', { + node: me.nodename, + lun: rec.data, + autoShow: true, + taskDone: () => !me.destroyed && reload(), + }), + }, ]; me.callParent(); Proxmox.Utils.monStoreErrors(me, me.rstore); diff --git a/www/manager6/window/SANLunWipe.js b/www/manager6/window/SANLunWipe.js new file mode 100644 index 000000000..4d2713996 --- /dev/null +++ b/www/manager6/window/SANLunWipe.js @@ -0,0 +1,53 @@ +Ext.define('PVE.window.SANLunWipe', { + extend: 'Proxmox.window.Edit', + title: gettext('Wipe LUN'), + onlineHelp: 'storage_multipath', + width: 550, + isCreate: true, + showProgress: true, + submitText: gettext('Wipe'), + method: 'PUT', + + initComponent: function () { + let me = this; + let lun = me.lun; + let name = lun.name || lun.wwid; + me.url = `/nodes/${me.node}/disks/wipedisk`; + me.extraRequestParams = { disk: lun['by-id'] || lun.devpath }; + me.items = [ + { + xtype: 'component', + cls: 'pmx-hint', + html: Ext.htmlEncode( + Ext.String.format( + gettext('Wipe LUN {0} on node "{1}"? All data on the device will be lost!'), + name, + me.node, + ), + ), + }, + { + xtype: 'displayfield', + fieldLabel: gettext('Used By'), + value: PVE.SANUtils.usageText(lun), + }, + { + xtype: 'displayfield', + fieldLabel: gettext('Size'), + value: Proxmox.Utils.format_size(lun.size), + }, + { + xtype: 'textfield', + fieldLabel: Ext.String.format( + gettext('Please enter the ID to confirm ({0})'), + Ext.htmlEncode(name), + ), + labelAlign: 'top', + submitValue: false, + allowBlank: false, + validator: (value) => value === name || gettext('The ID does not match.'), + }, + ]; + me.callParent(); + }, +});