Closed thalamus closed 10 years ago
Is it possible the host id for your system changed? The error indicates that the id in the label doesn't match the one for your system. Aside from that it's harmless.
I was able to reproduce this in a Fedora VM with the latest code. It appears to be a side effect of the recent systemd integration. Because the ZFS modules may now be loaded before the network is brought up the hostid
may not be set. However, this behavior is racy since it's entirely possible the ZFS module will be loaded after the network is configured.
This artificial dependency on the hostid and in turn the network which we inherited from Illumos has always been a problem. The cleanest fix is to shed this dependency entirely by implementing #745 but that's a fairly large development item.
Shorter term we could ensure the zpool import
always occurs after the network has been brought up. This isn't the most desirable solution but it is arguably correct until we can shake this dependency.
@Lalufu any thoughts? You might not have noticed this in your initial testing because it's unlikely to occur if there are a large number of drives or they are slow to settle.
The way the systemd units are structured the import of all pools will happen quite early in the boot process.
The ZFS module is loaded by the systemd-modules-load.service
which runs very early in the boot process. Shortly after the import and mount of ZFS pools and filesystems is done, before local-fs.target
is reached. This has been done so that ZFS file systems are treated equally to those mentioned in /etc/fstab
wrt the time they're available to the rest of the system.
Network related services are started as part of basic.target
, which comes quite a bit later in the boot process. So for a normal boot the import will always happen at a time when there is no network available.
The whole dependency tree can be seen with systemctl list-dependencies --before zfs-mount
Since I'd really like to avoid adding a dependency for something which happens so late in the boot. I'm inclined to disable the hostid check when the hostid is set to a loopback device. This would resolve a whole class of problems where pools fail to import cleanly.
What ever happened to generating a random hostid file as part of zfs install? I thought there had been a consensus on that solution a long time ago as there was never any consistently available hostid and ssh had already set precedent for doing this?
If there was consensus then I missed it and no one ever posted patches. That sounds like a reasonable solution and if something like ssh already needs to do this for some use case so much the better. Can you reference the prior thread?
This issue was resolved by zfsonlinux/spl@acf0ade362cb8b26d67770114ee6fa17816e6b65. Unless an /etc/hostid file has been created for the node the hostid check will be disabled.
After updating master from 98fad86 to 0ad85ed, on the first reboot after performing a scrub to correct the disk format errata, it failed to import the pool stating that it was in use by another system. It wasn't and never has been in use by another system, so I forced the import, and all was fine after that, except the for the below erroneous warning in zpool status which has persisted ever since.
The pool has had no further problems importing automatically on boot since the initial issue.
I attempted exporting and reimporting the pool, and it is still present.