Add storage to warden jail from cli

Status
Not open for further replies.

AndersG

Dabbler
Joined
Oct 1, 2015
Messages
13
I'm trying to automate maintenance of a mysql clone. To do this I will set up a cron job to make snapshots of the original database dataset, create a clone from the snapshot and then mount the clone to a jail running mysql.

I cannot find any instructions for how to remove/add storage for a jail mount point from cli. I tested to use warden fstab, but the changes are not reflected to the UI and as soon as i start the jail again the fstab changes are gone.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think you might be flogging a dead horse there... the settings are in the config DB if I'm not mistaken, so that means at every opportunity, the FreeNAS code will overwrite CLI changes with what's in the database (like you mention on a restart of the jail).

Iocage behaves more like what you are expecting to see, so I would recommend to switch to iocage jails (which you will need to do soon enough anyway).
 

AndersG

Dabbler
Joined
Oct 1, 2015
Messages
13
Thanks for your reply!

I guess there are no cli commands to update the database?

I'm started out with iocage but stumbled on networking. The mysql clone has to be published on a separate nic, on a network where the address space is very limited. Shared IP seems to only be able to route traffic over the hosts default route, and VNET seems a bit experimental and not very documented. Any help is welcome my thread related to that
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
AndersG said:
I guess there are no cli commands to update the database?

There might be, but I'm not aware of any.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You might want to look at the last couple of posts in this thread

By default iocage jails will join vnet0 when you set them to use vnet and vnet0 will join bridge0 (so you don't need to do that). "addm igb0 up" on "ifconfig_bridge0" works well for me. You can test that before creating the tunable by just using:

ifconfig bridge0 addm igb0 up

use ifconfig alone to see the outcome (look for members under bridge0 and you should see your nic and vnet0 there when a jail has been started)

in a shell
 

AndersG

Dabbler
Joined
Oct 1, 2015
Messages
13
Thanks! I will have a try with iocage and vnet then.

Tunables was the missing piece for me. Just got aware of them yesterday. :smile:
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I guess there are no cli commands to update the database?
There are; it's a sqlite database, so you can manipulate it with any compatible tools, though you'd then need to tell the middleware to do its thing, and I really don't know how you'd do that. FreeNAS has an API that you can call to accomplish most of what you can do through the GUI, though. Or just use iocage, which is probably the better way to go.
 
Status
Not open for further replies.
Top