Upgrading jails

Status
Not open for further replies.

kjp4756

Contributor
Joined
Feb 11, 2014
Messages
102
Right now I'm running freenas 9.2.1.9 and have 2 plugin jails which I understand are freebsd 9.2. Once freenas 9.3 is released how do I upgrade my jails to a freebsd 9.3 base? Do I simply use freebsd-update inside each jail?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I've done nothing. It "just works" at 9.3 when the kernel of FreeNAS is upgraded. :)
 

Alvin

Explorer
Joined
Aug 12, 2013
Messages
65
I'd like to know this too. My jail was at 9.1. After the upgrade to 9.3 the base system in the jail is still 9.1. Yes, the kernel has been upgraded, but within the jail, nothing has been touched.
I see no warden options to update the base system of a jail.
There's nothing in the documentation about upgrading jails, with the exception of the packages or ports.

freebsd-update(8) does not work.
WARNING: FreeBSD 9.1-RELEASE is approaching its End-of-Life date.
It is strongly recommended that you upgrade to a newer
release within the next 3 weeks.
Installing updates...chflags: ///lib/libc.so.7: Operation not permitted
 

kjp4756

Contributor
Joined
Feb 11, 2014
Messages
102
From what I can tell the only way to upgrade a jail is to re-create it using a new template. For me that's not a huge deal as I only have 2 jails.

I upgraded from 9.2.1.9 to 9.3 this morning. The upgrade went well. For some reason I can't create any new jails. The only template I seem to have available it the virtualbox one.

EDIT: I should've read the documentation first. Jails in 9.3 are a bit different now. It looks like freenas automatically uses a "standard" type of jail.
 
Last edited:

sysfu

Explorer
Joined
Jun 16, 2011
Messages
73
For long term stability you'll most likely want to recreate the jails from scratch as other have suggested.

I have a mix of 9.2 and 9.3 jails running on the system, but the 9.3 jails have less issues with startup and shutdown. Furthermore the 9.3 release allows DHCP assignment of IP addresses for jails which further simplifies and centralizes management.

Having to recreate most of the jails has actually forced be to meticulously document the steps needed to recreate each system. The next step will be to automate jail system creation using a configuration management tool.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
I envy you all for whom recreating the jails from scratch is a piece of cake. With my Plex jail, I'm not relishing having to manually do all that over again, retain my settings and data, and just hope it works.

From my inquiries and what I read, I had come to assume that the jails just followed along with the base OS, so nothing special had to be done (sort of like cyberjock's reply earlier in this thread).
 

sysfu

Explorer
Joined
Jun 16, 2011
Messages
73
I don't know if anyone claimed recreating jails from scratch was a piece of cake. Personally I find it a pain in the neck. It is forcing me to become a better admin however via the required documentation and automation.

You might be able to tweak your existing Plex plugin jail to make it work on 9.3. That may be just delaying the inevitable pain however that will one day come when a later FreeNAS update makes the existing jail unusable.

Ideally plugin authors would include at minimum settings and configuration import/export functionality, if not data. That way the plugin settings could be exported before a FreeNAS upgrade, the plugin and jail destroyed, a fresh up to date application plugin installed after the FreeNAS upgrade, then re-import your plugin/jail settings and your off and running again.

That's the way I would like to see it work at least.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
I'm not using the Plex plug-in. I manually created a generic jail and then set up Plex inside of that. I've got some old FreeBSD skills that aren't too rusty, but I'm still not enthusiastic about transferring it all over to a new jail and just magically having it work. Unless I'm over-complicating it in my head or missing some neat trick.
 

kjp4756

Contributor
Joined
Feb 11, 2014
Messages
102
My plex jail was the easiest one to set up. Everything for plex is contained in one folder. Backup /usr/local/plexdata and copy it to your new jail.

Here are the steps I did:

1. Create new jail
2. Set up storage for jail. In my case I have a dataset called Media that I mount as /media in the plex jail
3. Start shell in new jail.
4. From inside new jail do a 'pkg upgrade' to get everything up to date. Then do a 'pkg install plexmediaserver'.
5. Add plexmediaserver_enable="YES" to /etc/rc.conf in new jail
6. Go back in to old jail, stop plex ('service plexmediaserver top') and backup /usr/local/plexdata. In my case I used tar to create an archive in /media called plexdata.tar
7. Go back in to new jail. Start plexmediaserver 'service plexmediaserver start' and then stop it 'service plexmediaserver stop'. Extract your backup archive to /usr/local/plexdata
8. Start plex in new jail 'service plexmediaserver start'
9. Delete old jail if you wish

I hope that makes sense.
 

sremick

Patron
Joined
Sep 24, 2014
Messages
323
Thanks, kjp. That doesn't sound too painful.
 

johnjaylward

Dabbler
Joined
Oct 23, 2014
Messages
37
I upgraded from 9.2.1.something to 9.3 and my jail reports that it's 9.3:
# uname -a
FreeBSD rss 9.3-RELEASE-p5 FreeBSD 9.3-RELEASE-p5 #0 3b4abc3: Mon Dec 8 15:09:41 PST 2014 root@build3.ixsystems.com:/tank/home/jkh/build/M/FN/objs/os-base/amd64/fusion/jkh/M/FN/FreeBSD/src/sys/FREENAS.amd64 amd64
I haven't done anything to manually update the jails (not even a port update). Am I looking at the wrong information, or have 9.2 jails migrated to 9.3 automatically?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Don't forget that the purpose of a jail is to create a place where you can define an environment separate from the FreeNAS environment. To some extent, you can even put a different OS in a jail. I have not updated to 9.3, so I cannot comment on the updates from personal experience, but I would not want a FreeNAS update to also update any jail that I created manually. However, I could imagine that a jail created and managed thorough the GUI to support a plug-in might be updated by a FreeNAS update.

I don't see why most jails wouldn't continue to work as-is, after an update. As for Plex, that's a relatively simple one to manage. If you keep a backup of your configuration and database (you should), then if you ever need to reinstall Plex you can easily restore your system.
 
Status
Not open for further replies.
Top