iocage jails vs plugins.

Status
Not open for further replies.

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
I'm up to about 7 jails on my FreeNAS (all using iocage). I've recently started making some plugins as well. I've come to point where the difference between creating a jail or a plugin is trivial. One thing I noticed is all the mount points in the plugin. Does this have an advantage or disadvantage over regular jail
I would suspect from the looks of the mount points that maybe updating the RELEASE would update all plugins? So that has me wondering... in the future is it better to create a plugin or a jail. Are there advantages to one over the other or is a plugin just a simple way to share something thats creates a preconfigured jail?

upload_2018-6-12_0-39-3.png


fstab from jail
upload_2018-6-12_0-57-13.png

fstab from plugin
upload_2018-6-12_0-59-19.png
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Never mind me. I wasn't able to see your screen shots from my phone. You are talking about something else.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Hi @Chris Moore. Thanks for the reply. I apologize for my lack of written communication skills (especially bad in the middle of the night). As you already figured from my screenshots I am talking about the difference between iocage jails vs iocage plugins. I have completely moved away from the old Warden system. Based on information I have already found (iocage docs and FreeNAS guide) I have been able to create both jails and plugins using iocage. I'm looking for more information on any advantages or disadvantages of installed plugins vs jails. To be clear Im looking for info about managing a jail or plugin moving forward after it has been installed.

I first thought that creating a plugin was basically a way to easily create a fully configured jail. But as shown in the third screen shot I realize this difference may not be so straight forward. (for example 13 nullfs mount points created by the plugin) The documentation has been a great regarding getting things up and running but I trying to understand if there is an advantage of using a plugin or jail when both are available.

For one example, as I mentioned I am running 7 iocage jails and based on the updating section of the iocage docs. I am just managing each jail as if it were its own separate computer. This is pretty straight forward for each jail but if I want to update all 7 jails then I have to run the update commands 7 times (once in each jail). I'm wondering if there is a better way I could have created my jails that would for example allow updating a single base and it would apply the updates to all 7 jails. The iocage section on jail types briefly discusses some different options.

All 7 jails I have created so far are of the "clone" type jail. The docs mention creating a "base" jail and states "Basejails mount their fstab mounts at each startup. They are ideal for environments where immediate patching or upgrading of multiple jails is required." So it's pretty straight forward to create a base jail instead of a clone but I'm missing how I could use this base jail to create my other jails so I could take advantage of "upgrading of multiple jails". Maybe I'm just not understand the differences between base jails and clone jails? Also what is actually happening when I create a plugin? Its a plugin its own thing or is it creating a basejail or clone jail. Based on all the nullfs mount points, I think a plugin is creating a base jail. This is were Im getting confused.

So basically Im looking for general information about when to use a plugin vs using a jail. Managing an individual jail after the install seems straight forward. What is the best approach for creating when Im using/managing 7 (soon to be 10) jails? If I made these jails into plugins would there be any benefits... For example when it comes to keeping everything updated? I thought I had this pretty much figured out but now I'm realizing I don't even know what I don't know o_O Hopefully this makes some sense to help clarify what Im looking for.

I guess I could just be making this more complicated then it needs to be? For now, I already have all my jails working and I handle each one on a case by case basis. I could just continue this way and everything will be fine. But I do not want to be missing out on a better way to do things because I am missing information or not understanding the information I do have correctly. I would like to eventually share some guides and/or plugins but I don't want to be making bad decisions while Im doing it.

Thanks again for taking time to respond
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I was under the impression that plugins created on even the latest 11.1-U5 version of FreeNAS resulted in a Warden jail using a FreeBSD 11.0 template, which is already EOL?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I was under the impression that plugins created on even the latest 11.1-U5 version of FreeNAS resulted in a Warden jail using a FreeBSD 11.0 template, which is already EOL?
That is why I was apologizing, I was thinking that too, but he is talking about iocage not warden.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Personally I would hold off on this until the new gui is live. In it's current state it is still quite buggy.

Speaking of which, what version of FreeNAS are you running?
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
I was under the impression that plugins created on even the latest 11.1-U5 version of FreeNAS resulted in a Warden jail using a FreeBSD 11.0 template, which is already EOL?
Yes I believe this is true IF using the Web GUI. I am using the CLI to create jails or plugins based on iocage NOT the old warden system. Also as seen the first screenshot of OP shows both iocage jail and iocage plugin running 11.1RELEASE-p10.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Personally I would hold off on this until the new gui is live. In it's current state it is still quite buggy.

