On 2020-07-06 13:23, Andrea Venturoli wrote:
> Hello.
> 
> I'm running zvol-backed Windows guests in bhyve on FreeBSD 12.1.
> Over time, I see the zvol effectively used space grow in size: a sign
> that Windows isn't trimming it.
> 
> I'm using virtio-blk: I guess this driver does not support trim?
> I see reports that this support was added, but it's not clear to me
> whether it's in the released version or not (I've downloaded the stable
> binary ISO from RedHat).
> Is trim expected to work in such a scenario?
> If not, is it a bhyve problem or a guest-driver problem (or both)?
> 
> I tried virtio-scsi, which should support trim, but the guest doesn't
> even start in this case, getting stuck at the UEFI boot stage and ending
> up in UEFI prompt.
> Again, is this expected?
> No guest driver has been loaded yet, so is it a bhyve limitation?
> Is some tweak needed?
> 
> I tried changing from virtio-blk to ahci-hd: I was then able to manually
> trim the disk from inside the guest and recover a lot of space in the
> zpool.
> Alas ahci-hd is much slower, so I moved back to virtio-blk after that
> (at least for the time being).
> 
>  bye & Thanks
>     av.
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to
> "freebsd-virtualization-unsubscr...@freebsd.org"

I added support for bhyve to understand virtio-blk TRIM messages to
FreeBSD 13 back in April, r360229

It should be possible to apply that patch to FreeBSD 12.1, and then your
Windows guest should be able to issue TRIM commands, and you will see
the space become free in your zvol.


There is a separate patch to teach the FreeBSD virtio-blk driver to send
TRIM commands, it is still in review (needs testing on hypervisors other
than bhyve):

https://reviews.freebsd.org/D21708


-- 
Allan Jude

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to