[pve-devel] [PATCH manager v2] ui: restore: enable safeguarding of mount point volumes by default
Fiona Ebner
f.ebner at proxmox.com
Tue Feb 11 12:20:45 CET 2025
Same rationale as in pve-manager commit 5f855ccf ("ui: restore:
improve warning for restoring container with same ID"): it's
surprising to (new) users that all owned mount point volumes are
erased upon container restore, even those that are not currently
selected for backup. This is different from VM restore, where volumes
attached at drives not present in the backup will be kept around as
unused volumes.
Opt-in by default to the new option to change this behavior.
Remove the special message printed regarding removal of mount point
volumes to avoid confusion/complexity. With the checkbox for
safeguarding being present, attention is already directed towards this
behavior. And since the checkbox is enabled by default, one needs to
explicitly opt-out for not backed-up mount points. For backed-up mount
points, it should be clear that they are overwritten by the restore,
since the confirm dialog already states "This will permanently erase
current CT data".
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
New in v2.
Dependency bump for pve-container is needed.
www/manager6/window/Restore.js | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/www/manager6/window/Restore.js b/www/manager6/window/Restore.js
index 6efe1313..3d759d6a 100644
--- a/www/manager6/window/Restore.js
+++ b/www/manager6/window/Restore.js
@@ -47,6 +47,9 @@ Ext.define('PVE.window.Restore', {
if (values.storage) {
params.storage = values.storage;
}
+ if (values['restore-safeguard-mp-volumes']) {
+ params['restore-safeguard-mp-volumes'] = 1;
+ }
['bwlimit', 'cores', 'name', 'memory', 'sockets'].forEach(opt => {
if ((values[opt] ?? '') !== '') {
@@ -96,9 +99,6 @@ Ext.define('PVE.window.Restore', {
gettext('This will permanently erase current {0} data.'),
view.vmtype === 'lxc' ? 'CT' : 'VM',
)}`;
- if (view.vmtype === 'lxc') {
- confirmMsg += `<br>${gettext('Mount point volumes are also erased.')}`;
- }
Ext.Msg.confirm(gettext('Confirm'), confirmMsg, function(btn) {
if (btn === 'yes') {
executeRestore();
@@ -278,6 +278,18 @@ Ext.define('PVE.window.Restore', {
},
],
},
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'restore-safeguard-mp-volumes',
+ itemId: 'restoreSafeguardMpVolumes',
+ fieldLabel: gettext('Safeguard Mount Point Volumes'),
+ flex: 1,
+ checked: true,
+ autoEl: {
+ tag: 'div',
+ 'data-qtip': gettext("Preserve mount point volumes that are not included in the backup as 'unused'."),
+ },
+ },
);
} else if (me.vmtype === 'qemu') {
items.push({
--
2.39.5
More information about the pve-devel
mailing list