Warden to iocage migration script, some quick tips for others!

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
EDIT:

It's possible the script works a lot better now, I haven't tested it, but see this bug track for it.
https://redmine.ixsystems.com/issues/27236#change-306289

You might not need all the information below.




Here's some tips for novices which will help if you have issues migrating your jails, I was worried and there wasn't enough info

The command is
migrate_warden.py -v -j <WARDEN> -p <POOL>
It's the exact warden name, example "sickrage_1" or "couchpotato_2" etc.
The pool is just your poolname, no it doesn't damage the pool, it puts it in the iocage section.

So it will end up going from:
/mnt/POOL/jails/sickrage_1
to
/mnt/POOL/iocage/jails/sickrage_1/root/

No, it won't damage your old jail in any way!
(Do remember to edit the warden jail and disable auto-start though)



ALSO:

Several issues you may have

1, you may need to manually set a nameserver in the networking section on the host, I don't know why but I had to, to fix some networking issues.
2, you might need to add a manual gateway / route on the FreeNAS host, I'm not sure, but I did this, it fixed my problems
3, you may need the 'tunables fix' for networking - there's many posts on this now, 2 lines to be added to rc.conf
4, it will import with a weird mac address like 01:0a:44:11:ac:66,01:0a:44:11:ac:66
This is _bad_. If you look at other, 'properly' created jails / plugins under iocage, you will see the correct format is actually
010a4411ac66,010a4411ac67
Note the increment last digit on the mac address, it's to do with virtual adapters or something? Fix this under the networking part of the jail in the new UI, strip out the : just for the heck of it.
5, you may need to change the ipv6 address from VNET0|none to just "none"
6, you may need to set a manual ipv4 route (gateway) in the jail, not just the FreeNAS host
7. you may need to reconfigure the mount points on the jails to be at the correct paths.

I know that sounds like a lot, once you've done it once, it's easy as heck. As soon as you do, all the jails work, they migrate flawlessly and you can most likely truly disable warden entirely.
 
Last edited:

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
But it still doesn't change the fact that they are "empty" jails and can not be upgraded. Even if you use the migration script to move your jails over they will have to be rebuilt at some point if you want to keep them up to date.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
That's true, but is there a possible solution for that? I know there's a flag in the jail, when I edit the jail called
"Release" which is set to empty.

Surely if I change this to 11.1 it won't magically fix the problem, will it?


Also are you talking about the base-os of the jail? (The FreeBSD build?) isn't it possible the plugins could still be updated if they don't depend on newer builds of FreeBSD?
I kinda don't 'get' the whole pkg update / pkg upgrade business?
I know couchpotato and sickrage seem to just update themselves somehow?
 
Joined
Jul 10, 2016
Messages
521
Does the migration script work flawless in all situations? No, it does not.

However, all these quirks can be overcome by manually correcting the few iocage properties of the jail that were not converted properly.

The "release" property is the oddball one, as the regular command iocage set release=... will not let you change the jail's release. As a workaround, one can manually edit the jail's config file, typically located in /mnt/iocage/jails/<jail_name>/config.json. You need to change the properties release and cloned_release from EMPTY to the actual version of the jail, e.g. "10.3-RELEASE".

If you don't remember what the release the old warden jail was, start it up and run freebsd-version. Note that for older releases this command may not be available yet; in that case run file /bin/sh instead.

After doing all this, a converted jail works fine. It behaves no different from an iocage jail created from scratch, it allowed running e.g. iocage upgrade <jail_name> -r 11.1-RELEASE to upgrade it to the latest release. I would recommend to take a snapshot before doing so though. :)
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Jurgen:

I don't mind a few manual tasks. I've asked them to try and fix the broken stuff but the job is marked as done, I don't think they're going to fix it.

As for the release issue, well I guess this thread may become the defacto place for advice and your post will be useful for the release build.

What are the implications of leaving it as is? I'm still unsure what the difference is between updating the OS in the jail and updating just the package inside the jail? (Example: Couchpotato and sickrage seem more than capable of updating themselves?
 

eriko

Cadet
Joined
Aug 24, 2018
Messages
1
7. you may need to reconfigure the mount points on the jails to be at the correct paths.

Sorry to necro this thread.

I have run the script to go from a 9.10 10.3-RELEASE-based jail to 11.2. My mount points look right, but from within the jail, they appear empty. Is this a problem with the script?

Edit: Resolved. The script used an absolute directory in the host, which didn't exist in the jail. Changing it to relative to the jail fixed the issue.
 
Last edited:

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Ok I have used the script to port my warden jails to iocage and it appears to have done it correctly but I cannot access the GUI of any of the jails. I have adjusted the settings above from 4 - 7 as I believe the other issues should be fixed in beta 2 (yes I’m running beta2).
My question is for my adapter inside the jails should I choose vnet, igb0 or bridge? MAC addresses appear correct after removing just the “:”
I cannot ping from inside the jail.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
If you shell in as root and type

iocage console <jailname>
Can you ping out to other destinations from within it?

I think it's vnet0 - but I'm not a networking guy. Did you follow the first 3 instructions?
Did you INCREMENT the mac address? it must not be identical

blahblahblahA,blahblahblahB
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
If you shell in as root and type

iocage console <jailname>
Can you ping out to other destinations from within it?

I think it's vnet0 - but I'm not a networking guy. Did you follow the first 3 instructions?
Did you INCREMENT the mac address? it must not be identical

