Jurgen Segaert
Guru
- Joined
- Jul 10, 2016
- Messages
- 521
My understanding is that for the first case, the template will be read-only and can not be deleted unless the 6 basejails first deleted. But the 6 basejails can be update with one `iocage update`
For the second case, the 6 clones are copies of the basejail's snapshot (thus relying on the existence of the basejail). Nevertheless, the basejail is still writable. Moreover, here also, one `iocage update` will update all jails.
For the first case, once a jail is converted to a template, it becomes read only. That is correct.
You can then create other jails from that template, using all the same options that creating jails from a release offer.
These options determine the type of the resulting jails, not the template. As part of playing with this, I discovered that creating a template of a basejail had issues, the jails created from such template did not start. In the example below, I use a thick jail as a template, as this makes the template the most portable.
Code:
sudo iocage create -n templ -t -r 11.3-RELEASE sudo iocage set template=1 templ sudo iocage create -n jailfromtempl -t templ sudo iocage create -n bjailfromtempl -b -t templ sudo iocage create -n tjailfromtempl -T -t templ sudo iocage list -l +-----+-----------------+------+-------+----------+-----------------+---------------------+-----+-----------+----------+ | JID | NAME | BOOT | STATE | TYPE | RELEASE | IP4 | IP6 | TEMPLATE | BASEJAIL | +=====+=================+======+=======+==========+=================+=====================+=====+===========+==========+ | - | bjailfromtempl | off | down | jail | 11.3-RELEASE-p7 | - | - | - | yes | +-----+-----------------+------+-------+----------+-----------------+---------------------+-----+-----------+----------+ | - | jailfromtempl | off | down | jail | 11.3-RELEASE-p7 | - | - | templ | no | +-----+-----------------+------+-------+----------+-----------------+---------------------+-----+-----------+----------+ | - | tjailfromtempl | off | down | jail | 11.3-RELEASE-p7 | - | - | - | no | +-----+-----------------+------+-------+----------+-----------------+---------------------+-----+-----------+----------+
Only when you create the jails with the -b option, it will be a base jail. The default case jailfromtempl is a clone jail and relies on the templ to exist, the others do not.
For the second case, iocage also provides flexibility on how to create the clone.
Code:
sudo iocage create -n baseclone -b -r 11.3-RELEASE sudo iocage clone -n clonedjail baseclone sudo iocage clone -T -n thickclonedjail baseclone
In this example, both clonedjail and thickclonedjail are base jails of 11.3-RELEASE, and updating one will indeed update all base jails. The thickclonedjail (created with the -T option) is a "thick jail". It has no longer a dependency on baseclone, the base jail it was cloned from, at the cost of some extra disc space. The clonedjail jail is a pure clone, relying on the existence of the basejail, and initially very small in size.
I would recommend to try some of the examples in this thread out and see how the resulting jails fit your specific use case. It will be a great learning experience.