jails iocage clone/promote functionality

Hello,

I posted about this on TrueNas forums but got no response so hoping to do better here.

I recently upgraded to TrueNas 13 which runs FreeBSD 13.1, I know this is already EOL but this is the current stable TrueNas train. I am running iocage jails and I wished to use the clone functionality prior to upgrading the jail from 12.2 to 13.1. I did this, performed the upgrade on the jail, updaged my packages, tested functionality successfully and am ready to promote the clone and then destroy the source (or that was my understanding of the functionality) however the iocage promote command does not appear to be present and does not even appear when looking at iocage --help.

My question is whats the best way to proceed with this clone scenario? Currently running off of the clone with no issues yet. It does show up as a snapshot when I look at iocage snapshots.
 
https://iocage.readthedocs.io/en/latest/advanced-use.html?highlight=clone still mentions clones. On the other hand it says
Code:
Promoting a Clone

Warning
This functionality isn’t fully added to iocage, and may not function as expected.
To promote a cloned jail, run:

iocage promote [UUID | NAME]

This reverses the clone and source jail relationship. The clone becomes the source and the source jail is demoted to a clone.
In ZFS a clone shares storage with its origin snapshot. The clone can only exist with the origin snapshot remains available. When the clone is promoted the clone is on its own. But if I am not wrong the roles of the clone and the origin snapshot are never swapped.
 
https://iocage.readthedocs.io/en/latest/advanced-use.html?highlight=clone still mentions clones. On the other hand it says
Code:
Promoting a Clone

Warning
This functionality isn’t fully added to iocage, and may not function as expected.
To promote a cloned jail, run:

iocage promote [UUID | NAME]

This reverses the clone and source jail relationship. The clone becomes the source and the source jail is demoted to a clone.
In ZFS a clone shares storage with its origin snapshot. The clone can only exist with the origin snapshot remains available. When the clone is promoted the clone is on its own. But if I am not wrong the roles of the clone and the origin snapshot are never swapped.
So really I suppose I'm just looking to figure out how to proceed and consolidate the clone and source since it appears as a snapshot. I would expect to possibly run into issues when I try and upgrade again and then have a nested snapshot situation.
 
Let us assume you have a FreeBSD-13.x jail and take a snapshot. You can use that snapshot to create one or more clones of it. All will be FreeBSD-13.x. If you upgrade the original FreeBSD-13.x jail to FreeBSD-14.x the snapshot does not change. Therefor the clones are not upgraded as well.

Now you can make a new snapshot of the FreeBSD-14.x jail and clone it. Then you can copy all the configurations of the clones running FreeBSD-13.x to the new clones running FreeBSD-14.x. If the new clones work you can destroy the FreeBSD-13.x jails and the FreeBSD-13.x snapshot. This is my usual workflow.

You can also upgrade one of the clone jails, promote it to continue its life as an independent data set, take a snapshot of that and use it to create other jails by cloning. Then you have to take care about the configurations as above.

You can also use a jail manager which handles a base jail and provides the same base system to all jails by null-mount. Then upgrading the base jail from FreeBSD-13.x to FreeBSD-14.x will take effect for all related jails. For that method no cloning is required.
 
I'm bumping this thread as I never really resloved this and have just been running off the clone I created a few months back with the source jail powered down. One of the issues I feared with this was the clone/snapshot growing as it references the original jail. It's beginning to get rather large and I'd really like to tidy it up without accidentally destroying everything.

root@freenas:~ # iocage snaplist PMS
+---------------+-----------------------+-------+-------+
| NAME | CREATED | RSIZE | USED |
+===============+=======================+=======+=======+
| PMS_Test | Fri May 24 23:44 2024 | 112K | 76K |
+---------------+-----------------------+-------+-------+
| PMS_Test/root | Fri May 24 23:44 2024 | 86.8G | 44.4M |
+---------------+-----------------------+-------+-------+


As you can see from the output above I have a snapshot of PMS jail running as PMS_Test. It's running exactly as I need, so my goal is to get it to be independent of the parent jail and then delete the parent jail. I created PMS_Test using iocage clone functionality and my goal was to use the promote command and then delete the source jail afterwards as mentioned here https://iocage.readthedocs.io/en/latest/advanced-use.html however it seems the warning under promoting a clone is valid as the promote command doesn't seem to exist.

So without using promote, any idea of path forward?
 
I posted about this on TrueNas forums but got no response so hoping to do better here.
I'm bumping this thread as I never really resloved this
I'm not sure why you're expecting a more or less detailed answer/solution about your iocage TrueNAS problems from this forum.

This is not a TrueNAS forum: GhostBSD, pfSense, TrueNAS, and all other FreeBSD Derivatives

iocage, as a FreeBSD based jail manager is apparently no longer being developed, that holds as well for its TrueNAS incarnation.
For any path forward in the long run, I'd consider moving to an alternative jail manager.

Any such alternative would include running jails directly on FreeBSD sec, as opposed to TrueNAS; or staying with TrueNAS and consider its best future proof options for your circumstances. Perhaps have a look at: How to compare bastille-bsd, ezjail, cbsd, pot, iocage,ezjail

If for whatever reason you're inclined to stay with your current TrueNAS iocage setup, I'd consider getting a well known source of iocage jails information: FreeBSD Mastery: Jails for any further detailed information.
 
I'm not sure why you're expecting a more or less detailed answer/solution about your iocage TrueNAS problems from this forum.

This is not a TrueNAS forum: GhostBSD, pfSense, TrueNAS, and all other FreeBSD Derivatives

iocage, as a FreeBSD based jail manager is apparently no longer being developed, that holds as well for its TrueNAS incarnation.
For any path forward in the long run, I'd consider moving to an alternative jail manager.

Any such alternative would include running jails directly on FreeBSD sec, as opposed to TrueNAS; or staying with TrueNAS and consider its best future proof options for your circumstances. Perhaps have a look at: How to compare bastille-bsd, ezjail, cbsd, pot, iocage,ezjail

If for whatever reason you're inclined to stay with your current TrueNAS iocage setup, I'd consider getting a well known source of iocage jails information: FreeBSD Mastery: Jails for any further detailed information.
I'm not "expecting" anything, there literally only one other thread on the Internet concerning the promote functionality of iocage that I can find. The truenas forums have been little help and clearly I'm grasping at straws to hopefully find someone who is more experienced with iocage. I do assume that some users of this forum have worked with iocage and snapshot functions.

TrueNas has served my purposes well for 10 years well before iocage when jails were in warden. I think it would be a little bit of an overreaction to abandon it and try to migrate my entire existing setup and jails because of this. I'll rebuild the jail in my current environment before undertaking that commitment. Thank for your suggestion to rtfm.
 
Back
Top