The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 jail + zfs
Author: tld 
Date:   25-08-08 12:49


ezjail isn't the fun way to play with jails. ZFS is.

First of all, the /etc/rc.d/jail script has been quite updated, and will take care of the day-to-day stuff, such as starting and stopping jails.

Simply define:

jail_psql_devfs_ruleset="devfsrules_jail" # devfs ruleset to apply to jail

And you can do:

/etc/rc.d/jail start psql

That's it. No need for a port to retrofit this.

Also, for the fun part. If you throw in ZFS in the loop, you get better control over disk usage (pr. jail or even pr. dir quotas, compression, redundancy-levels etc).

You can also snapshot jails.

That's right. If you're going to upgrade a jailed "machine", just snapshot it, test it, and roll back if there's a problem. If you have read-write userdata, simply put it in a separate zfs, and you can do it with parts of the "virtual machine".

But wait! There's more!

If you can create a base config, with most of the things you'll typically need for a jail, you can then snapshot and clone it.

If you have a base jail, and you'd like to install a 4MB package in addition to your standard stuff, the entire jail will only take up that 4MB of space.

You save RAM too. I think. Not entirely sure how ZFS fits into the FreeBSD page system, but since you're running your libc and whatnot from the same disk pages for all your jails, I'd think it's quite likely you'll save up some RAM too.

Sounds like a good plan?

Reply To This Message
 Re: jail + zfs
Author: Dan 
Date:   25-08-08 13:44

tld wrote:

> Sounds like a good plan?

All except: ZFS isn't quite ready for production, from everything I've heard.


Reply To This Message
 Re: jail + zfs
Author: tld 
Date:   26-08-08 08:50

Details, details. ;)

ZFS is "different" for a lot of FreeBSD people. We're used to anything in FreeBSD being stable on anything it can run on. ZFS seems to have issues on low memory i386 machines, but work quite well on amd64 machines with 4GB+.

In other words, I guess it all depends on your needs. ZFS also offers a lot of convenient features which are tempting to have in production, such as protection against silent datacorruption (seen that a couple of times too many), being able to use all the space effectively without downtime for reinstall, etc etc.

Might not want to dive in and convert anythign and everything to run ZFS, but it's definitively ready for testing out.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum