* [pve-devel] [PATCH qemu-server v3 1/7] add a guest-fsfreeze qga setting
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 2/7] block job: mirror: follow guest-fsfreeze setting Maximiliano Sandoval
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
Adds a new setting that controls whether guest-fsfreeze-{freeze,thaw}
commands should be issued. The previous setting was only taken into
account for backups.
In this commit we only use this setting for backups. The following two
commits will ensure the setting is used on replications, snapshots and
clones.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuServer/Agent.pm | 11 +++++++++++
src/PVE/VZDump/QemuServer.pm | 7 +++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer/Agent.pm b/src/PVE/QemuServer/Agent.pm
index 5d88b7bd..dc945844 100644
--- a/src/PVE/QemuServer/Agent.pm
+++ b/src/PVE/QemuServer/Agent.pm
@@ -41,6 +41,17 @@ our $agent_fmt = {
optional => 1,
default => 1,
},
+ 'guest-fsfreeze' => {
+ description =>
+ "Whether to issue the guest-fsfreeze-freeze and guest-fsfreeze-thaw QEMU guest agent commands.\n\n"
+ . "Backups in snapshot mode, clones, snapshots without RAM, and replications normally issue a "
+ . "fsfreeze-fsfreeze-freeze and a respective thaw command when the QEMU Guest agent option is "
+ . "enabled on the guest's configuration and the agent is running inside of the guest.\n\n"
+ . "When set it will take precedence over 'freeze-fs-on-backup'.",
+ type => 'boolean',
+ optional => 1,
+ default => 1,
+ },
type => {
description => "Select the agent type",
type => 'string',
diff --git a/src/PVE/VZDump/QemuServer.pm b/src/PVE/VZDump/QemuServer.pm
index dd789652..38e352ef 100644
--- a/src/PVE/VZDump/QemuServer.pm
+++ b/src/PVE/VZDump/QemuServer.pm
@@ -1097,8 +1097,11 @@ sub qga_fs_freeze {
return;
}
- my $freeze =
- PVE::QemuServer::Agent::get_qga_key($self->{vmlist}->{$vmid}, 'freeze-fs-on-backup') // 1;
+ my $freeze = PVE::QemuServer::Agent::get_qga_key($self->{vmlist}->{$vmid}, 'guest-fsfreeze');
+ $freeze //=
+ PVE::QemuServer::Agent::get_qga_key($self->{vmlist}->{$vmid}, 'freeze-fs-on-backup');
+ $freeze //= 1;
+
if (!$freeze) {
$self->loginfo("skipping guest-agent 'fs-freeze', disabled in VM options");
return;
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH qemu-server v3 2/7] block job: mirror: follow guest-fsfreeze setting
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 1/7] add a guest-fsfreeze qga setting Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 3/7] fix #1964: follow guest-fsfreeze setting on check freeze needed Maximiliano Sandoval
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
This is used when performing a full-clone of a running VM.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuServer/BlockJob.pm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm
index 506010e1..5a4b416e 100644
--- a/src/PVE/QemuServer/BlockJob.pm
+++ b/src/PVE/QemuServer/BlockJob.pm
@@ -162,8 +162,11 @@ sub qemu_drive_mirror_monitor {
last if $completion eq 'skip' || $completion eq 'auto';
if ($vmiddst && $vmiddst != $vmid) {
+ my $config = PVE::QemuConfig->load_config($vmid);
+ my $fsfreeze =
+ PVE::QemuServer::Agent::get_qga_key($config, 'guest-fsfreeze') // 1;
my $agent_running = $qga && qga_check_running($vmid);
- if ($agent_running) {
+ if ($agent_running && $fsfreeze) {
print "freeze filesystem\n";
eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
warn $@ if $@;
@@ -176,7 +179,7 @@ sub qemu_drive_mirror_monitor {
# if we clone a disk for a new target vm, we don't switch the disk
qemu_blockjobs_cancel($vmid, $jobs);
- if ($agent_running) {
+ if ($agent_running && $fsfreeze) {
print "unfreeze filesystem\n";
eval { mon_cmd($vmid, "guest-fsfreeze-thaw"); };
warn $@ if $@;
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH qemu-server v3 3/7] fix #1964: follow guest-fsfreeze setting on check freeze needed
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 1/7] add a guest-fsfreeze qga setting Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 2/7] block job: mirror: follow guest-fsfreeze setting Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 4/7] log when issuing a guest-fsfreeze command Maximiliano Sandoval
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
This method is used by replications and snapshots without RAM.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuConfig.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
index bb469197..412c76ae 100644
--- a/src/PVE/QemuConfig.pm
+++ b/src/PVE/QemuConfig.pm
@@ -298,7 +298,8 @@ sub __snapshot_check_freeze_needed {
$running,
$running
&& PVE::QemuServer::Agent::get_qga_key($config, 'enabled')
- && PVE::QemuServer::Agent::qga_check_running($vmid),
+ && PVE::QemuServer::Agent::qga_check_running($vmid)
+ && PVE::QemuServer::Agent::get_qga_key($config, 'guest-fsfreeze') // 1,
);
} else {
return ($running, 0);
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH qemu-server v3 4/7] log when issuing a guest-fsfreeze command
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
` (2 preceding siblings ...)
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 3/7] fix #1964: follow guest-fsfreeze setting on check freeze needed Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 5/7] block job: mirror: reword fsfreeze log entry Maximiliano Sandoval
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
These messages appear during replication or snapshots.
The messages will now appear on all call sites of __snapshot_freeze().
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuConfig.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
index 412c76ae..32a95dd6 100644
--- a/src/PVE/QemuConfig.pm
+++ b/src/PVE/QemuConfig.pm
@@ -310,9 +310,11 @@ sub __snapshot_freeze {
my ($class, $vmid, $unfreeze) = @_;
if ($unfreeze) {
+ print "issuing guest agent 'guest-fsfreeze-thaw' command\n";
eval { mon_cmd($vmid, "guest-fsfreeze-thaw"); };
warn "guest-fsfreeze-thaw problems - $@" if $@;
} else {
+ print "issuing guest agent 'guest-fsfreeze-freeze' command\n";
eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
warn $@ if $@;
}
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH qemu-server v3 5/7] block job: mirror: reword fsfreeze log entry
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
` (3 preceding siblings ...)
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 4/7] log when issuing a guest-fsfreeze command Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 6/7] block job: log if fs-freeze is skipped due to config Maximiliano Sandoval
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuServer/BlockJob.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm
index 5a4b416e..a1805f58 100644
--- a/src/PVE/QemuServer/BlockJob.pm
+++ b/src/PVE/QemuServer/BlockJob.pm
@@ -167,7 +167,7 @@ sub qemu_drive_mirror_monitor {
PVE::QemuServer::Agent::get_qga_key($config, 'guest-fsfreeze') // 1;
my $agent_running = $qga && qga_check_running($vmid);
if ($agent_running && $fsfreeze) {
- print "freeze filesystem\n";
+ print "issuing guest agent 'guest-fsfreeze-freeze' command\n";
eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
warn $@ if $@;
} else {
@@ -180,7 +180,7 @@ sub qemu_drive_mirror_monitor {
qemu_blockjobs_cancel($vmid, $jobs);
if ($agent_running && $fsfreeze) {
- print "unfreeze filesystem\n";
+ print "issuing guest agent 'guest-fsfreeze-thaw' command\n";
eval { mon_cmd($vmid, "guest-fsfreeze-thaw"); };
warn $@ if $@;
} else {
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH qemu-server v3 6/7] block job: log if fs-freeze is skipped due to config
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
` (4 preceding siblings ...)
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 5/7] block job: mirror: reword fsfreeze log entry Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 7/7] deprecate freeze-fs-on-backup qga setting Maximiliano Sandoval
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuServer/BlockJob.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm
index a1805f58..de2a4b84 100644
--- a/src/PVE/QemuServer/BlockJob.pm
+++ b/src/PVE/QemuServer/BlockJob.pm
@@ -166,6 +166,11 @@ sub qemu_drive_mirror_monitor {
my $fsfreeze =
PVE::QemuServer::Agent::get_qga_key($config, 'guest-fsfreeze') // 1;
my $agent_running = $qga && qga_check_running($vmid);
+
+ if ($agent_running && !$fsfreeze) {
+ print "skipping guest-agent 'fs-freeze', disabled in VM options\n";
+ }
+
if ($agent_running && $fsfreeze) {
print "issuing guest agent 'guest-fsfreeze-freeze' command\n";
eval { PVE::QemuServer::Agent::guest_fsfreeze($vmid); };
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH qemu-server v3 7/7] deprecate freeze-fs-on-backup qga setting
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
` (5 preceding siblings ...)
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 6/7] block job: log if fs-freeze is skipped due to config Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH container v3 1/1] log when freezing/thawing filesystem Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH guest-common v3 1/1] replication: remove logging when freezing/thawing Maximiliano Sandoval
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/QemuServer/Agent.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer/Agent.pm b/src/PVE/QemuServer/Agent.pm
index dc945844..a5eae787 100644
--- a/src/PVE/QemuServer/Agent.pm
+++ b/src/PVE/QemuServer/Agent.pm
@@ -35,8 +35,10 @@ our $agent_fmt = {
optional => 1,
default => 0,
},
+ # TODO Remove for Proxmox VE 10
'freeze-fs-on-backup' => {
- description => "Freeze/thaw guest filesystems on backup for consistency.",
+ description => "Deprecated: Use 'guest-fsfreeze' instead.\n\n"
+ . " Freeze/thaw guest filesystems on backup for consistency.",
type => 'boolean',
optional => 1,
default => 1,
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH container v3 1/1] log when freezing/thawing filesystem
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
` (6 preceding siblings ...)
2025-10-14 12:27 ` [pve-devel] [PATCH qemu-server v3 7/7] deprecate freeze-fs-on-backup qga setting Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
2025-10-14 12:27 ` [pve-devel] [PATCH guest-common v3 1/1] replication: remove logging when freezing/thawing Maximiliano Sandoval
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/LXC/Config.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 5d3749e..51fd16b 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -204,10 +204,12 @@ sub __snapshot_freeze {
};
if ($unfreeze) {
+ print "thawing guest filesystem\n";
eval { PVE::LXC::thaw($vmid); };
warn $@ if $@;
$freeze_mountpoints->(1);
} else {
+ print "freezing guest filesystem\n";
PVE::LXC::freeze($vmid);
PVE::LXC::sync_container_namespace($vmid);
$freeze_mountpoints->(0);
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [pve-devel] [PATCH guest-common v3 1/1] replication: remove logging when freezing/thawing
2025-10-14 12:27 [pve-devel] [PATCH container/guest-common/qemu-server v3 0/9] fix #1964: add setting to always disable freezing a guest Maximiliano Sandoval
` (7 preceding siblings ...)
2025-10-14 12:27 ` [pve-devel] [PATCH container v3 1/1] log when freezing/thawing filesystem Maximiliano Sandoval
@ 2025-10-14 12:27 ` Maximiliano Sandoval
8 siblings, 0 replies; 10+ messages in thread
From: Maximiliano Sandoval @ 2025-10-14 12:27 UTC (permalink / raw)
To: pve-devel
This is handled now by the class' __snapshot_freeze.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/PVE/Replication.pm | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/PVE/Replication.pm b/src/PVE/Replication.pm
index ba4c2c1..1b31ae2 100644
--- a/src/PVE/Replication.pm
+++ b/src/PVE/Replication.pm
@@ -376,7 +376,6 @@ sub replicate {
# freeze filesystem for data consistency
if ($freezefs) {
- $logfunc->("freeze guest filesystem");
$guest_class->__snapshot_freeze($vmid, 0);
}
@@ -395,7 +394,6 @@ sub replicate {
# thaw immediately
if ($freezefs) {
- $logfunc->("thaw guest filesystem");
$guest_class->__snapshot_freeze($vmid, 1);
}
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 10+ messages in thread