Speaking of which, what version of FreeNAS are you running?
I actually haven't had any problems (knock on wood) using iocage. I switched to using the CLI and iocage on FreeNAS when I was on FreeNAS 11.1-U2. I started writing and testing this guide for Home Assistant on 11.1-U3 and completed it on 11.1-U4. I made my first plugin for Home Assistant on FreeNAS 11.1-U4 and have tested it with 11.1-U5.

Currently my main FreeNAS is running 11.1-U5.

Note to self: I like how some people have their server info in the signature. That's a great way to be sure some basic info is always included. I need to do this myself.
 
Last edited:

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
It's all above my pay grade :D Now I know you can create a iocage plugin (albeit through the CLI) I'll be sure to check out your Home-Assistant one. I'm using a Docker container for that at the minute, but might look to switch...
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
It's all above my pay grade :D Now I know you can create a iocage plugin (albeit through the CLI) I'll be sure to check out your Home-Assistant one. I'm using a Docker container for that at the minute, but might look to switch...

I'm sure you know then that HA will no longer install or run using the 11.0-Template. Which is the exact reason I started using iocage... to get HA working again on FreeNAS. The only official plugin I use is Emby. Just FYI you can install official FreeNAS plugins using iocage as well. But yes at this time is requires using the CLI. I'm actually realizing that iocage is so easy to use I will probably continue on the CLI even after 11.2 releases.

You can see the official plugin list iocage list --plugins --remote

The HA plugin I made is pretty neat I think to try out because it has AppDaemon and Configurator both installed and working as well. I think it's safe to use as an installer but once its running and modified config files to match you set up I think It would still need to be updated manually. The Plugin requires two command to install. I've been working on another version that will install as a jail instead. It requires four commands instead of two. I don't know which way is better. That's leading me to this post. I know how to make a jail or a plugin but I don't understand why I should make one or the the other.

I'm trying to figure this out because I can make the same basic install for the other stuff Im using along with HA. So far I have Mosquito, TasmoAdmin, Node-Red, Dasher, AppDaemon, Configurator, Bubble-Upnp Server, GMusicProxy. I'm not trying to reinvent Hass.io but I would like to help people spend less time getting HA and friends setup so there's more time for pulling hair out trying to understand how to create yaml automations, lol. I really need to figure out if I should share these as jails or plugin and why one choice is better then another.

As far as installing... like I said the difference is trivial.
2 commands installs a plugin
4 commands installs the same thing as a jail.
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
A jail creation and install script such as @danb35 has done for Nextcloud should be doable.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
A jail creation and install script such as @danb35 has done for Nextcloud should be doable.
Yes... I have a script that will create my jail and install what I'd like. I can also do the same thing and create a plugin. So if I can do both things... this leads to the million dollar question.

Should I make jails or plugins?

This is the general information Im trying to find that explains why I should choose one or the other.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Well one advantage that I can think of for a scripted jail install vs plugin is the end user not being reliant on the plugin creator/maintainer to keep the plugin up to date. If it's a standard jail with a scripted install pkg upgrade should be all that's needed to keep most things up to date. This is of course dependent upon what you are installing.

I assume you know python to be creating plugins? I find this very interesting but far beyond my scope of knowledge.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Should I make jails or plugins?
Make whichever you prefer--as I understand it, plugins in the iocage setting aren't too different in principle from what I've done with the Nextcloud script. It isn't like the bad old days of warden and .pbi plugins, where literally one person on the planet knew how to build them.

And, though I'm sure you realize this, I should clarify that plugins are jails. Somewhat specialized jails, yes, but still jails.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Well one advantage that I can think of for a scripted jail install vs plugin is the end user not being reliant on the plugin creator/maintainer to keep the plugin up to date. If it's a standard jail with a scripted install pkg upgrade should be all that's needed to keep most things up to date. This is of course dependent upon what you are installing.
Perfect! I think this is good enough a reason for me. Jails would be the better option. Especially something like Home Assistant that has a two week release cycle. I have time for this now but when work is busy I won't have time to maintain a plugin. I was definitely not using it as intended. It really just seemed like an easy way to combine a pkg-list.json with a way way to download an install script (post_install.sh) put some files in place (overlay folder)

