Hostid Mismatch on rpool

bleglord

New Member
Sep 6, 2022
6
4
3
This is an odd one, and not immediately important since it was part of a specific "how exactly will this process break things" test and well... we found what broke.

Scenario:

PVE installation disks wiped to simulate complete OS drive failure
PVE reinstallation from ISO
Copy previous /etc/ contents from old PVE install to new as a test for a quick and dirty restore process (not an in depth DR process, just proof of concept)
Everything works except:

rpool now shows "
Mismatch between pool hostid and system hostid on imported pool.
This pool was previously imported into a system with a different hostid,
and then was verbatim imported into this system."

This makes sense, but doesn't seem solvable. You cannot export the rpool to reimport it from a live system, and running a liveCD proxmox debug shell to import then export the rpool from that environment also does not change anything.

Is there any way to solve this? It isn't a harmful error as far as I can tell, but it would be good to know if there is a possibility to fix this just as a knowledge add.

And yes, I know there are better host backup methods, this was a purposeful sandbox test to see what exactly this would result in.
 
Options that come to my mind (without explicitly trying it):
* do not restore /etc/hostid from the old OS-install (would also suggest to not restore a few other things (/etc/machine-id, ssh-host-keys come to mind)
* if booting fails you should get to a rescue shell (after providing the root-password) - there it should be possible to run `zpool import -f`
(there I'm not sure if this might fail, since it'll try to mount the datasets as well - so maybe you need to run `zpool import -f -N`)
this should fix the hostid mismatch between the on-disk data and your etc contents

I hope this helps!
 
Hello

I think I found a solution to this problem that I just encountered by carrying out restoration tests.

Bash:
rm /etc/hostid
zgenhostid
zpool set multihost=on rpool
zpool set multihost=off rpool
zpool status rpool
 
  • Like
Reactions: Phlogi
Hello

I think I found a solution to this problem that I just encountered by carrying out restoration tests.

Bash:
rm /etc/hostid
zgenhostid
zpool set multihost=on rpool
zpool set multihost=off rpool
zpool status rpool

Thanks, this just worked for me without creating a new hostid:

Bash:
zpool set multihost=on rpool
zpool set multihost=off rpool
zpool status rpool