[pve-devel] [PATCH manager 1/4] ceph: osd create: check for auth before getting bootstrap key

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


we do not need it if auth is 'none'

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

diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index 42dee361..064f6b03 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -309,9 +309,10 @@ __PACKAGE__->register_method ({
 	my $fsid = $monstat->{monmap}->{fsid};
         $fsid = $1 if $fsid =~ m/^([0-9a-f\-]+)$/;
 
+	my $ceph_conf = cfs_read_file('ceph.conf');
 	my $ceph_bootstrap_osd_keyring = PVE::Ceph::Tools::get_config('ceph_bootstrap_osd_keyring');
 
-	if (! -f $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' });
 	    file_set_contents($ceph_bootstrap_osd_keyring, $bindata);
 	};
-- 
2.20.1





More information about the pve-devel mailing list