I think all want is to make a script to create a jail and install said app. I not trying to anything complicated just save people some time from having to copy and paste from a guide. (ok maybe still one or two commands to get the install started but that's it) I have a few simple ideas to include that will help people (and myself) doing the repeat stuff like updating. For the most part people should be on their own to manage after getting things running. I just don't think I have the complete knowledge or experience to be making decisions for everybody like creating and maintaining a plugin seems to imply

I assume you know python to be creating plugins? I find this very interesting but far beyond my scope of knowledge.
Actually I don't know the first thing about python. In fact I'm just learning some basic bash scripting and managed to get this far! I'm really learning almost everything as I go. Basically a super noob (probably why I cant even ask a clear question) Anyways making a plugin is super easy. If you know about a pkg-list.json when creating jails and have a simple install script (I used bash because my main computer is linux and that's all I really know about) your already done with the work. All that's left is to put it together. I can give an example using something simple like mosquitto if you'd like.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
Make whichever you prefer--as I understand it, plugins in the iocage setting aren't too different in principle from what I've done with the Nextcloud script. It isn't like the bad old days of warden and .pbi plugins, where literally one person on the planet knew how to build them.

And, though I'm sure you realize this, I should clarify that plugins are jails. Somewhat specialized jails, yes, but still jails.

Thanks! I was already assuming that plugins were jails. When I actually made a plugin and saw the fstab, I starting wondering about the "specialized" part. I just can't figure out what that means so I'm gonna stick with "jails" for now.
So understanding they are basically the same thing using the term "plugin" means the "somewhat specialized jail"

The more I think about this.... It just makes more sense to start with a script to create "jail" If at a later time it's discovered that installing as a "plugin" has some advantage you could just have the post_install.sh of the "plugin" execute the script you have already created for the jail. Bam! Done! you wouldn't even have to copy and paste from one script to another
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
The plugins are meant for novice users or users who don't want to install and configure things manually. The point of a plugin is to push a button in the GUI to install it and be done with it.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
There seems to be a new kid on the block in the form of .json scripts that can simplify the creation of a jail and installation of components to run a service, or is this what's been run when someone clicks a plugin button on 11.2?
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
The "plugin" provides a method to easily create a pre-configured jail on FreeNAS. I understand how to create both a "standard jail" and a "plugin jail" My original question was more related to if there were differences AFTER the install has completed. For example when creating a plugin; you can use the overlay directory to basically "copy" files to the plugin being created. This is usefully to provide a modified configuration file.

So lets say I create a plugin using the overlay directory to provide a modified config file. Next you install this plugin and my config is "overlayed" to the original config file provided by whatever app in the jail. Now lets say you want to edit the same config file I provided using the overlay. Will you changes be lost after reboot?
Are files provided in the overlay applied at every reboot or are they psychically copied into place during the install?


As another example:
This is the first difference I noticed: See mount point shared with the "RELEASE" (pictures in first post)
I came across this simply trying to create a link to /bin/bash.

Example below you see "plugin" vs "jail"
Code:
[troy@vNas76 ~]$ sudo iocage list -l
+-----+------------+------+-------+----------+------------------+---------------------+-----+----------+
| JID |	NAME	| BOOT | STATE |   TYPE   |	 RELEASE	  |		 IP4		 | IP6 | TEMPLATE |
+=====+============+======+=======+==========+==================+=====================+=====+==========+
| 1   | hass-3io   | on   | up	| pluginv2 | 11.1-RELEASE-p10 | epair0b|192.0.1.102 | -   | -		|
+-----+------------+------+-------+----------+------------------+---------------------+-----+----------+
| 17  | hass-dev   | on   | up	| jail	 | 11.2-RELEASE-p3  | epair0b|192.0.1.140 | -   | -		|
+-----+------------+------+-------+----------+------------------+---------------------+-----+----------+


In a "standard jail" this will work just fine
Code:
[troy@vNas76 ~]$
[troy@vNas76 ~]$ sudo iocage console hass-dev
root@hass-dev:~ # ln -s /usr/local/bin/bash /bin/bash
root@hass-dev:~ #


In a "plugin jail" permission is denied because of the Read Only file system
Code:
[troy@vNas76 ~]$
[troy@vNas76 ~]$ sudo iocage console hass-3io
root@hass-3io:~ # ln -s /usr/local/bin/bash /bin/bash
ln: /bin/bash: Read-only file system
root@hass-dev:~ #


The original question of this thread was asking about these differences. While a "plugin jail" and a "standard jail" may be very similar there a still SOME differences. I was just trying to figure out what these are
 
Last edited:
Status
Not open for further replies.
Top