[pve-devel] [PATCH manager 4/4] ceph: mon create: add known monitor ips to mon_host if it is empty

Dominik Csapak d.csapak at proxmox.com
Wed Jul 3 15:53:43 CEST 2019


this fixes an issue where only one monitor is in mon_host, which is
offline, prevents a client connection

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph/MON.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index df73450a..b59d2e59 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -265,6 +265,12 @@ __PACKAGE__->register_method ({
 
 		# update ceph.conf
 		my $monhost = $cfg->{global}->{mon_host} // "";
+		# add all known monitor ips to mon_host if it does not exist
+		if (!defined($cfg->{global}->{mon_host})) {
+		    for my $mon (sort keys %$monhash) {
+			$monhost .= " " . $monhash->{$mon}->{addr};
+		    }
+		}
 		$monhost .= " $ip";
 		$cfg->{global}->{mon_host} = $monhost;
 		if (!defined($cfg->{global}->{public_network})) {
-- 
2.20.1





More information about the pve-devel mailing list