freebsd / iocage

A FreeBSD jail manager
Other
19 stars 8 forks source link

iocage cannot be used with hierarchical jails #33

Open Defenso-QTH opened 4 days ago

Defenso-QTH commented 4 days ago

This is similar to https://github.com/iocage/iocage/issues/1133 raised by @dlangille and inspired by https://it-notes.dragas.net/2023/11/27/migrating-from-vm-to-hierarchical-jails-freebsd/

Version: 1.8

iocage uses $pool/iocage, currently hardcoded path, to store its datasets (jails, templates, downloaded releases, etc.)

That makes it impossible to use in hierarchical (nested) jails.

I would like to have a --prefix option use to set a prefix to be used for iocage datasets, when I first activate the pool to be used, for instance: iocage activate mypool --prefix my/prefix.

Then I would expect jails to live in mypool/my/prefix/iocage/jails.

This should make it possible to use iocage within jails, like bastille: https://docs.bastillebsd.org/en/latest/chapters/zfs-support.html (see the bastille_zfs_prefix configuration directive).


Make sure to follow and check these boxes before submitting an issue! Thank you.

Defenso-QTH commented 2 days ago

I provided a draft PR to address this but there is still an issue to address, please join the discussion!