* [Qemu] Passing config options to librados
@ 2011-03-15 12:20 Wido den Hollander
2011-03-15 21:37 ` Josh Durgin
0 siblings, 1 reply; 2+ messages in thread
From: Wido den Hollander @ 2011-03-15 12:20 UTC (permalink / raw)
To: ceph-devel
Hi all,
While testing with Qemu-KVM and RBD I got:
Unable to find any monitors in the configuration file, because there is
no configuration file. Please specify monitors via -m monaddr or -c
ceph.conf
qemu-system-x86_64: -drive file=rbd:rbd/beta,format=rbd: error
connecting
qemu: could not open disk image rbd:rbd/beta: No such file or directory
Some searching through the source-code showed me that ceph.conf isn't
read by librados anymore, but you have to force this with
rados_conf_read_file
The current RBD code doesn't do this, thus leaving librados
unconfigured.
I'm using the patch below to force reading the ceph.conf, but imho that
is not flexible enough.
The current RBD code has no way of reading config options from Qemu and
converting them into librados options by rados_conf_set() nor specifying
a conf file to be read by rados_conf_read_file().
Something that still has to be implemented or am I missing something?
Wido
From 03cfbebf1363b89bca6c97beb90e30e04add5db9 Mon Sep 17 00:00:00 2001
From: Wido den Hollander <wido@widodh.nl>
Date: Tue, 15 Mar 2011 13:11:24 +0100
Subject: [PATCH] librados: Force reading ceph.conf
Signed-off-by: Wido den Hollander <wido@widodh.nl>
---
block/rbd.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/block/rbd.c b/block/rbd.c
index f722cb4..7cd12f4 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -222,6 +222,11 @@ static int qemu_rbd_create(const char *filename,
QEMUOptionParameter *options)
return -EIO;
}
+ if (rados_conf_read_file(cluster, "/etc/ceph/ceph.conf") < 0) {
+ error_report("error reading configuration file");
+ return -EIO;
+ }
+
if (rados_connect(cluster) < 0) {
error_report("error connecting");
rados_shutdown(cluster);
@@ -351,6 +356,11 @@ static int qemu_rbd_open(BlockDriverState *bs,
const char *filename, int flags)
return r;
}
+ if ((r = rados_conf_read_file(s->cluster, "/etc/ceph/ceph.conf")) <
0) {
+ error_report("error reading configuration file");
+ return r;
+ }
+
if ((r = rados_connect(s->cluster)) < 0) {
error_report("error connecting");
rados_shutdown(s->cluster);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Qemu] Passing config options to librados
2011-03-15 12:20 [Qemu] Passing config options to librados Wido den Hollander
@ 2011-03-15 21:37 ` Josh Durgin
0 siblings, 0 replies; 2+ messages in thread
From: Josh Durgin @ 2011-03-15 21:37 UTC (permalink / raw)
To: Wido den Hollander; +Cc: ceph-devel
On 03/15/2011 05:20 AM, Wido den Hollander wrote:
> I'm using the patch below to force reading the ceph.conf, but imho that
> is not flexible enough.
rados_conf_read_file(cluster, NULL) will use the default
locations now (/etc/ceph/ceph.conf, ~/.ceph/config, and
ceph.conf). I applied a patch like yours that uses the default
locations instead.
> The current RBD code has no way of reading config options from Qemu and
> converting them into librados options by rados_conf_set() nor specifying
> a conf file to be read by rados_conf_read_file().
>
> Something that still has to be implemented or am I missing something?
We plan to allow a config file to be specified for each rbd
drive -- something like rbd:pool/image:path/to/conf like you
suggested in IRC. This will let you use disks from multiple
clusters in one VM as well.
Thanks,
Josh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-15 21:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 12:20 [Qemu] Passing config options to librados Wido den Hollander
2011-03-15 21:37 ` Josh Durgin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.