From ff57d3697752d67d40f98f0324432f326ea17350 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 27 Jul 2017 15:02:41 +0200 Subject: [PATCH] fix creating the first ceph monitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we cannot use a rados connection before having at least one monitor, so we have to move it down Signed-off-by: Dominik Csapak (backported from commit 738ce0f235daf46aecedab3e33147d871d3959fa) Signed-off-by: Fabian Grünbichler --- PVE/API2/Ceph.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm index 6e7a8879..1d92a904 100644 --- a/PVE/API2/Ceph.pm +++ b/PVE/API2/Ceph.pm @@ -967,14 +967,13 @@ __PACKAGE__->register_method ({ my $monmap = "/tmp/monmap"; - my $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout')); - eval { mkdir $mondir; run_command("chown ceph:ceph $mondir") if $systemd_managed; if ($moncount > 0) { + my $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout')); my $mapdata = $rados->mon_command({ prefix => 'mon getmap', format => 'plain' }); PVE::Tools::file_set_contents($monmap, $mapdata); } else { @@ -1008,6 +1007,7 @@ __PACKAGE__->register_method ({ # create manager if (!$param->{'exclude-manager'} && PVE::CephTools::check_ceph_mgr_installed(1)) { + my $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout')); $create_mgr->($rados, $monid); } };