Because $mon->{addr} might come with a port attached (affects monitors
created with PVE 5.4 as reported in the community forum [0]), or even
be a hostname (according to the code in Ceph/Services.pm). Although
the latter shouldn't happen for configurations created by PVE.

[0]: https://forum.proxmox.com/threads/105904/

Fixes: 86ed64f9 ("api: ceph: mon: fix handling of IPv6 addresses in 
assert_mon_prerequisites")
Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---
 PVE/API2/Ceph/MON.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index 12c9caf0..5771bb46 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -132,8 +132,10 @@ my $assert_mon_prerequisites = sub {
     for my $mon (values %{$monhash}) {
        next if !defined($mon->{addr});
 
-       my $ip = PVE::Network::canonical_ip($mon->{addr});
-       $used_ips->{$ip} = 1;
+       for my $ip ($ips_from_mon_host->($mon->{addr})->@*) {
+           $ip = PVE::Network::canonical_ip($ip);
+           $used_ips->{$ip} = 1;
+       }
     }
 
     for my $monip (@{$monips}) {
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to