Right, so this looks like a qemu bug, we shouldn’t be hitting such an assert and it should be handling whatever size file on whatever underlying filesystem.
That being said, forcing our file size to align on 1k boundaries seems to be fixing the issue. It’s effectively as if qemu doesn’t accept a block device which isn’t using a traditional 512byte or higher block size.
We can workaround that in LXD. For ZFS we need to meet an 8k boundary anyway, so easiest is likely to change our logic to always round to the closest 8k boundary when creating a block or file that’s used to back a VM. That way we know it will work with all backends equally well.
The logic around our
root.img handling is a bit sparse and may be incorrect so I’ve asked @tomp to look into it tomorrow morning, once that’s more solid, we can tweak that logic and our other storage drivers to always line up on 8k which should fix the issue regardless of qemu versions.