public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager 0/3] ui: lvm: encourage the use of saferemove or on-volume-remove
@ 2026-11-27 15:32 Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 1/3] ui: storage: SAN: add checkboxes for saferemove & on-volume-remove Maximiliano Sandoval
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2026-11-27 15:32 UTC (permalink / raw)
  To: pve-devel

This series adds the checkmarks present in the LVM edit dialog to the
storage wizard (e.g. creating a LVM over iSCSI) and displays a warning
when both are disabled.

Future steps:

 - Document in the LVM plugin which option one should enabled based on
   the setup, e.g. is the LUN thin-provisioned? Are there multiple users
   creating/removing disk images in it?

 - Link this documentation in the warnings

 - Re-evaluate the defaults when creating a new LVM. It might be
   possible to detect for the user a better combination of saferemove &
   on-volume-remove than having both disavbled.

Maximiliano Sandoval (3):
  ui: storage: SAN: add checkboxes for saferemove & on-volume-remove
  ui: lvm: display a warning when there is no cleanup
  ui: storage: SAN: display a warning when there is no cleanup

 www/manager6/storage/LVMEdit.js       | 14 ++++++++
 www/manager6/storage/wizard/Wizard.js | 49 ++++++++++++++++++++++++++-
 2 files changed, 62 insertions(+), 1 deletion(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH manager 1/3] ui: storage: SAN: add checkboxes for saferemove & on-volume-remove
  2026-11-27 15:32 [PATCH manager 0/3] ui: lvm: encourage the use of saferemove or on-volume-remove Maximiliano Sandoval
@ 2026-11-27 15:32 ` Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 2/3] ui: lvm: display a warning when there is no cleanup Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 3/3] ui: storage: SAN: " Maximiliano Sandoval
  2 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2026-11-27 15:32 UTC (permalink / raw)
  To: pve-devel

..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 <m.sandoval@proxmox.com>
---
 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





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH manager 2/3] ui: lvm: display a warning when there is no cleanup
  2026-11-27 15:32 [PATCH manager 0/3] ui: lvm: encourage the use of saferemove or on-volume-remove Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 1/3] ui: storage: SAN: add checkboxes for saferemove & on-volume-remove Maximiliano Sandoval
@ 2026-11-27 15:32 ` Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 3/3] ui: storage: SAN: " Maximiliano Sandoval
  2 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2026-11-27 15:32 UTC (permalink / raw)
  To: pve-devel

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.

A warning when both are disabled is added to discourage this from
happening.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 www/manager6/storage/LVMEdit.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/www/manager6/storage/LVMEdit.js b/www/manager6/storage/LVMEdit.js
index 79bdb16c..8fcb924c 100644
--- a/www/manager6/storage/LVMEdit.js
+++ b/www/manager6/storage/LVMEdit.js
@@ -160,6 +160,8 @@ Ext.define('PVE.storage.LVMInputPanel', {
 
     onlineHelp: 'storage_lvm',
 
+    viewModel: {},
+
     onGetValues: function (values) {
         let me = this;
 
@@ -291,12 +293,14 @@ Ext.define('PVE.storage.LVMInputPanel', {
             name: 'saferemove',
             uncheckedValue: 0,
             fieldLabel: gettext('Wipe Removed Volumes'),
+            reference: 'saferemove',
         },
         {
             xtype: 'proxmoxcheckbox',
             name: 'on-remove-discard',
             uncheckedValue: 0,
             fieldLabel: gettext('Discard Removed Volumes'),
+            reference: 'on_remove_discard',
             autoEl: {
                 tag: 'div',
                 'data-qtip': gettext(
@@ -304,5 +308,15 @@ Ext.define('PVE.storage.LVMInputPanel', {
                 ),
             },
         },
+        {
+            xtype: 'displayfield',
+            userCls: 'pmx-hint',
+            value: gettext(
+                'Newly allocated images can potentially contain data from previously removed images if both "Wipe Remove Volumes" and "Discard Removed Volumes" are disabled.',
+            ),
+            bind: {
+                hidden: '{saferemove.checked || on_remove_discard.checked}',
+            },
+        },
     ],
 });
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH manager 3/3] ui: storage: SAN: display a warning when there is no cleanup
  2026-11-27 15:32 [PATCH manager 0/3] ui: lvm: encourage the use of saferemove or on-volume-remove Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 1/3] ui: storage: SAN: add checkboxes for saferemove & on-volume-remove Maximiliano Sandoval
  2026-11-27 15:32 ` [PATCH manager 2/3] ui: lvm: display a warning when there is no cleanup Maximiliano Sandoval
@ 2026-11-27 15:32 ` Maximiliano Sandoval
  2 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2026-11-27 15:32 UTC (permalink / raw)
  To: pve-devel

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.

A warning when both are disabled is added to discourage this from
happening.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 www/manager6/storage/wizard/Wizard.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/www/manager6/storage/wizard/Wizard.js b/www/manager6/storage/wizard/Wizard.js
index 27bf44ef..f38181c1 100644
--- a/www/manager6/storage/wizard/Wizard.js
+++ b/www/manager6/storage/wizard/Wizard.js
@@ -388,6 +388,7 @@ Ext.define('PVE.storage.wizard.SAN', {
         let settings = {
             xtype: 'inputpanel',
             title: gettext('Storage'),
+            viewModel: {},
             onlineHelp,
             items: [
                 ...(target
@@ -410,12 +411,14 @@ Ext.define('PVE.storage.wizard.SAN', {
                     name: 'saferemove',
                     uncheckedValue: 0,
                     boxLabel: gettext('Wipe Removed Volumes'),
+                    reference: 'saferemove',
                 },
                 {
                     xtype: 'proxmoxcheckbox',
                     name: 'on-remove-discard',
                     uncheckedValue: 0,
                     boxLabel: gettext('Discard Removed Volumes'),
+                    reference: 'on_remove_discard',
                     autoEl: {
                         tag: 'div',
                         'data-qtip': gettext(
@@ -423,6 +426,16 @@ Ext.define('PVE.storage.wizard.SAN', {
                         ),
                     },
                 },
+                {
+                    xtype: 'displayfield',
+                    userCls: 'pmx-hint',
+                    value: gettext(
+                        'Newly allocated images can potentially contain data from previously removed images if both "Wipe Remove Volumes" and "Discard Removed Volumes" are disabled.',
+                    ),
+                    bind: {
+                        hidden: '{saferemove.checked || on_remove_discard.checked}',
+                    },
+                },
             ],
             advancedItems: [
                 vgname,
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-27 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 15:32 [PATCH manager 0/3] ui: lvm: encourage the use of saferemove or on-volume-remove Maximiliano Sandoval
2026-11-27 15:32 ` [PATCH manager 1/3] ui: storage: SAN: add checkboxes for saferemove & on-volume-remove Maximiliano Sandoval
2026-11-27 15:32 ` [PATCH manager 2/3] ui: lvm: display a warning when there is no cleanup Maximiliano Sandoval
2026-11-27 15:32 ` [PATCH manager 3/3] ui: storage: SAN: " Maximiliano Sandoval

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