mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 14:51:37 +00:00
fix creating the first ceph monitor
we cannot use a rados connection before having at least one monitor, so we have to move it down Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> (backported from commit 738ce0f235daf46aecedab3e33147d871d3959fa) Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
a898d93362
commit
ff57d36977
@ -967,14 +967,13 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
my $monmap = "/tmp/monmap";
|
my $monmap = "/tmp/monmap";
|
||||||
|
|
||||||
my $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout'));
|
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
mkdir $mondir;
|
mkdir $mondir;
|
||||||
|
|
||||||
run_command("chown ceph:ceph $mondir") if $systemd_managed;
|
run_command("chown ceph:ceph $mondir") if $systemd_managed;
|
||||||
|
|
||||||
if ($moncount > 0) {
|
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' });
|
my $mapdata = $rados->mon_command({ prefix => 'mon getmap', format => 'plain' });
|
||||||
PVE::Tools::file_set_contents($monmap, $mapdata);
|
PVE::Tools::file_set_contents($monmap, $mapdata);
|
||||||
} else {
|
} else {
|
||||||
@ -1008,6 +1007,7 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
# create manager
|
# create manager
|
||||||
if (!$param->{'exclude-manager'} && PVE::CephTools::check_ceph_mgr_installed(1)) {
|
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);
|
$create_mgr->($rados, $monid);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user