Iocage jails mismatched hostid


#1

After importing zpool raid with numerous iocage jails, jails will not start.

“ERROR: hostid mismatch, start failed!”

Suspect it is a SysAdm configuration issue, but not sure how to repair. Read the API manual pertaining to iocage, but sure how/if/what I need to revert to the previous hostid. Just need CLI solution(s).

Any fixes/ideas out there?


#2

I had this when zfs sending iocage to another machine and had to change all the jails, templates and the special .defaults to set hostiid to be the same a /etc/hostid on the new system before it would run. I had already chaned IPs so there would be no conflicts. I think this is just protection for this kind of situation. The /iocage/.defaults hostid has to be set so that newly created jails have the right hostid - took me a while to figure that out.


#3

Any problem with just changing the TrueOS hostid to the original 10.3 hostid?

I would prefer to change the hostid of TrueOS than change all of the hostid references in iocage. Reasoning is if change iocage hostid references, then removes portability to using 10.3 as main working OS while TrueOS works it self out of beta.


#4

Unless I am mistaken, and it’s known to have happened.

I would assume all that would need to be edited, would be the /etc/hostid


#5

I think @RodMyers is correct. The hostid is supposed to be unique, so as long as the old 10.3 system is not online at the same time the trueos one is, there should be no conflicts.


#6

now, if he still has access to the 10.3 hostid


#7

:wink: I would think that it’s in the jail config somewhere, since it sounds like the problem is “I’m trying to start up this jail, the jail says hostid is blah but the system hostid is blahbhah”


#8

When you start the jail, it will give the jail hostid in the error message.

worked perfectly. Thanks guys!


#9

Solution:

$ iocage start jail-name
gives error with original hostid expected.
copy pcbsd-10.3 hostid from error message

$ cp /etc/hostid /etc/hostid.trueos
$ vi /etc/hostid.pcbsd-10.3
paste in pcbsd hostid & save

$ cp hostid.pcbsd-10.3 hostid

$ iocage start jail-name
starts jail without error


#10

Another solution:

I’ve found that I prefer to change the hostid property on the jail to match that of my system:

$ iocage set hostid=`cat /etc/hostid` iocage_jail_tag_or_UUID

If you intend on creating more jails in the future (and you want them to use the correct hostid), set the property for default:

$ iocage set hostid=`cat /etc/hostid` default

#11

Not a solution if I need/want to be able to boot into 10.3 as TrueOS “matures”. But yes, an alternative approach