[pve-devel] [PATCH manager 3/3] Fix #2422: allow multiple Ceph public networks

Alwin Antreich a.antreich at proxmox.com
Wed Mar 11 16:22:37 CET 2020


Multiple public networks can be defined in the ceph.conf. The networks
need to be routed to each other.

On first service start the Ceph MON will register itself with one of the
IPs configured locally, matching one of the public networks defined in
the ceph.conf.

Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
---
 PVE/API2/Ceph/MON.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index 3baeac52..5128fea2 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -33,11 +33,19 @@ my $find_mon_ip = sub {
     }
     $pubnet //= $cfg->{global}->{public_network};
 
+    my $public_nets = [ PVE::Tools::split_list($pubnet) ];
+    warn "Multiple ceph public networks detected on $node: $pubnet\n".
+    "Networks must be capable of routing to each other.\n" if scalar(@$public_nets) > 1;
+
     if (!$pubnet) {
 	return $overwrite_ip // PVE::Cluster::remote_node_ip($node);
     }
 
-    my $allowed_ips = PVE::Network::get_local_ip_from_cidr($pubnet);
+    my $allowed_ips;
+    foreach my $net (@$public_nets) {
+        push @$allowed_ips, @{ PVE::Network::get_local_ip_from_cidr($net) };
+    }
+
     die "No active IP found for the requested ceph public network '$pubnet' on node '$node'\n"
 	if scalar(@$allowed_ips) < 1;
 
-- 
2.20.1





More information about the pve-devel mailing list