[sheepdog] [Sheepdog]Openstack support sheepdog matters?

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Jan 17 07:52:53 CET 2013


At Thu, 17 Jan 2013 00:07:23 +0800,
harryxiyou wrote:
> 
> On Wed, Jan 16, 2013 at 4:24 PM, MORITA Kazutaka
> <morita.kazutaka at lab.ntt.co.jp> wrote:
> > At Wed, 16 Jan 2013 16:03:36 +0800,
> [...]
> > In the Cinder branch.
> >
> > https://github.com/openstack/cinder/blob/master/cinder/volume/drivers/sheepdog.py
> 
> Yup, it does merge into Cinder branch but i also find changes in
> Openstack Nova branch
> like https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py
>  (the file's 122
> line).  I think the change in Nova branch is to let Nova use sheepdog
> volume by making
> sheepdog like a library, right? And if there are other parts in
> Openstack codes need modify
> for sopporting sheepdog?

What do you mean by 'library'?

I looked at the nova branch, but line 122 doesn't mention sheepdog.
Do you mean line 145 (libvirt_volume_drivers)?

Nova uses libvirt to attach sheepdog volumes to QEMU, and you can
create, snapshot, and clone sheepdog volumes from Cinder, IIUC.  Does
this answer your question?

> 
> Actually, i don't have thoughts about how Openstack support Sheepdog
> if we use ISCSI
> way(though we now let Openstack support Sheepdog by Qemu/libvirt way).
> Could Morita
> have some suggestions?

Are you using iSCSI volumes from Cinder?  Then you can use sheepdog by
setting volume_driver to cinder.conf.  Add the following line to the
DEFAULT section of cinder.conf:

volume_driver = cinder.volume.drivers.sheepdog.SheepdogDriver

I've noticed that we need the following patch to use sheepdog
successfully with Cinder.  I'll send this one to Cinder community
later.  With this patch, I could create sheepdog volumes and boot from
it with OpenStack.

diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py
index ed1466d..a041a7a 100644
--- a/cinder/volume/drivers/sheepdog.py
+++ b/cinder/volume/drivers/sheepdog.py
@@ -46,6 +46,11 @@ class SheepdogDriver(driver.VolumeDriver):
             exception_message = _("Sheepdog is not working")
             raise exception.VolumeBackendAPIException(data=exception_message)
 
+    def _sizestr(self, size_in_g):
+        if int(size_in_g) == 0:
+            return '100M'
+        return '%sG' % size_in_g
+
     def create_cloned_volume(self, volume, src_vref):
         raise NotImplementedError()



More information about the sheepdog mailing list