diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index be5c2dbc..ed361a52 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -160,7 +160,13 @@ my $agent_fmt = { description => "Run fstrim after moving a disk or migrating the VM.", type => 'boolean', optional => 1, - default => 0 + default => 0, + }, + 'freeze-fs-on-backup' => { + description => "Freeze/thaw guest filesystems on backup for consistency.", + type => 'boolean', + optional => 1, + default => 1, }, type => { description => "Select the agent type", diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm index 0eb5ec62..30baa464 100644 --- a/PVE/VZDump/QemuServer.pm +++ b/PVE/VZDump/QemuServer.pm @@ -862,6 +862,12 @@ sub qga_fs_freeze { return; } + my $freeze = PVE::QemuServer::get_qga_key($self->{vmlist}->{$vmid}, 'freeze-fs-on-backup') // 1; + if (!$freeze) { + $self->loginfo("skipping guest-agent 'fs-freeze', disabled in VM options"); + return; + } + $self->loginfo("issuing guest-agent 'fs-freeze' command"); eval { mon_cmd($vmid, "guest-fsfreeze-freeze") }; $self->logerr($@) if $@;