My major reasons for using jails is the ability to replace one with another across machines if required, so I can
* scale hardware
* develop software
* fail over and fail back
* load balance
as required. Here is how I migrate jails between machines with theBrig.
Compared to other jail managers like iocage, theBrig is somewhat rudimentary software. On the other hand it has the advantage to come as an extension to XigmaNAS. As such it neatly ligns up with the other GUI controls and does not require a "full" XigmaNAS installation. This was important to me as I chose an embedded "root on zfs" install where the boot medium is mirrored.
In short, I did this:
- move the jail's files from server A to server B (see below)
- create a fresh jail with theBrig on B
- pull theBrig's XML configuration from TheBrig > Maintenance > Backup/Restore
- change the name and location of the fresh jail to the imported one
- feed back the edited XML file to theBrig
- refresh the theBrig page and click on Start
Code: Select all
tar -cvf myjail.tar myjailThe fresh jail was created as a dataset. So another dataset for the migrated jail was created with
Code: Select all
zfs create dataset <mypool>/<mydataset>The tarball was unpacked into this dataset with
Code: Select all
tar -xvf myjail.tarThe actual files of the freshly created jail can then be removed. If you created the fresh jail as a dataset,
Code: Select all
zfs listCode: Select all
zfs destroy <mypool>/<freshdataset>If the jail will not start after a few seconds, you may want to check
Code: Select all
<thebrig installation location>/thebrig.logCode: Select all
jexec <myjail> shCode: Select all
jexec <myjail> login <some non-privileged user>Once inside the migrated jail you want to make sure local services are aware of the current IP address you gave to the fresh jail.
In my case A runs XigmaNAS 11.2.0.4 while B runs XigmaNAS 12.0.0.4. The latter comes with the brandnew version 12 of FreeBSD so I expected problems -- and was surprised to not get any. Right now I am working on updating the jail with freebsd-update.




