From: Kefu Chai <k.chai@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager] ceph: osd: create: accept multiple Ceph networks
Date: Fri, 9 Oct 2026 11:15:55 +0800 [thread overview]
Message-ID: <20261009031555.3414265-1-k.chai@proxmox.com> (raw)
Ceph allows public_network and cluster_network to be a comma-separated
list of subnets, and monitor creation has handled that since commit
0b6a2838 [0]. The OSD create check still passed the whole value to
`ip address show to`, which rejects a list, so creating an OSD failed
on every node of a cluster with more than one subnet.
Check each subnet and accept the node if it has an address in any of
them, since an OSD binds to one address. Also name the checked option
in the error message: it always said "cluster network", even when the
value came from the public_network fallback.
[0] https://bugzilla.proxmox.com/show_bug.cgi?id=2422
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
PVE/API2/Ceph/OSD.pm | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index c5c20140..43bd5ac0 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -6,6 +6,7 @@ use warnings;
use Cwd qw(abs_path);
use IO::File;
use JSON;
+use List::Util qw(any);
use UUID;
use PVE::Ceph::Tools;
@@ -340,17 +341,18 @@ __PACKAGE__->register_method({
my $ceph_conf = cfs_read_file('ceph.conf');
+ my $osd_net_opt = 'cluster_network';
my $osd_network = $ceph_conf->{global}->{cluster_network};
- $osd_network //= $ceph_conf->{global}->{public_network}; # fallback
-
- if ($osd_network) { # check only if something is configured
- my $cluster_net_ips = PVE::Network::get_local_ip_from_cidr($osd_network);
- if (scalar(@$cluster_net_ips) < 1) {
- my $osd_net_obj = PVE::Network::IP_from_cidr($osd_network);
- my $osd_base_cidr = $osd_net_obj->{ip} . "/" . $osd_net_obj->{prefixlen};
+ if (!$osd_network) { # fallback, also when empty like ceph does
+ $osd_net_opt = 'public_network';
+ $osd_network = $ceph_conf->{global}->{public_network};
+ }
+ my @osd_nets = PVE::Tools::split_list($osd_network);
+ if (@osd_nets) { # check only if something is configured
+ if (!any { scalar(@{ PVE::Network::get_local_ip_from_cidr($_) }) } @osd_nets) {
die
- "No address from ceph cluster network (${osd_base_cidr}) found on node '$nodename'. "
+ "No address from ceph $osd_net_opt ($osd_network) found on node '$nodename'. "
. "Check your network config.\n";
}
}
--
2.47.3
reply other threads:[~2026-10-09 3:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261009031555.3414265-1-k.chai@proxmox.com \
--to=k.chai@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox