Now on 11.2 - whats the plan to migrate Jails

Status
Not open for further replies.

dAlexis

Dabbler
Joined
Aug 15, 2015
Messages
41
I was not searching the forum, but migrated by complete reinstall Transmission. Only torrents were copied. Plex - the same way.
No mind, how to completely remove old jails mechanism. I deleted both old jails, but old jails dataset is present on the pool below iocage in interface. Not large, space is enough indeed, but...
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
Fwiw, I was able to move & upgrade all the warden-based jails (including the jails installed on 9.* as part of plugin installs) to iocage running 11.2.

Before you do anything: snapshots - snapshots - snapshots (can't stress this enough)

First migrate warden to iocage, I used migrate_warden.py directly and adjusted some of the jail parameters manually via the gui (VNET, BPF, vnet0 interface & default route). Make sure the warden jail is down & autostart is flagged off.
Running iocage list from command line should now show you the migrated jail with the original freebsd os version (my oldest were some 9.* plugins). It's a good time to check that everything is up and running again and the original mount points are migrated as well.

Now we want to go to the latest patch version before upgrading, this is done via iocage update <yourjail>. After this we want to upgrade to 11.2, this is done via iocage upgrade <yourjail> --release 11.2-RELEASE. Note: you manually have to merge some files. I had to merge the hosts file by hand, for the other files I was able to just hit 'y' and let the upgrade process merge them.

Now that we are on 11.2, some stuff can and will be broken. First, we fix pkg by editing /usr/local/etc/pkg/repos/FreeBSD.conf and change the url: line to url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",, then we bootstrap pkg again to make sure we end up with a healthy version: pkg bootstrap -f and afterwards pkg update && pkg upgrade This will bring the jail to the latest software version.

Now it's time to fix the applications if needed, if you are seeing strange lib/compat issues with the migrated 9.* jails my hint would be to pkg install compat9x-amd64. This solved most of those issues for me.

Rollback: if you made a mistake in iocage and want to go back right after the migration you should be able tp roll back to the @WardenMigration_ snapshot. Complete rollback would be to destroy the iocage jail and restart the warden jail.

Cleanup: if everything is working and tested you can destroy the old jails dataset & remove the @WardenMigration_ named snapshots from the iocage datasets.
 

Makki

Explorer
Joined
Nov 8, 2016
Messages
57
Ok, I tried to downgrade to FreeNAS 11.1 (via normal WebUI-> System-Boot 11.1-U6 -> activate), now it doesn't boot anymore at all and I really need you help!
How to recover? (FreeNAS itself, not the jails at first)
The Hardware is fine, boots from another USB-Stick..


Screenshot_20181215-132427.png


Edit: And yes, I have snapshots, snapshots, snapshots local and on an external (detached) backup-disk (and just doing a dd of the boot-sticks) but cannot mount them under Mint 18.3):
Code:
~$ sudo zpool import
  pool: freenas-boot
    id: 9755724006392656738
 state: UNAVAIL
status: The pool is formatted using an incompatible version.
action: The pool cannot be imported.  Access the pool on a system running newer
    software, or recreate the pool from backup.
   see: http://www.sun.com/msg/ZFS-8000-A5
config:

    freenas-boot                                                         UNAVAIL  newer version
      mirror-0                                                           ONLINE
        disk/by-id/usb-SanDisk_Ultra_Fit_4C531001520816105483-0:0-part2  ONLINE
        disk/by-id/usb-SanDisk_Ultra_Fit_4C531001600816105485-0:0-part2  ONLINE
 
Last edited:

styno

Patron
Joined
Apr 11, 2016
Messages
466
My guess is that the change of bootloader in 11.2 is messing up your boot environments. Can you interrupt the boot process and choose 11.2 again?
I don't see a reason to boot from 11.1 again, your warden jails are still working under 11.2 (use the legacy gui to stop/start them).
If you can't solve it this way, I would reinstall 11.2 from ISO and import your backed-up config.
 

Makki

Explorer
Joined
Nov 8, 2016
Messages
57
No, the boot doesn't start at all (no GRUB or anything to choose)

The reason to boot 11.1 is simply, that anything, including PHP just *worked*..

I've booted from the 11.2-Installer now, question: how to fix the freenas-boot mirrored sticks from there to boot at least 11.2 again?

thanks, Michael
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
No, the boot doesn't start at all (no GRUB or anything to choose)
Then reinstall and import your config.

The reason to boot 11.1 is simply, that anything, including PHP just *worked*..
PHP on FreeNAS or PHP in the jail? I don't see a reason (maybe I am wrong) why the upgrade would've touched anything inside of the jails. Again, you can still run an untouched warden jail on 11.2.

I've booted from the 11.2-Installer now, question: how to fix the freenas-boot mirrored sticks from there to boot at least 11.2 again?
You don't fix them, reinstall and import the config file.
 

Makki

Explorer
Joined
Nov 8, 2016
Messages
57
Ok, got that.. Maybe a stupid question: How to get the config from the non-booting, redundant sticks?
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
Oh, I've never done that.
A quick forum search speaks of installing on another device and importing the old boot pool. Another option seems to do an upgrade/install instead of a reinstall. I am not sure if this is still the same on 11.2. Does the documentation mentions any of these?
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
If your system dataset was on your pool, you can find the config file at /var/db/system. It's called configs-longhexnumber
 
Last edited:

Makki

Explorer
Joined
Nov 8, 2016
Messages
57
Uh, what a mess.. I'll have to leave now, will try tomorrow, thanks @styno and @Redcoat
 

Makki

Explorer
Joined
Nov 8, 2016
Messages
57
Puhhh, at least "upgrade"-install worked with a 11.2-installer-stick over the existing Sticks preserving the config, it boots again :eek:
(should this be considered a bug, that the whole box is fully trashed if one activates the last version to boot?)
Now going back to 0, trying to get the nextcloud-jail working again (after over a week I really don't care anymore if warden or iocage or PHP7.0/7.2: it should just work..)

Michael
 

Makki

Explorer
Joined
Nov 8, 2016
Messages
57
And after rolling back a snapshot of the jails' dataset (cloned snapshot, renamed) to 2018-11-30 ;) it's also working again, I'm fully happy with old, unsupported PHP 7.0 and won't try any other update in 2018 anymore :rolleyes:
Real big thanks anyway, as you pushed me in the right direction to avoid a full desaster (first of all I'll create some more backups now! - although I had enough, I was really scary sometimes during the last days..)
FreeNAS with ZFS, it's snapshots is a real stable, production-system! Though some things: you have to know, I still think there is really much space to improve BSD's pkg to avoid fu*** up itself without any warning.

Michael
 
Status
Not open for further replies.
Top