Re: LibCephFS Python Mount Failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Bogdan,

I’m running this script at the moment as my development system’s root user account, I don’t have a particular ceph user on this standalone system, and I don’t think I’ll be able to control the user account of the monitoring hosts either (I think they might run under a user account dedicated to the monitoring) but I’m interested to what you think I should test here?

I can definitely run the code as the root user, it can read my custom configuration and key files, when I specify those providing the admin user credentials, it works as expected, but when I specify the monitoring credentials it errors with that ceph_init message.

My script can open and read the configuration and key files (I print those to screen), and I do attempt to pull back the environment before I execute the mount, and it does include my addition of the CEPH_ARGS. That said, those also work when those particular files are for the admin ceph account, and that can’t be picking up anything from the default locations as I’ve deliberately removed them from there.

Is there any way to make the Python LibCephFS more verbose to better understand its error message?

Adam.

From: Bogdan Adrian Velica <vbogdan@xxxxxxxxx>
Sent: 25 July 2022 14:50
To: Adam Carrgilson (NBI) <Adam.Carrgilson@xxxxxxxxx>
Cc: ceph-users@xxxxxxx
Subject: Re:  LibCephFS Python Mount Failure

Hi Adam,

I think this might be related to the user you are running the script as, try running the scrip as ceph user (or the user you are running your ceph with). Also make sure the variable os.environ.get is used (i might be mistaking here). do a print or something first to see the key is loaded. Just my 2 cents...

Best of luck,

 --
Bogdan Velica
Ceph Support Engineer

croit GmbH, Freseniusstr. 31h, 81247 Munich
Com. register: Amtsgericht Munich HRB 231263
Web: https://croit.io<https://croit.io/>

On Mon, Jul 25, 2022 at 4:06 PM Adam Carrgilson (NBI) <Adam.Carrgilson@xxxxxxxxx<mailto:Adam.Carrgilson@xxxxxxxxx>> wrote:
Hi all,

I'm trying to put together a script to gather CephFS quota utilisation.
I'm using the CephFS Python library from here: https://docs.ceph.com/en/latest/cephfs/api/libcephfs-py/
and I've followed the rather a good guide on how to use it here: https://jayjeetc.medium.com/up-and-running-with-libcephfs-7629455f0cdc#934a

I have been able to get this working, however; I want this to be able to be portable to run it on our monitoring agents, and specifically, I want to be able to use a limited permission account, so read-only permissions and network limitations.
I originally couldn't find a method to specify a custom keyfile to use through the library, but with some assistance, I've found that I can use the Python command: os.environ["CEPH_ARGS"] = "--keyring=/path/to/keyring" to provide the library with that which works great (with my admin account).

And therein lies the error, I've created an account just for this use case, but when I provide the keyfile with those credentials, I get the response: OSError(13, 'error calling ceph_init')
I can give the limited permission account capabilities matching the admin account, but it continues to fail in the same way, pointing to it not being a permissions issue.

Is there something obvious that I've done wrong, or an alternative method that might be a better approach, how can I get this to function for my monitoring?

I've installed python-cephfs through my systems package manager, it's version 14.2.22, and I'm connecting through to a Nautilus system which is likewise version 14.2.22.

Many Thanks,
Adam.

_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx<mailto:ceph-users@xxxxxxx>
To unsubscribe send an email to ceph-users-leave@xxxxxxx<mailto:ceph-users-leave@xxxxxxx>
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux