From 78f99813bbee37ff0286ff36f58be4790d0f8fdb Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 28 Jun 2019 13:22:27 +0200 Subject: [PATCH] ceph: mon create: fix not starting monitor if no public_addr is in conf when there is no 'public_network' in the config, the monitor can only find an ip if it is given explicitly, either via commandline (not possible with systemd) or via the ceph.conf Signed-off-by: Dominik Csapak --- PVE/API2/Ceph/MON.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm index d86df30b..b8fde40e 100644 --- a/PVE/API2/Ceph/MON.pm +++ b/PVE/API2/Ceph/MON.pm @@ -265,6 +265,11 @@ __PACKAGE__->register_method ({ my $monhost = $cfg->{global}->{mon_host} // ""; $monhost .= " $ip"; $cfg->{global}->{mon_host} = $monhost; + if (!defined($cfg->{global}->{public_network})) { + # if there is no info about the public_network + # we have to set it explicitely for the monitor + $cfg->{$monsection}->{public_addr} = $ip; + } cfs_write_file('ceph.conf', $cfg);