[pve-devel] [PATCH manager 2/3] ui: qga: Add option to turn off fs-freeze/thaw for backup

Christoph Heiss c.heiss at proxmox.com
Wed Feb 1 13:59:17 CET 2023


Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 www/manager6/Utils.js                     |  2 ++
 www/manager6/form/AgentFeatureSelector.js | 30 ++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index d8c0bf5a..cb99d7d6 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -475,6 +475,8 @@ Ext.define('PVE.Utils', {
 		    virtio: "VirtIO",
 		};
 		displayText = map[value] || Proxmox.Utils.unknownText;
+	    } else if (key === 'fsfreeze_thaw' && PVE.Parser.parseBoolean(value)) {
+		continue;
 	    } else if (PVE.Parser.parseBoolean(value)) {
 		displayText = Proxmox.Utils.enabledText;
 	    }
diff --git a/www/manager6/form/AgentFeatureSelector.js b/www/manager6/form/AgentFeatureSelector.js
index 0dcc6ecb..eaf3793e 100644
--- a/www/manager6/form/AgentFeatureSelector.js
+++ b/www/manager6/form/AgentFeatureSelector.js
@@ -21,6 +21,26 @@ Ext.define('PVE.form.AgentFeatureSelector', {
 	    },
 	    disabled: true,
 	},
+	{
+	    xtype: 'proxmoxcheckbox',
+	    boxLabel: gettext('Freeze/thaw filesystems on backup for consistency'),
+	    name: 'fsfreeze_thaw',
+	    reference: 'fsfreeze_thaw',
+	    bind: {
+		disabled: '{!enabled.checked}',
+	    },
+	    disabled: true,
+	    uncheckedValue: '0',
+	    defaultValue: '1',
+	},
+	{
+	    xtype: 'displayfield',
+	    userCls: 'pmx-hint',
+	    value: gettext('Filesystem freeze/thaw disabled. This can lead to inconsistent disk backups.'),
+	    bind: {
+		hidden: '{fsfreeze_thaw.checked}',
+	    },
+	},
 	{
 	    xtype: 'displayfield',
 	    userCls: 'pmx-hint',
@@ -47,12 +67,20 @@ Ext.define('PVE.form.AgentFeatureSelector', {
     ],

     onGetValues: function(values) {
-	var agentstr = PVE.Parser.printPropertyString(values, 'enabled');
+	if (PVE.Parser.parseBoolean(values.fsfreeze_thaw)) {
+	    delete values.fsfreeze_thaw;
+	}
+
+	let agentstr = PVE.Parser.printPropertyString(values, 'enabled');
 	return { agent: agentstr };
     },

     setValues: function(values) {
 	let res = PVE.Parser.parsePropertyString(values.agent, 'enabled');
+	if (!Ext.isDefined(res.fsfreeze_thaw)) {
+	    res.fsfreeze_thaw = 1;
+	}
+
 	this.callParent([res]);
     },
 });
--
2.39.1






More information about the pve-devel mailing list