]> git.proxmox.com Git - qemu-server.git/commitdiff
vzdump: Add VM QGA option to skip fs-freeze/-thaw on backup
authorChristoph Heiss <c.heiss@proxmox.com>
Thu, 23 Feb 2023 14:18:03 +0000 (15:18 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Feb 2023 15:34:10 +0000 (16:34 +0100)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
PVE/QemuServer.pm
PVE/VZDump/QemuServer.pm

index be5c2dbce8703e95872bccf9abc90772e1da39d4..ed361a526a4b1e3a7e73a5218cb2d607e52e5a36 100644 (file)
@@ -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",
index 0eb5ec62a665ece8aeeda6acc7b34f0f4d9bcdb7..30baa464cd3ff3a1ae87ede474448110b3225bde 100644 (file)
@@ -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 $@;