blahblahblahA,blahblahblahB
I didn’t follow the first 3 instructions no. I’ll check mac addresses when I get home. I will add that I did manage to get plex working as it should it was just my other 3 I couldn’t (transmission, sickrage and couchpotato.

Have you successfully managed to upgrade the release of any of the above jails? Or anyone else? I believe mine start at 11.1-Release p1 or something similar.


Sent from my iPhone using Tapatalk
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
I haven't messed with release. These are temporary jails, until proper plugins are released, at that point, I will be re-creating.

I suspect someone will figure out the release thing though
 

trentk10

Explorer
Joined
Jan 7, 2017
Messages
69
Have you successfully managed to upgrade the release of any of the above jails? Or anyone else? I believe mine start at 11.1-Release p1 or something similar.


Sent from my iPhone using Tapatalk

I successfully upgraded two jails. One was a test jail, and the other was an unbound dns server jail. I haven't seen any problems other than going through the steps mentioned in the other posts in this thread. Went pretty smooth I thought.

Neither jail had storage attached to it though. I have a nextcloud jail I need to change over, but I havn't had a chance to make a test jail with storage to experiment with yet.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Did you have to do anything to upgrade them?
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
For now i think I’ll just set the release to what it was created at (11.1) i think.
If I snapshot the iocage jails before I upgrade the release and it borks can I restore the snapshot to when it was working?


Sent from my iPhone using Tapatalk
 

trentk10

Explorer
Joined
Jan 7, 2017
Messages
69
Did you have to do anything to upgrade them?

After running the migration script, and making sure networking was working, I followed the steps listed a few post up from here.

Does the migration script work flawless in all situations? No, it does not.

However, all these quirks can be overcome by manually correcting the few iocage properties of the jail that were not converted properly.

The "release" property is the oddball one, as the regular command iocage set release=... will not let you change the jail's release. As a workaround, one can manually edit the jail's config file, typically located in /mnt/iocage/jails/<jail_name>/config.json. You need to change the properties release and cloned_release from EMPTY to the actual version of the jail, e.g. "10.3-RELEASE".

If you don't remember what the release the old warden jail was, start it up and run freebsd-version. Note that for older releases this command may not be available yet; in that case run file /bin/sh instead.

After doing all this, a converted jail works fine. It behaves no different from an iocage jail created from scratch, it allowed running e.g. iocage upgrade <jail_name> -r 11.1-RELEASE to upgrade it to the latest release. I would recommend to take a snapshot before doing so though.
 

marcevan

Patron
Joined
Dec 15, 2013
Messages
432
So followed the instructions and did this:

1. turn off the old (warden) jail - it will be an ip conflict if you don't
2. Get it's version first though so you know what to put into config.json of it's iocage twin
3. Do remove the ':' from the MAC and up the very last digit only. Mine went from 'e' to 'f' for example.
4. Do edit fstab and fix your storages as you'll see it used /mnt/POOL_NAME/ and you need that to be /mnt/iocage/...
5. Then try your GUI...mine was for emby and it's working with IOcage jail and same old GUI.
 
Last edited:

marcevan

Patron
Joined
Dec 15, 2013
Messages
432
Can anyone elaborate on steps 1, 2, 3? I couldn't find what you mean by:

1, you may need to manually set a nameserver in the networking section on the host, I don't know why but I had to, to fix some networking issues.
2, you might need to add a manual gateway / route on the FreeNAS host, I'm not sure, but I did this, it fixed my problems
3, you may need the 'tunables fix' for networking - there's many posts on this now, 2 lines to be added to rc.conf

Because I got Plex, I had to redo the libraries, and nothing seems to work for getting metadata and posters, banners, etc. All 'matching' fails so I suspect it's networking.

I did handle the MAC and IP6 updated in it's config.json, but nameserver on the host? manual gateway / route on host? tunables fix on rc.conf?
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Can anyone elaborate on steps 1, 2, 3? I couldn't find what you mean by:

1, you may need to manually set a nameserver in the networking section on the host, I don't know why but I had to, to fix some networking issues.
2, you might need to add a manual gateway / route on the FreeNAS host, I'm not sure, but I did this, it fixed my problems
3, you may need the 'tunables fix' for networking - there's many posts on this now, 2 lines to be added to rc.conf

Because I got Plex, I had to redo the libraries, and nothing seems to work for getting metadata and posters, banners, etc. All 'matching' fails so I suspect it's networking.

I did handle the MAC and IP6 updated in it's config.json, but nameserver on the host? manual gateway / route on host? tunables fix on rc.conf?


1, you might not need to anymore, beta 2 and almost certainly 3 would've fixed the odd networking issues.
2, adding a gateway / router in the jail config, see the answer to #1 - you probably don't need to do this anymore.
3, see also 1 and 2 - all of these are PROBABLY fixed now.


Are you on B3 or B2?
 

marcevan

Patron
Joined
Dec 15, 2013
Messages
432
I tried B3 and that's where all the issues still were with plugins reaching the outside world. I've since rolled back to 11.1U6, turned off the iocage jails, and woke the warden jails and all is well.

I'll update to 11.2 when I don't see BETA in the stable train.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Did you do the mac address thing?
 

indivision

Guru
Joined
Jan 4, 2013
Messages
806
I plan on simply re-building my plugins and jails from scratch.

But, how do I remove the old ones?

I upgraded to 11.2 and none of my old jails or installed plugins are listed in the GUI. They are there and running though.
 
Last edited:
Top