[pve-devel] [PATCH cluster 1/1] datacenter config: add replication settings

Maximiliano Sandoval m.sandoval at proxmox.com
Thu Jun 12 15:29:49 CEST 2025


Adds replication settings similar to the migration settings. This allows
specifying different networks and it is ultimately more straightforward
than using the migration settings for replication jobs.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 src/PVE/DataCenterConfig.pm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 53095a1..3d15643 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -46,7 +46,27 @@ my $migration_format = {
         type => 'string',
         format => 'CIDR',
         format_description => 'CIDR',
-        description => "CIDR of the (sub) network that is used for migration and replication.",
+        description => "CIDR of the (sub) network that is used for migration. "
+	    . "Used as a fallback for replications jobs if the replication network setting is not set",
+    },
+};
+
+my $replication_format = {
+    type => {
+        default_key => 1,
+        type => 'string',
+        enum => ['secure', 'insecure'],
+        description => "Replication traffic is encrypted using an SSH tunnel by "
+            . "default. On secure, completely private networks this can be "
+            . "disabled to increase performance.",
+        default => 'secure',
+    },
+    network => {
+        optional => 1,
+        type => 'string',
+        format => 'CIDR',
+        format_description => 'CIDR',
+        description => "CIDR of the (sub) network that is used for replication jobs.",
     },
 };
 
@@ -352,6 +372,12 @@ my $datacenter_schema = {
             format => $migration_format,
             description => "For cluster wide migration settings.",
         },
+        replication => {
+            optional => 1,
+            type => 'string',
+            format => $replication_format,
+            description => "For cluster wide replication settings.",
+        },
         console => {
             optional => 1,
             type => 'string',
@@ -506,6 +532,10 @@ sub parse_datacenter_config {
         $res->{migration} = parse_property_string($migration_format, $migration);
     }
 
+    if (my $replication = $res->{replication}) {
+        $res->{replication} = parse_property_string($replication_format, $replication);
+    }
+
     if (my $next_id = $res->{'next-id'}) {
         $res->{'next-id'} = parse_property_string($next_id_format, $next_id);
     }
-- 
2.39.5





More information about the pve-devel mailing list