Warden Templates

shmixx

Dabbler
Joined
Dec 30, 2013
Messages
37
I just wanted to ask for some clarification on the creation of Warden Templates. I've included a screenshot which shows the growing list of Warden Templates in my system in the jails data store.

What I'm curious about is why I have almost double the amount of template files, as I do jails. And additionally, why I have templates for jail types that (to my knowledge) are not being used or haven't been created. i.e. the Ubuntu template, I'm pretty certain no jail is using Ubuntu.

In the grand scheme of things, it's only a couple GB I'm probably losing from this excess data, but from an organization perspective it drives me nuts looking at this, and I'd just like to understand how the warden template function really works. I'm imagining there should be a base template for the jails leveraging the pluginjail-x64, and perhaps some delta updates for changes to the core template. I don't understand however the need to have 6-7 of the same core template, and then 6 other extraneous ones as well.

Lastly, if I can remove or clean up some of these, how would I do so? I tried removing the Ubuntu one for example from the terminal, and was denied access even with sudo. And how could I protect myself (snapshots perhaps?) from damaging my current jails in case removing a template does break or cause issue with a jail that is currently running?
 

Attachments

  • Screen Shot 2014-11-18 at 12.12.11 PM.png
    Screen Shot 2014-11-18 at 12.12.11 PM.png
    116.3 KB · Views: 348

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
This could be a good feature request. To clean up stale templates. If you know how you can remove them yourself but it isn't easy and you can get yourself into a pickle because you are going behind the GUI's back. I have done it and it involved unmounting it and modifying the FreeNAS database then deleting it out of warden I think. I would not suggest this for just anybody to do, if you really want to do it you will have to figure it out on your own.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Templates don't exactly go "stale". Once created they shouldn't ever need to be touched. Also, the templates use 1-2GB (that's horribly overestimating their size too) so aside from the fact that you might think they aren't used anymore, deleting them can end very badly for you.

In the bigger picture, I personally haven't tried to delete the templates because there's too much risk of things going very wrong and very little fix, and the only benefit is you are saving a few GB on a pool that is probably measured in TB. We're talking about a rounding error for your pool in it's total size, so not something to be particularly upset about. ;)
 
D

dlavigne

Guest
This is fixed in 9.3 as there is only two built-in templates.
 

SmallGuy

Guru
Joined
Jun 7, 2013
Messages
560
I've managed it from my side, because I had an old 9.1 template, and some unused templates created for testing purpose. Since those deletion, I don't have any trouble.
I'm agree with SweetAndLow, you have to figure it out on your own.
Cyberjock advice is also good because there 0 risk.


Now, if you're ready to learn, and perhaps doing mistakes... This is the way to go:
Take this as indications, not instructions, remember your are on your own:

Thumb rule N°1: Do not remove what you don't know what it is

1) Identify clearly the template you want to remove
2) You need to be sure there isn't any more jail attached to the template with the "Instances" column in jail tab=>template. If no jail are attached to the template, the value should be 0. Value of 1 (or more) means a jail (or more) is (are) attached. Value of -1 means no template for this kind of jail is installed.
3) If a jail is attached to the template, you need to delete the jail first using the GUI (begin by stopping the jail, then deleting the plugin if a plugin is installed, but I think no jail nor plugin are installed if you want to remove the template...)
4) You have to consider the template as a dataset. Using the GUI, go to Storage tab=>Active Volumes, and delete the corresponding dataset (under your jail dataset "jails_dataset_name/.warden-template-blahblah")
5) Then, through the CLI remove the ".warden-template-blahblah" tree as a directory.
6) By the way, check the URL of your templates , and edit them if necessary (have a look at http://download.freenas.org/)

7) By the way, check the collection URL in the jail configuration tab.

Good luck
 

lilfree

Cadet
Joined
Jun 12, 2017
Messages
3
Got wxactly the same situation in freenas 11.1-u6
What if no templates appear when you are in the jail's template section of the GUI?? I got two plugins working but lots of warden templates's snapshots. so when I navigate with my computer to the jails directory I can see the same things as aytacdede screenshot. their name is followed with the version and the "date", but may of them are from the same version but not from the same date.
 
Top