From 217dde83f0e537d05db76b2be2a0f98f3ba9052a Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 3 Jul 2019 15:53:41 +0200 Subject: [PATCH] ceph: osd: use get-or-create to create a bootstrap-osd key on demand if for some reason the cluster does not have this key, generate it Signed-off-by: Dominik Csapak --- PVE/API2/Ceph/OSD.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm index 064f6b03..85197107 100644 --- a/PVE/API2/Ceph/OSD.pm +++ b/PVE/API2/Ceph/OSD.pm @@ -313,7 +313,14 @@ __PACKAGE__->register_method ({ my $ceph_bootstrap_osd_keyring = PVE::Ceph::Tools::get_config('ceph_bootstrap_osd_keyring'); if (! -f $ceph_bootstrap_osd_keyring && $ceph_conf->{global}->{auth_client_required} eq 'cephx') { - my $bindata = $rados->mon_command({ prefix => 'auth get', entity => 'client.bootstrap-osd', format => 'plain' }); + my $bindata = $rados->mon_command({ + prefix => 'auth get-or-create', + entity => 'client.bootstrap-osd', + caps => [ + 'mon' => 'allow profile bootstrap-osd' + ], + format => 'plain', + }); file_set_contents($ceph_bootstrap_osd_keyring, $bindata); };