Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to connect for limited access user #21

Open
oferb1 opened this issue Mar 16, 2017 · 0 comments
Open

Fails to connect for limited access user #21

oferb1 opened this issue Mar 16, 2017 · 0 comments

Comments

@oferb1
Copy link

oferb1 commented Mar 16, 2017

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant