Where are iocage jails stored?

Status
Not open for further replies.
Joined
Dec 2, 2015
Messages
730
I'm trying to learn where iocage jails are stored on FreeNAS 11.1, so I can be sure they are snaspshoted and replicated to my backup server, but I'm baffled. I see /mnt/iocage contains my jails, but iocage isn't a dataset. The output of mount shows that /mnt/iocage is actually from my backup dataset, which is replicated from the main dataset.

/mnt/iocage contains

Questions:

1. Where is the primary storage of the iocage jails?
2. Should I be seeing /mnt/iocage from /mnt/backup/iocage, on my backup dataset?
 

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
You could try zfs list -o name,mountpoint | grep iocage to see where it is located and mounted.
 
Joined
Dec 2, 2015
Messages
730
You could try zfs list -o name,mountpoint | grep iocage to see where it is located and mounted.
That gives me:

Code:
big_bertha# zfs list -o name,mountpoint | grep iocage
backup/iocage												  /mnt/iocage
backup/iocage/download										 /mnt/iocage/download
backup/iocage/download/11.0-RELEASE							/mnt/iocage/download/11.0-RELEASE
backup/iocage/download/11.1-RELEASE							/mnt/iocage/download/11.1-RELEASE
backup/iocage/images										   /mnt/iocage/images
backup/iocage/jails											/mnt/iocage/jails
backup/iocage/jails/handbrake2								 /mnt/iocage/jails/handbrake2
backup/iocage/jails/handbrake2/root							/mnt/iocage/jails/handbrake2/root
backup/iocage/jails/nc										 /mnt/iocage/jails/nc
backup/iocage/jails/nc/root									/mnt/iocage/jails/nc/root
backup/iocage/jails/plex2									  /mnt/iocage/jails/plex2
backup/iocage/jails/plex2/root								 /mnt/iocage/jails/plex2/root
backup/iocage/log											  /mnt/iocage/log
backup/iocage/releases										 /mnt/iocage/releases
backup/iocage/releases/11.1-RELEASE							/mnt/iocage/releases/11.1-RELEASE
backup/iocage/releases/11.1-RELEASE/root					   /mnt/iocage/releases/11.1-RELEASE/root
backup/iocage/templates										/mnt/iocage/templates

big_bertha# cd /mnt/backup/iocage
cd: no such file or directory: /mnt/backup/iocage


Does iocage automatically choose the first pool alphabetically to store the jails? If so, is there a way to switch it to my primary pool, rather than it's current location?
 

Ismael Duarte

Contributor
Joined
Jun 13, 2011
Messages
154
That gives me:

Code:
big_bertha# zfs list -o name,mountpoint | grep iocage
backup/iocage												  /mnt/iocage
backup/iocage/download										 /mnt/iocage/download
backup/iocage/download/11.0-RELEASE							/mnt/iocage/download/11.0-RELEASE
backup/iocage/download/11.1-RELEASE							/mnt/iocage/download/11.1-RELEASE
backup/iocage/images										   /mnt/iocage/images
backup/iocage/jails											/mnt/iocage/jails
backup/iocage/jails/handbrake2								 /mnt/iocage/jails/handbrake2
backup/iocage/jails/handbrake2/root							/mnt/iocage/jails/handbrake2/root
backup/iocage/jails/nc										 /mnt/iocage/jails/nc
backup/iocage/jails/nc/root									/mnt/iocage/jails/nc/root
backup/iocage/jails/plex2									  /mnt/iocage/jails/plex2
backup/iocage/jails/plex2/root								 /mnt/iocage/jails/plex2/root
backup/iocage/log											  /mnt/iocage/log
backup/iocage/releases										 /mnt/iocage/releases
backup/iocage/releases/11.1-RELEASE							/mnt/iocage/releases/11.1-RELEASE
backup/iocage/releases/11.1-RELEASE/root					   /mnt/iocage/releases/11.1-RELEASE/root
backup/iocage/templates										/mnt/iocage/templates

big_bertha# cd /mnt/backup/iocage
cd: no such file or directory: /mnt/backup/iocage


Does iocage automatically choose the first pool alphabetically to store the jails? If so, is there a way to switch it to my primary pool, rather than it's current location?
Search here for 'iocage clean' and 'iocage activate'.

Enviado do meu GT-I9505 através de Tapatalk
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Does iocage automatically choose the first pool alphabetically to store the jails? If so, is there a way to switch it to my primary pool, rather than it's current location?
You know what, I think it does. There's a bug report for that to allow users to choose where iocage should store its stuff.

In the meantime, this should be possible with the iocage CLI, somehow.
 
Joined
Dec 2, 2015
Messages
730
You know what, I think it does. There's a bug report for that to allow users to choose where iocage should store its stuff.

In the meantime, this should be possible with the iocage CLI, somehow.
I wasn't very far into my iocage experiment, so I destroyed everything, activated it on the correct pool using the CLI, and started over with fresh jails.
 
Joined
Dec 2, 2015
Messages
730
Well, even after rolling back to FN-9.10.2-U6, destroying the FN-11.1 boot environment destroying all mounts related to /mnt/iocage on all datasets, updating to FN11.1 and doing a "iocage activate main" to specify the desired pool, I'm still seeing bizarre behaviour.

