# ezjail on two zfs pools



## trumee (Sep 10, 2017)

I have few jails running on zpool tank which consists of slow hard disks. I would like to create a jail on tank1 comprising of SSDs. Is it possible for ezjail to have jails spanning over two pools?


----------



## edenist (Aug 1, 2018)

Sorry for the necro, but this is one of the only places I found someone else asking this question, and there wasn't a solution posted anywhere else.

But alas, I did work out how to get it working with ezjail.
It's easy to become confusing, as you have to keep in mind both zfs volume location and their associated mountpoints.

Let's assume you have two zpools, tank1 and tank2.

Ezjail is configured to install jails with the following default locations:
volume: tank1/jails/<jailname>
mountpoint: /usr/jails/<jailname>

These are defined in /usr/local/etc/ezjail.conf, as *ezjail_jailzfs* and *ezjail_jaildir*, respectively.

To create a regular jail, you would run, for example:
`ezjail-admin create -c zfs newjailname 'lo1|127.0.1.1,em0|192.168.1.201/24'`


To place a jail on a different zpool, I would recommend creating another zfs volume in tank2 to keep things somewhat consistent:
`zfs create -o mountpoint=/usr/fastjails tank2/fastjails`

Then, we simply instruct ezjail to create the new jail as per normal but with -z and -r options, which overrides the default *ezjail_jailzfs* and *ezjail_jaildir* locations from earlier, respectively.
`ezjail-admin create -c zfs -z tank2/fastjails -r /usr/fastjails/newjailname newjailname 'lo1|127.0.1.1,em0|192.168.1.201/24'`

You've now got a new jail located in /usr/fastjails/newjailname which is sitting on your fast tank2 storage.


----------

