Copying what I sent to the smartos-discuss list (I’ve tried to make it less
SmartOS specific). I don’t want to assume I know of all the illumos-related
mailing lists, so please feel free to pass this along.

I believe this was discovered by the FreeBSD community and was brought to
our attention, and I wanted to pass it along. This isn’t a bug with bhyve
or SmartOS or illumos, but could be something someone running Windows on
bhyve may encounter (with unfortunate results), so we felt it worth wider
dispersal.

There have been reports of an issue with TRIM support in version 0.1.189 of
the Windows virtio block driver. It appears when using 4k devices the
driver may issue TRIM requests to the wrong sectors, which can cause
corruption of the virtual disk image (simplified, the driver may tell the
hypervisor to delete the wrong portions of the disk image). Earlier
versions of the Windows virtio drivers do not appear to be affected, and a
fix for the bug has been integrated into the main repository for the
Windows virtio drivers, so newer versions of the driver should also not be
affected. You likely want to avoid installing version 0.1.189 of the
Windows virtio drivers to avoid the chance of corruption of the virtual
disk image.

Any hypervisor which supports TRIM requests on virtio block devices may
experience this problem. The TRIM support for bhyve was integrated into
illumos in late May of this year. You’ll need to check with your distro
maintainers to identify when the bhyve TRIM support landed in your distro
(for SmartOS this was 20200603
<http://airmail.calendar/2020-06-03%2012:00:00%20CDT>T203505Z, but other
distributions have difference release processes). The safest thing is to
just avoid that version of the driver is you’re running a Windows VM in
bhyve.

If for any reason you cannot avoid the affected version, as an alternative
you can disable TRIM support for a virtual disk in bhyve (on impacted
versions). The mechanisms for this are going to be distribution specific,
but ultimately the bhyve command line does support a ‘nodelete’ option that
can be added to a disk option (-s
X:Y:Z,virtio-blk,/path/to/image,nodelete), and it’s just a matter of
getting that appended when bhyve is launched. On SmartOS this is done with
the ‘notrim’ option for a disk definition in vmadm, but other distributions
may have other mechanisms of handling it. Either way, my suggestion is to
only use this if you can’t avoid the bad driver version. It works fine, but
it’s easy to forget about.

------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/T494c95b3a0264d00-Md8bf4c52ab4f4612c0df0c04
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to