Best approach to handle jail while experimenting.

passatiji

Dabbler
Joined
Dec 22, 2017
Messages
11
Can someone help me understand how to use the tools of Truenas for the following scenario?
I would like to setup a jail to install FEMP server and Joomla CMS for my own learning and have a safety cushion in case I do something wrong. So I was thinking I could make manual snapshots before major changes and hopefully be able to rollback if that step fails. Before I end up with disaster recovery (not that it's production server but still) I decided to play with snapshots and rollbacks but it didn't seem to work. Here is what I did:
  • System version: TrueNAS-12.0-U7
  • Created clone jail Release 12.3
  • GUI: Storage -> Snapshots (there was already a snapshot with the jail name)
  • Snapshot Add (Dataset: Storage/iocage/jails/FEMPserver) the rest default
  • GUI: Jails ->FEMPserver -> Shell -> wget installation.tar.gz
  • GUI: Storage -> Snapshots -> (manual snapshot) -> Rollback -> Confirm -> Rollback
  • GUI: Jails ->FEMPserver -> Shell -> ls -> installation.tar.gz (still there!?)
I was expecting the state of the jail to be back to the point of creation but in my case freshly downloaded file was still there
Obviously, I am missing something (most dialogues were left by default) and don't intuitively see where I am making the mistake.
My question is: How can I use the advantage of ZFS snapshot to be able roll back a step (or a couple steps) of jail modifications?
Thank you.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to roll back all the datasets of your jail individually. There is no such thing as a recursive rollback in ZFS. There are recursive snapshots, though, and you should check if you enabled that when you created the snapshot.

Storage/iocage/jails/FEMPserver just contains the jail's metadata. All the jail installation proper (unless you changed that by mounts or other measures) is in Storage/iocage/jails/FEMPserver/root ...
 

passatiji

Dabbler
Joined
Dec 22, 2017
Messages
11
You need to roll back all the datasets of your jail individually. There is no such thing as a recursive rollback in ZFS. There are recursive snapshots, though, and you should check if you enabled that when you created the snapshot.

Storage/iocage/jails/FEMPserver just contains the jail's metadata. All the jail installation proper (unless you changed that by mounts or other measures) is in Storage/iocage/jails/FEMPserver/root ...
Thank you for the quick response.
First mistake that I made - didn't enable recursive option. I will play with that shortly.
Second remark is what I think is causing my frustration - I'm rolling back wrong folder dataset (not root).
 

passatiji

Dabbler
Joined
Dec 22, 2017
Messages
11
Storage/iocage/jails/FEMPserver just contains the jail's metadata. All the jail installation proper (unless you changed that by mounts or other measures) is in Storage/iocage/jails/FEMPserver/root ...
You were absolutely correct. Rolling back "root" dataset works exactly as expected.
Thank you!
 
Top