public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH guest-common v2 0/1] fix #1964: replication config: add a setting to skip freezing guest filesystems
@ 2026-10-22 13:00 Maximiliano Sandoval
  2026-10-22 13:00 ` [PATCH guest-common v2 1/1] " Maximiliano Sandoval
  0 siblings, 1 reply; 2+ messages in thread
From: Maximiliano Sandoval @ 2026-10-22 13:00 UTC (permalink / raw)
  To: pve-devel

See the second commit message for more information.

We sneak a change removing an unused Data::Dumper import.

Tested:

- Created a VM with ID 101 in a cluster with nodes pve1 and pve2
- Enabled the QGA service inside the guest
- Created a replication job with

pve2 $ pvesr create-local-job 101-1 pve1 --skip-freeze-fs 1 --schedule '*/1'

- Start the VM
- Ran: pvesr schedule-now 101-1
- cat /var/log/pve/replicate/101-1
- checked that it contains the added line in the logs.

Then repeated the whole thing without specifying --skip-freeze-fs to ensure
nothing was broken.

Maximiliano Sandoval (1):
  fix #1964: replication config: add a setting to skip freezing guest
    filesystems

 src/PVE/Replication.pm       | 19 ++++++++++++++++++-
 src/PVE/ReplicationConfig.pm | 13 +++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH guest-common v2 1/1] fix #1964: replication config: add a setting to skip freezing guest filesystems
  2026-10-22 13:00 [PATCH guest-common v2 0/1] fix #1964: replication config: add a setting to skip freezing guest filesystems Maximiliano Sandoval
@ 2026-10-22 13:00 ` Maximiliano Sandoval
  0 siblings, 0 replies; 2+ messages in thread
From: Maximiliano Sandoval @ 2026-10-22 13:00 UTC (permalink / raw)
  To: pve-devel

Add a skip-freeze-fs setting to replication jobs.

An entry is logged if the guest is running and skip-freeze-fs is enabled.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

Notes:
    See the commit message for more information.
    
    Tested:
    
    - Created a VM with ID 101 in a cluster with nodes pve1 and pve2
    - Enabled the QGA service inside the guest
    - Created a replication job with
    
    pve2 $ pvesr create-local-job 101-1 pve1 --skip-freeze-fs 1 --schedule '*/1'
    
    - Start the VM
    - pvesr run --id 101-1
    - cat /var/log/pve/replicate/101-1
    - checked that it contains the added line in the logs.
    
    Then repeated the whole thing without specifying --skip-freeze-fs and with
    --skip-freee-fs 0 to ensure nothing was broken.
    
    Differences from v1:
    
    - use if block instead of post-if in if freezefs check
    - Add verbose_description to skip-freeze-fs
    - Improve description of skip-freeze-fs
    - Fix typo
    - Check if $running before logging that we skipped the freeze
    - Run __snapshot_check_freeze_needed only if skip_freeze_fs is falsy

 src/PVE/Replication.pm       | 19 ++++++++++++++++++-
 src/PVE/ReplicationConfig.pm | 13 +++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Replication.pm b/src/PVE/Replication.pm
index ba4c2c1..37aaa18 100644
--- a/src/PVE/Replication.pm
+++ b/src/PVE/Replication.pm
@@ -299,7 +299,24 @@ sub replicate {
     my $vmid = $jobcfg->{guest};
 
     my $conf = $guest_class->load_config($vmid);
-    my ($running, $freezefs) = $guest_class->__snapshot_check_freeze_needed($vmid, $conf, 0);
+
+    my $running = $guest_class->__snapshot_check_running($vmid, $conf);
+    my $freezefs = 1;
+
+    if ($jobcfg->{'skip-freeze-fs'}) {
+        if ($running) {
+            $logfunc->(
+                "replication job configured with 'skip-freeze-fs' enabled, not freezing guest filesystems"
+            );
+        }
+        $freezefs = 0;
+    } else {
+        # We check __snapshot_check_freeze_needed after checking skip-freeze-fs to avoid logging
+        # messages produced by the former.
+        my ($_running, $freeze_needed) = $guest_class->__snapshot_check_freeze_needed($vmid, $conf, 0);
+        $freezefs = $freeze_needed;
+    }
+
     my $volumes = $guest_class->get_replicatable_volumes(
         $storecfg,
         $vmid,
diff --git a/src/PVE/ReplicationConfig.pm b/src/PVE/ReplicationConfig.pm
index cf9ee01..91d97cc 100644
--- a/src/PVE/ReplicationConfig.pm
+++ b/src/PVE/ReplicationConfig.pm
@@ -96,6 +96,18 @@ my $defaultData = {
             format => 'pve-node',
             optional => 1,
         },
+        'skip-freeze-fs' => {
+            description =>
+                "Whether to skip freezing and thawing the guest's filesystems during replication for consistency.",
+            verbose_description =>
+                "Whether to skip freezing and thawing the guest's filesystems during replication for consistency."
+                . " Disabling this setting does not enforce that a freeze happens for VMs."
+                . " For VMs, that also depends on the virtual machine's 'agent' settings for the QEMU guest agent"
+                . " and the availability of the guest agent in the VM.",
+            type => 'boolean',
+            optional => 1,
+            default => 0,
+        },
     },
 };
 
@@ -335,6 +347,7 @@ sub options {
         schedule => { optional => 1 },
         remove_job => { optional => 1 },
         source => { optional => 1 },
+        'skip-freeze-fs' => { optional => 1 },
     };
 }
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-22 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22 13:00 [PATCH guest-common v2 0/1] fix #1964: replication config: add a setting to skip freezing guest filesystems Maximiliano Sandoval
2026-10-22 13:00 ` [PATCH guest-common v2 1/1] " Maximiliano Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal