[pve-devel] [PATCH manager] ceph: mon create: fix not starting monitor if no public_addr is in conf

Dominik Csapak d.csapak at proxmox.com
Fri Jun 28 13:22:27 CEST 2019


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 <d.csapak at proxmox.com>
---
 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);
 
-- 
2.20.1





More information about the pve-devel mailing list