Skip to content

Fails to connect for limited access user #21

@oferb1

Description

@oferb1

I have a user with the following auth entry in ceph:

client.libvirt
	key: [secret]
	caps: [mon] allow r
	caps: [osd] allow class-read object_prefix rbd_children, allow rwx pool=libvirt-pool

Following this guide http://docs.ceph.com/docs/hammer/rbd/libvirt/

here is a sample code, that fails with this user

'use strict'
const rados = require('rados');

console.log('testing with admin account');
let cluster = new rados.Rados('ceph', 'client.admin', '/etc/ceph/ceph.conf');
let err = cluster.connect();
if (err !== 0) {
  console.log(`Failed to connect with error ${err}`);
} else {
  console.log(`fsid: ${cluster.get_fsid()}`);
}

console.log('testing with libvirt account');
cluster = new rados.Rados('ceph', 'client.libvirt', '/etc/ceph/ceph.libvirt.conf');
err = cluster.connect();
if (err !== 0) {
  console.log(`Failed to connect with error ${err}`);
} else { 
  console.log(`fsid: ${cluster.get_fsid()}`);
}

The output is:

testing with admin account
fsid: a3bc6d05-198a-47c2-b3de-b19eb022e406
testing with libvirt account
Failed to connect with error 95

the same user using the rbd tool works fine

# rbd -c /etc/ceph/ceph.libvirt.conf -k /etc/ceph/ceph.client.libvirt.keyring --id libvirt ls libvirt-pool
new-libvirt-image
#

ceph.libvirt.conf

mon_host = 192.168.1.32
keyring = ceph.client.libvirt.keyring

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions