Creating a new jail template

Status
Not open for further replies.

Biggeek

Dabbler
Joined
Dec 26, 2013
Messages
40
I'm playing with the idea of creating a jail template.
My template is a tar'ed up Linux box with a preconfigured application on it.
I have read over the instructions and have my .tgz file.

I am unable to find this answer in the documentation.
If it is there and I missed it, I apologize now.

When creating the template, I have added the URL field to point to the local FTP server.
I placed the file in a dir on the FreeNas box, which the FTP server has access to. (its actually in the root of the ftp server, mount point)

What I don't see, is what credentials FreeNas uses when actually creating the jail, and using that specified template.

Does FreeNAS use anonymous ftp to grab the .tgz file?

If anyone also has an experience in creating jail templates, I'd love to hear from you.
My end goal is to create a few templates with either freebsd or linux in them , running other apps.

TIA
 
J

jkh

Guest
When creating the template, I have added the URL field to point to the local FTP server.
I placed the file in a dir on the FreeNas box, which the FTP server has access to. (its actually in the root of the ftp server, mount point)

What I don't see, is what credentials FreeNas uses when actually creating the jail, and using that specified template.

I am not sure what you mean by "credentials" - FreeNAS creates jails as root, of course, and simply fetches the jail using a helper (I think curl, but don't quote me on that since I haven't looked at the code). Therefore, if you can't make it an HTTP URL (which you'll notice pretty much all the existing templates are), you might encode the credentials in the FTP URL like so:
 

Biggeek

Dabbler
Joined
Dec 26, 2013
Messages
40
Brilliant. You answered my question.
By credentials, I meant, what does the Freenas use to log into the ftp server that one defines.
If you are saying I should add it into the FTP URL, then I will do so.
I was hesitant to do that, because I didn't want to have to show the password.
I was hoping that FreeNas by default might try anonymous or some default user.

My best bet , for long term scalability, is to use HTTP.

thanks again.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
By credentials, I meant, what does the Freenas use to log into the ftp server that one defines.
If you are saying I should add it into the FTP URL, then I will do so.
I was hesitant to do that, because I didn't want to have to show the password.
I was hoping that FreeNas by default might try anonymous or some default user.
It uses libfetch to get the template. It will use anonymous mode if you do not specify any login/password.
 

Biggeek

Dabbler
Joined
Dec 26, 2013
Messages
40
thanks.
One thing I'm noticing now is I can't delete the template I made.
It shows 0 instances, opposed to the others that show -1
The ones that show -1, when selected, show the delete button, but mine does not.

Is there a way to remove this entry via cli?
Just need to know the path, and hopefully not break anything that is dependent on it.
 

Biggeek

Dabbler
Joined
Dec 26, 2013
Messages
40
after creating a syslog dataset, I was able to look at some log files.
Pointed me int he direction of /mnt/vol01/jails
I see a .warden-template-(mytemplate)/

Looks like I should be able to delete this, no?
 
J

jkh

Guest
after creating a syslog dataset, I was able to look at some log files.
Pointed me int he direction of /mnt/vol01/jails
I see a .warden-template-(mytemplate)/

Looks like I should be able to delete this, no?

Maybe. I dunno, it might be a bad idea to go behind the warden system's back. Is "garbage collection" of the template such a big deal? This is fixed in 9.2.1 already, so if you could just leave it around until it's time to install that build, you could do it more safely.
 
J

John Hixson

Guest
after creating a syslog dataset, I was able to look at some log files.
Pointed me int he direction of /mnt/vol01/jails
I see a .warden-template-(mytemplate)/

Looks like I should be able to delete this, no?

-1 means there are no instances and the template has not yet been created
0 means the there are no instances and the template has been created
> 0 means the template has been created and is being used

To delete the template with 0 instances you'll have to do it from the CLI. This has been fixed in 9.2.1. How you do so is this:
To get a listing of templates:

warden template list

Pick the template you wish to delete then type this:

warden template delete NAME

I hope this helps.

- John
 
Status
Not open for further replies.
Top