kvm driver
Subsystems (2)
Hi Sage,
since you where talking about a kvm driver storage driver lately, I wanted to let you know that I've started writing such a driver.
Getting the driver - called "rbd" (Rados Block Device) - to a basic working state was not that hard. However there still is a problem when used together with the kvm raw-aio driver (i.e. for attaching a virtual cdrom). My suspicion is, that the signal handling used inside librados and the one inside the kvm raw driver conflicts. I've already tried to build a work around and the situation got slightly better, but I'm still experiencing timeout problems in the raw-aio driver.
The patch for qemu-0.12.3 is attached. I would appreciate it if someone with a deeper understanding of the signal handling in librados and/or kvm could have a look.
Your opinion on the naming scheme used to store the objects of the device image is welcome, too. (see comment in the code for details)
Thanks,
Christian
Signature · 1 line
Christian Brunner <[email protected]>
Makefile renamed from Makefile.orig +2 -1
@@ -28,6 +28,7 @@ VPATH=$(SRC_PATH):$(SRC_PATH)/hw LIBS+=-lz $(LIBS_TOOLS) +LIBS+=-lrados ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
@@ -110,7 +111,7 @@ block-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o -block-nested-y += parallels.o nbd.o +block-nested-y += parallels.o nbd.o rbd.o block-nested-$(CONFIG_WIN32) += raw-win32.o block-nested-$(CONFIG_POSIX) += raw-posix.o block-nested-$(CONFIG_CURL) += curl.o
Makefile.target renamed from Makefile.target.orig +1 -0
@@ -27,6 +27,7 @@ PROGS=$(QEMU_PROG) LIBS+=-lm +LIBS+=-lrados kvm.o kvm-all.o: QEMU_CFLAGS+=$(KVM_CFLAGS)
block/rbd.c renamed from block/rbd.c.orig +357 -0
357 lines not on this page · raw message
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ceph-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ceph-devel
Hi Christian,
This looks great!
Quoted 11 lines · Christian Brunner
since you where talking about a kvm driver storage driver lately, I wanted to let you know that I've started writing such a driver.
Getting the driver - called "rbd" (Rados Block Device) - to a basic working state was not that hard. However there still is a problem when used together with the kvm raw-aio driver (i.e. for attaching a virtual cdrom). My suspicion is, that the signal handling used inside librados and the one inside the kvm raw driver conflicts. I've already tried to build a work around and the situation got slightly better, but I'm still experiencing timeout problems in the raw-aio driver.
Quoted 3 lines
The patch for qemu-0.12.3 is attached. I would appreciate it if someone with a deeper understanding of the signal handling in librados and/or kvm could have a look.
Yehuda is taking a look at it now. The signals are used to wake up blocking read()/write()/connect(), but we should be able to use poll() or select() instead (and clean things up in the process).
Quoted 2 lines
Your opinion on the naming scheme used to store the objects of the device image is welcome, too. (see comment in the code for details)
I would number the objects in hex so that it's easier to translate a block or byte offset to an object (maybe just sprintf(n, "%s.%08llx", ...)). And then name the metadata object something more explicit, like %s.head or %s.metadata or something along those lines.
Also, the object size should probably be a parameter in the header object, so that you can specify whatever stripe size you want when creating the device (4MB is somewhat arbitrary). The same goes for the block size too, I guess (is 4K a more reasonable default?).
Is there any particular reason to restrict the 'device name' to 12 chars?
I look forward to trying this out once we have the signals sorted out. sage
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Quoted 5 lines · Sage Weil
Yehuda is taking a look at it now. The signals are used to wake up blocking read()/write()/connect(), but we should be able to use
poll()orselect()instead (and clean things up in the process).
A fix was pushed to the unstable branch.
Thanks,
Yehuda
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Quoted 8 lines · Sage Weil
Quoted 4 lines
The patch for qemu-0.12.3 is attached. I would appreciate it if someone with a deeper understanding of the signal handling in librados and/or kvm could have a look.
Yehuda is taking a look at it now. The signals are used to wake up blocking read()/write()/connect(), but we should be able to use
poll()orselect()instead (and clean things up in the process).
Great! - That was really a quick response. I will check out the current git version tomorrow and will give it a try.
Quoted 9 lines
I would number the objects in hex so that it's easier to translate a block or byte offset to an object (maybe just
sprintf(n, "%s.%08llx", ...)). And then name the metadata object something more explicit, like %s.head or %s.metadata or something along those lines.Also, the object size should probably be a parameter in the header object, so that you can specify whatever stripe size you want when creating the device (4MB is somewhat arbitrary). The same goes for the block size too, I guess (is 4K a more reasonable default?).
OK. I will do that. (I'm not sure about how kvm handles the block size, but I'll look into it).
Quoted 1 line
Is there any particular reason to restrict the 'device name' to 12 chars?
On the ceph blog I have read that the name of an object is a fixed-size 20 byte identifier. That's why I've chosen to use a base64 encoded sequence number. This sequence number requires 8 bytes to store, so there are 12 bytes left for the 'device name'. If this is no longer a restriction, using longer names (with a hex encoding of the sequence number) would make sense.
Christian
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Quoted 8 lines · Christian Brunner
Quoted 1 line · Sage Weil
Is there any particular reason to restrict the 'device name' to 12 chars?
On the ceph blog I have read that the name of an object is a fixed-size 20 byte identifier. That's why I've chosen to use a base64 encoded sequence number. This sequence number requires 8 bytes to store, so there are 12 bytes left for the 'device name'. If this is no longer a restriction, using longer names (with a hex encoding of the sequence number) would make sense.
Oh, yeah, that restriction was removed a while ago now. The object name is now an arbitrary string, so you can use whatever is most convenient.
Let us know how it goes!
sage
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
Quoted 6 lines
Quoted 3 lines
Yehuda is taking a look at it now. The signals are used to wake up blocking read()/write()/connect(), but we should be able to use
poll()orselect()instead (and clean things up in the process).Great! - That was really a quick response. I will check out the current git version tomorrow and will give it a try.
I couldn't resist to try it today. I had to make a minor change regarding pthread handling. Now everything seems to work well. An updated patch is attached. - Thanks for the quick solution.
I haven't changed the naming scheme yet. I will do this in a few days.
Christian
Makefile renamed from Makefile.orig +2 -1
@@ -28,6 +28,7 @@ VPATH=$(SRC_PATH):$(SRC_PATH)/hw LIBS+=-lz $(LIBS_TOOLS) +LIBS+=-lrados ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
@@ -110,7 +111,7 @@ block-nested-y += cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o -block-nested-y += parallels.o nbd.o +block-nested-y += parallels.o nbd.o rbd.o block-nested-$(CONFIG_WIN32) += raw-win32.o block-nested-$(CONFIG_POSIX) += raw-posix.o block-nested-$(CONFIG_CURL) += curl.o
Makefile.target renamed from Makefile.target.orig +1 -0
@@ -27,6 +27,7 @@ PROGS=$(QEMU_PROG) LIBS+=-lm +LIBS+=-lrados kvm.o kvm-all.o: QEMU_CFLAGS+=$(KVM_CFLAGS)
block/rbd.c renamed from block/rbd.c.orig +344 -0
344 lines not on this page · raw message
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ceph-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ceph-devel
Quoted 10 lines · Christian Brunner
Quoted 6 lines
Quoted 3 lines
Yehuda is taking a look at it now. The signals are used to wake up blocking read()/write()/connect(), but we should be able to use
poll()orselect()instead (and clean things up in the process).Great! - That was really a quick response. I will check out the current git version tomorrow and will give it a try.
I couldn't resist to try it today. I had to make a minor change regarding pthread handling. Now everything seems to work well. An updated patch is attached. - Thanks for the quick solution.
Oh, I see the issue. I changed the Ceph Thread class to mask signals on any new threads it creates, so you shouldn't need to worry about it all anymore. (I think you got lucky before: librados does create threads for connecting to servers as it needs them, and those signals weren't getting masked.)
Quoted 1 line
I haven't changed the naming scheme yet. I will do this in a few days.
Sounds good.
Thanks!
sage
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev