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 0BE581FF0B4 for ; Fri, 27 Nov 2026 16:33:16 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9896521794; Fri, 27 Nov 2026 16:32:49 +0100 (CET) From: Maximiliano Sandoval To: pve-devel@lists.proxmox.com Subject: [PATCH manager 1/3] ui: storage: SAN: add checkboxes for saferemove & on-volume-remove Date: Fri, 27 Nov 2026 16:32:40 +0100 Message-ID: <20261127153243.488023-2-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261127153243.488023-1-m.sandoval@proxmox.com> References: <20261127153243.488023-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795793563671 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.661 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: 6QZNA7A67WGOHSEJS5FUSRTAWYLXHVW5 X-Message-ID-Hash: 6QZNA7A67WGOHSEJS5FUSRTAWYLXHVW5 X-MailFrom: m.sandoval@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: ..when adding a shared LVM storage through the wizard. A LVM storage without saferemove nor on-volume-remove can potentially leak the contents of a previously removed disk image on newly created disk images. The same checkboxes present in the LVM edit panel are added to discourage this from happening. Signed-off-by: Maximiliano Sandoval --- www/manager6/storage/wizard/Wizard.js | 36 ++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/www/manager6/storage/wizard/Wizard.js b/www/manager6/storage/wizard/Wizard.js index d70e9a94..27bf44ef 100644 --- a/www/manager6/storage/wizard/Wizard.js +++ b/www/manager6/storage/wizard/Wizard.js @@ -148,10 +148,11 @@ Ext.define('PVE.storage.wizard.SAN', { volumeSettings: function () { let me = this; let value = (name) => me.down(`field[name=${name}]`).getValue(); - return { + let values = { storage: value('storage'), vgname: value('vgname') || value('storage'), 'snapshot-as-volume-chain': value('snapshot-as-volume-chain') ? 1 : 0, + saferemove: value('saferemove') ? 1 : 0, nodes: me.wizardType === 'fc' ? [] @@ -160,6 +161,14 @@ Ext.define('PVE.storage.wizard.SAN', { .join(',') : me.connection.nodes, }; + + if (value('on-remove-discard')) { + let onRemove = { discard: 1 }; + let onRemoveString = PVE.Parser.printPropertyString(onRemove); + values['on-volume-remove'] = onRemoveString; + } + + return values; }, cleanUp: function () { @@ -288,6 +297,13 @@ Ext.define('PVE.storage.wizard.SAN', { gettext('Allow Snapshots as Volume-Chain'), Proxmox.Utils.format_boolean(values['snapshot-as-volume-chain']), ], + [gettext('Wipe Removed Volumes'), Proxmox.Utils.format_boolean(values.saferemove)], + [ + gettext('Discard Removed Volumes'), + Proxmox.Utils.format_boolean( + PVE.Parser.parsePropertyString(values['on-volume-remove']).discard, + ), + ], ]; me.down('#summary') .getStore() @@ -389,6 +405,24 @@ Ext.define('PVE.storage.wizard.SAN', { userCls: 'pmx-hint', value: gettext('Enable before creating VM disks that need snapshots.'), }, + { + xtype: 'proxmoxcheckbox', + name: 'saferemove', + uncheckedValue: 0, + boxLabel: gettext('Wipe Removed Volumes'), + }, + { + xtype: 'proxmoxcheckbox', + name: 'on-remove-discard', + uncheckedValue: 0, + boxLabel: gettext('Discard Removed Volumes'), + autoEl: { + tag: 'div', + 'data-qtip': gettext( + 'Enable to issue discard (TRIM) requests for logical volumes before removing them.', + ), + }, + }, ], advancedItems: [ vgname, -- 2.47.3