Unable to change permissions to /etc/ceph/ceph.conf (pmxcfs issue), in order to run ceph status?

Discussion in 'Proxmox VE: Installation and configuration' started by victorhooi, Mar 15, 2019.

  1. victorhooi

    victorhooi Member

    Joined:
    Apr 3, 2018
    Messages:
    111
    Likes Received:
    6
    I'm attempting to setup Telegraf to monitor my Proxmox Ceph cluster.

    Hitting a couple of issues (mostly around permissions):

    https://github.com/influxdata/telegraf/issues/5590

    but I appear to be nearly there. (I had to install sudo on Proxmox in order to do testing - curious if there's a reason sudo isn't included out of the box?)

    However, one thing is that still not working is ceph status. Specifically:

    Code:
    root@syd1:/etc/ceph# sudo -u telegraf ceph status
    2019-03-16 06:37:31.558292 7f3ee7ed1700 -1 Errors while parsing config file!
    2019-03-16 06:37:31.558295 7f3ee7ed1700 -1 parse_file: cannot open /etc/ceph/ceph.conf: (13) Permission denied
    Error initializing cluster client: PermissionDeniedError('error calling conf_read_file',)
    If I check that file:
    Code:
    root@syd1:/etc/ceph# ls -lah
    total 16K
    drwxr-xr-x  2 root root 4.0K Mar 16 06:18 .
    drwxr-xr-x 96 root root 4.0K Mar 16 06:09 ..
    -rw-------  1 ceph ceph  159 Mar 14 07:45 ceph.client.admin.keyring
    lrwxrwxrwx  1 root root   18 Mar 14 07:43 ceph.conf -> /etc/pve/ceph.conf
    -rw-r--r--  1 root root   92 Nov 20 07:29 rbdmap
    
    If I try to change the group ownership of that file:
    Code:
    root@syd1:/etc/ceph# chown root:ceph ceph.conf
    chown: changing ownership of 'ceph.conf': Operation not permitted
    
    I assume this is perhaps related to the pmxcfs? (The wiki mentions that changing permissions isn't supported).

    Is there a workaround, or another way of granting a non-root user access to
    /etc/ceph/ceph.conf?
     
  2. victorhooi

    victorhooi Member

    Joined:
    Apr 3, 2018
    Messages:
    111
    Likes Received:
    6
    Actually, I was able to grant the telegraf user permission to those files by adding it to the www-data group.

    Code:
    root@syd1:/etc/ceph# usermod -a -G www-data telegraf
    root@syd1:/etc/ceph# groups telegraf
    telegraf : telegraf www-data ceph
    
    However, I then hit a second issue around permissions again:
    Code:
    root@syd1:/etc/ceph# sudo -u telegraf ceph status
    2019-03-16 07:06:43.990909 7f2349b98700 -1 auth: unable to find a keyring on /etc/pve/priv/ceph.client.admin.keyring: (13) Permission denied
    2019-03-16 07:06:43.990916 7f2349b98700  0 librados: client.admin initialization error (13) Permission denied
    [errno 13] error connecting to the cluster
    
    There definitely is a keyring file, and it is owned by group www-data:
    Code:
    root@syd1:/etc/pve/priv# ls -lah /etc/pve/priv/ceph.client.admin.keyring
    -rw------- 1 root www-data 63 Mar 14 07:45 /etc/pve/priv/ceph.client.admin.keyring
    
    Is there something specific about Proxmox's Ceph configuration/keyring setup I'm missing here?
     
  3. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    16,433
    Likes Received:
    301
    First, the keyring file is owned by root, and the group has no access for security reasons.

    You simply cannot change the file permissions on /etc/pve. If you have other requirements, you need to copy the files into another location where you can do what you want.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Alwin

    Alwin Proxmox Staff Member
    Staff Member

    Joined:
    Aug 1, 2017
    Messages:
    2,097
    Likes Received:
    184
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice