I'd say that ZFS is still way more mature and useful than BTFS at this point. The use of writeable clones
is a good use case for ZFS.
UnionFS/Fuse is terribly slow. Native "ZFS on linux" is a special kernel module that can't be re-distributed
as part of an application. Because of these restrictions the only current high performance re-distribututable
ZFS solutions I know of are on based on OpenIndiana ( NexentaStor) and FreeBSD ( FreeNAS )
NexentStor is commercial ,but free for personal use up to 18TB, and FreeNAS is free but not opensource, and
Nas4Free is opensource fork of FreeNAS before it was sold.
The legal issues of shipping "ZFS on Linux" with your product.
For performance and reliability reasons, ZFS is written to run on native hardware, and not have any
RAID disk controller in the picture. If your running as a VM this is problematic as you have no
access to raw disks.
Best practice is to always create a number redundant vdev's . This means that a minimal
system is 2 disks (mirrored) to become 1 vdev. You add capacity by adding additional
vdev's of the same type. So you can add additional 2-disk mirrors and get both more
capacity in the pool and 2X write performance (Write performance scales with number of
vDev's , not number of disks )
Unfortunately on standard shared storage each of your mirrors will also be backed by a
RAID-N array, so you may be storing up to 4X of data in the case of a mirrored vDev
on top of a RAID-10 physical array.
So your solution on Vmware could be a vAPP composed of virtual storage / NAS VM running
OpenIndiana or FreeBSD, and and a teacher VM Linux desktop. The students can
connect Linux desktops / VM's via NFS to the NAS storage. The vApp could run from
a VM Workstation on a Laptop with SSD, or vSphere
Using a GUI such as FreeNAS would allow very simple cloning , or for a bunch of students
write a script to run on the NAS box to atomate the cloning. In practice the master disk
would have one or more snapshots ( each snapshot representing a version of
the master to distribute ) Then a script to clone master/snap2 to student1, student2, etc.
Another script to nfsmount the clones zfs set nfsmount, and another scrip to destroy the used
If you use 'studentX' the script would only need to prompt for # of clones. , etc
and not require any changes. In the event something went wrong the FreeNAS
gui could be used to view the results or make easy changes/fixes without
This could really simplify what you need to do and avoid the legal issues above
buy just using an off-the-shelf solution like FreeNAS. It should also speed up
your learning of ZFS quite a bit.
There are other niche solutions. SmartOS is a OpenIndian based hypervisor running from
a thumb drive and running ZFS in the root zone, as well as 'solaris' style zones
for VM's ( each VM of which is a write-able clone of the OS ) that is automatically
mounted as a new ZFS mount when you create the VM.
Joyant (creator of SmartOS) also added KVM capability to zones , so you can even run Linux as a zone
under SmartOS, so in theory you could have a Master OS desktop template that
runs under KVM, and then clone that template desktop out for each student and
each of those are storing only the deltas from the master.
SmartOS is controlled from command line, or open source tools, or commercial tools
from Joyant ( SmartOS is the hypervisor for Joyant's hosted cloud data-center ) SmartOS
is based on local ZFS storage in each hypervisor, not shared storage like VMware.
If this is to be distributed and used by many people, I'd highly recommend using a NAS distribution
with a GUI for ease of use. I've recently switched all my storage ( 10TB) or so from Nexenta over to
FreeNAS. I can recommend FreeNAS 9.3-STABLE that just came out a few months ago.
From: "K.S. Bhaskar" <firstname.lastname@example.org>
To: "Philadelphia Linux User's Group Discussion List" <email@example.com>
Sent: Saturday, January 31, 2015 12:16:02 PM
Subject: [PLUG] zfs vs btrfs vs …
I am trying to create a virtual machine to be used to teach electronic health records for a class by giving each student a configured application s/he can then use, e.g., to record treatments. The application includes a database of several GB. I would like to give each student an individual database to work with, but would prefer not to have to give each student a separate copy of the database, when 99% of the database will be the same for all of them.
My current plan is to create the database on filesystem such as btrfs or zfs with a master copy of the database. To add a student, a script would take a snapshot of the filesystem (or preferably just a sub-tree at directory in the file system) and mount the snapshot with copy-on-write in a different place for each student. For example, if I had a /home/master, one might snapshot the master subdirectory and make it available at /home/adam and /home/eve. Now Adam and Eve can each have a complete database, with one master copy, but each time one of them updates the database, the blocks in the filesystem on which the modified parts of the database live would be copied. The additional space used is for modifications by each student.
I am trying to decide between zfs and btrfs. One advantage of zfs over btrfs appears to be that the snapshots can be auto-mounted without editing /etc/fstab - with btrfs, adding 30 students to the class would seem to require 30 entries in /etc/fstab. I have zero experience in zfs, and barely any experience with btrfs, so this will be a learning experience for me.
A couple of questions, please:
- For this application, are there any considerations other than mounting in choosing between zfs and btrfs?
- Should I explore some other alternative, along the lines of unionfs-fuse? A filesystem in userspace hs the advantage of not requiring root to create a copy, but at least unionfs-fuse does copy-on-write at the file level, not the block level, so each student would end up with a complete copy of the database. So, unionfs-fuse itself is out.
Thank you very much, in advance, for advice, opinions, and pointers.
P.S. My other challenge is to create scripting that is bullet-proof, because the virtual machine could be used in many classes at many institutions. Many instructors will not be very computer savvy, and I want to minimize support. But at least on this, I have a fair amount of experience, although not for anything this complicated.
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
"Between subtle shading and the absence of light lies the nuance of iqlusion..." - Kryptos
Lee Marzke, firstname.lastname@example.org http://marzke.net/lee/
IT Consultant, VMware, VCenter, SAN storage, infrastructure, SW CM
+1 800-393-5217 office +1 484-348-2230 fax
+1 610-564-4932 cell sip://email@example.com VOIP