LVM on top of linux zfs to use Openstack with nova-volume

LVM on top of linux zfs to use Openstack with nova-volume

LVM on top of linux zfs to use Openstack with nova-volume
Did you ever wanted to know how to setup LVM on top of linux zfs to use Openstack with nova-volume? In this article i will describe this in a few easy steps based on my earlier mentioned how to about zfs on linux.


A common problem when using ZFS as storage for openstack is the lack of plugins that will cover as interface between nova-volume/cinder-volume and the block storage types. The volume service needs an LVM Volume group called nova-volumes as default.

In this how-to i will explain you step by step a workaround how to create an block storage device with zfs and get it into lvm.

Prerequisites:

 

Create a ZFS filesystem you will later use as LVM Group:

zfs create -V 500G storage/your_new_volume

The -V switch defines the size of the new created file-system. Change “storage” to you pool name.

Lets see how it looks like:

zfs list
Command Output:
NAME                            USED  AVAIL  REFER  MOUNTPOINT
storage/your_new_volume   516G  1.78T    76K  -

There you see your new created file-system without an mountpoint.

We now need to get its real device path:

file /dev/zvol/storage/your_new_volume
Command output: 
/dev/zvol/storage/your_new_volume: symbolic link to `../../<strong>zd0</strong>'

So our real device path is: /dev/zd0

Let’s do the magic part:

losetup /dev/loop2 /dev/zd0

And create a partition on that device:

fdisk /dev/loop2
(and hit: n p 1 ENTER ENTER t 8e w)

Finally we can create our LVM volume group:

pvcreate /dev/loop2
vgcreate nova-volumes /dev/loop2

 

We now need to make clear that the loop device gets mounted on the next boot:

Modify the file called /etc/rc.local in your preferred editor and enter following:

exec losetup /dev/loop2 /dev/zd0

And that’s it!

6 thoughts on “LVM on top of linux zfs to use Openstack with nova-volume”

    1. Hi Lorin,

      yes i did tried this driver some times before but it was very buggy and not reliable enough.
      I’m gonna check if that have changed today.

      1. If you do encounter bugs, please let me know. I’d like to add a section in the OpenStack documentation about running the ZFS backend with Linux, but I have no idea whether it actually works or not.

  1. And just what is the point of this? Would you put this into production? I wouldn’t. ZFS on Linux? Stop kidding yourself. For ZFS in production there is only Solaris 11, so you have support just in case it goes belly up.

    1. ZFSonLinux is a Native port of Solaris version. It supports the same Pool features, so i see no reason why not to try and use it. Since im working with it, it works flawless on my servers and if you ask me it doesn’t make really no difference which OS it’s running on if the port translation is implented well like the project maintainer done it. Btrfs which comes from Oracle and was praised as ZFS alternative isn’t even suitable (buggy/instable/crap) although it was exclusive intended for linux. So there are no alternatives but since zfsonlinux is running that good i don’t really care and need no alternatives.
      Btw. Not just Solaris 11 supports production ready ZFS and if you ask me, solaris isn’t solaris anymore since SUN was bought from Oracle.
      There are also other great OSes which have production ready ZFS support like: FreeBSD which i preffer, OpenSolaris, Illumos, and SmartOS (Illumos fork).

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>