[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] ZFS? [WAS] Re: Problem with "archive" command in 3.0b



Graham Todd wrote:
> 
> ZFS?
> ---
> 
> Since work must be staring on a new 'development version' ;-) let me
> suggest exploring one new feature here on the list: "zfs support".  Of
> course there's really nothing special needed for this but perhaps a "-z"
> switch for a new jail type ("ezjail-admin create -z /root/to/zfs/jail")
> could wrap a useful subset of zfs and jail creation functions together.
> Everything *can* be done outside of ezjail and maybe *should* be
> separated.  Still it might be interesting to explore making using ezjail
> & zfs together ... easy. While ZFS properties like xattr, acls, etc
> should probably be set using the zfs utility things like size and
> location could be handled at ezjail-admin create time.
> 
> In terms of usage patterns have done things like the following:
> 
> - Set up jails on zfs filesystems on a dedicated zpool and symlinked
> them under /usr/jails e.g.
> 
> zfs create jailtank/sandbox_bellanet_org
> ln -s /jailtank/sandbox_bellanet_org /usr/jails/
> ezjail-admin create -r /usr/jails/sandbox_bellanet_org \
>    sandbox.bellanet.org 172.16.1.8
> 
>    ... etc. as per normal setup
> 
> - Setup /usr/jails/ as a zfs mountpoint and added jail filesystems
> inside it:
> 
> zfs create -o mountpoint=/usr/jails/ jailtank/jails
> zfs create jailtank/jails/jail1_dom_net
> zfs create jailtank/jails/jail2_dom_net
> zfs create jailtank/jails/jail1_otherdom_net
> 
>   ... then fed those to ezjail-admin create -r etc.
> 
> There's other things you can do with the zfs property mountpoint=legacy,
> zfs volumes (which allow UFS to be used), snapshots and send/import for
> backup, etc. but for ezjail purposes there should probably be a standard
> "ezajil" way to do things with zfs that is basic and easy to figure out.
> 
> There's no rush since a lot of zfs users are still in the experiment and
> test stage.  Maybe Dirk can watch and learn from our shared experiences
> to come up with the most ezjail-ish approach to using ZFS.

Now that you mention it.. I have a patched version of ezjail using ZFS
features to do the ezjail magic.

Currently the script is on a server that is turned of, so expect a
download location not before next monday.

What the script can do already:

- takes the ZFS filesystem settings from ezjail.conf, jail-filesystem
name (e.g. tank/jails)
- it creates the tank/jails filesystem if it does not exist
- creates an seperate filesystem for basejail and newjail (e.g.
tank/jails/basejail, tank/jails/newjail)
- when updating basejail, it takes snapshots before he writes anything
- new jails are copied via zfs send/recv from a tank/jails/newjail
snapshot creating a new zfs-filesystem for every new jail
- deleting jails with -w deletes the jail filesystem

And some other stuff that I have forgotten and can tell you about when I
have the code in front of me ;-)

Currently the patch is ZFS or not ZFS, so if you enable ZFS in
ezjail.conf you have to use all the ZFS stuff, exept when you create
image-jails. I'm not sure if this is the right choice, but I guess we
can discuss that now :-)

And I haven't tested anything with freebsd-update, I run current as ZFS
is much more stable in there but of course no freebsd-update is
available for CURRENT ;-)

More on monday.

greetings,
cryx