I created three jails, but the data for two of them eventually disappeared from /mnt/iocage/jails, which makes iocage very unhappy. The jails are still seen in the output of jls, and jexec can be used to enter the jails. /mnt/iocage/jails did show all created jails a few hours ago, but two of the three disappeared at some point, without any obvious user action as a trigger.

This may possibly be related to the periodic, recursive snapshots that are made on my main pool, combined with the replication of said snapshots to the backup pool. zfs list shows both main/iocage and backup/iocage as being mounted at /mnt/iocage

Issue 27534 filed

Code:
big_bertha# iocage list
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 205, in json_load
	with open(self.location + "/config.json", "r") as conf:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/iocage/jails/nc/config.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
	sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
	return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
	rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
	return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
	return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
	return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/list.py", line 114, in cli
	dataset_type, header, _long, _sort, plugin=plugins, quick=quick)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 1194, in list
	exit_on_error=self.exit_on_error).list_datasets()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_list.py", line 76, in list_datasets
	_all = self.list_all(ds)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_list.py", line 154, in list_all
	conf = iocage.lib.ioc_json.IOCJson(mountpoint).json_load()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 302, in json_load
	self.json_convert_from_zfs(uuid, skip=skip)
UnboundLocalError: local variable 'uuid' referenced before assignment

big_bertha# ls -al /mnt/iocage/jails
total 19
drwxr-xr-x  3 root  wheel  3 Jan  1 17:54 .
drwxr-xr-x  8 root  wheel  9 Jan  1 17:53 ..
drwxr-xr-x  3 root  wheel  5 Jan  1 12:05 plex2

big_bertha# jls
   JID  IP Address	  Hostname					  Path
	 1				  owncloud4					 /mnt/main/jails/owncloud4
	 3  192.168.0.222   handbrake2					/mnt/iocage/jails/handbrake2/root
	 4  192.168.0.221   plex2						 /mnt/iocage/jails/plex2/root
	 5  192.168.0.240   nc							/mnt/iocage/jails/nc/root

big_bertha# zfs list -o name,mountpoint | grep iocage
backup/iocage												  /mnt/iocage
backup/iocage/download										 /mnt/iocage/download
backup/iocage/download/11.1-RELEASE							/mnt/iocage/download/11.1-RELEASE
backup/iocage/images										   /mnt/iocage/images
backup/iocage/jails											/mnt/iocage/jails
backup/iocage/jails/handbrake2								 /mnt/iocage/jails/handbrake2
backup/iocage/jails/handbrake2/root							/mnt/iocage/jails/handbrake2/root
backup/iocage/jails/nc										 /mnt/iocage/jails/nc
backup/iocage/jails/nc/root									/mnt/iocage/jails/nc/root
backup/iocage/jails/plex2									  /mnt/iocage/jails/plex2
backup/iocage/jails/plex2/root								 /mnt/iocage/jails/plex2/root
backup/iocage/log											  /mnt/iocage/log
backup/iocage/releases										 /mnt/iocage/releases
backup/iocage/releases/11.1-RELEASE							/mnt/iocage/releases/11.1-RELEASE
backup/iocage/releases/11.1-RELEASE/root					   /mnt/iocage/releases/11.1-RELEASE/root
backup/iocage/templates										/mnt/iocage/templates
main/iocage													/mnt/iocage
main/iocage/download										   /mnt/iocage/download
main/iocage/download/11.1-RELEASE							  /mnt/iocage/download/11.1-RELEASE
main/iocage/images											 /mnt/iocage/images
main/iocage/jails											  /mnt/iocage/jails
main/iocage/jails/handbrake2								   /mnt/iocage/jails/handbrake2
main/iocage/jails/handbrake2/root							  /mnt/iocage/jails/handbrake2/root
main/iocage/jails/nc										   /mnt/iocage/jails/nc
main/iocage/jails/nc/root									  /mnt/iocage/jails/nc/root
main/iocage/jails/plex2										/mnt/iocage/jails/plex2
main/iocage/jails/plex2/root								   /mnt/iocage/jails/plex2/root
main/iocage/log												/mnt/iocage/log
main/iocage/releases										   /mnt/iocage/releases
main/iocage/releases/11.1-RELEASE							  /mnt/iocage/releases/11.1-RELEASE
main/iocage/releases/11.1-RELEASE/root						 /mnt/iocage/releases/11.1-RELEASE/root
main/iocage/templates										  /mnt/iocage/templates
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
So, here's what I think is happening...

You probably went into the legacy Jails UI at some point and set the jail root to the iocage directory in an attempt to make iocage use that pool. (clearly it doesn't work like that, but perhaps you then created some jails with the legacy UI, which would be the warden jails you now see under the jls list).

You can only see warden jails with jls, so that's the best idea I can come up with to explain what you are seeing. You will need to remove the jails from the legacy UI or with warden CLI to get rid of them.

If you have a backup/replica job happening, that would explain your iocage datasets showing up on the backup pool.
 
Status
Not open for further replies.
Top