From owner-freebsd-virtualization@freebsd.org Tue Jul 14 08:35:06 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6693535AC20 for ; Tue, 14 Jul 2020 08:35:06 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from vito-vars.onthenet.com.au (vito-vars.OntheNet.com.au [203.13.68.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5Yjj3NjRz4kH3 for ; Tue, 14 Jul 2020 08:35:05 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto2.onthenet.com.au [203.13.68.14]) by vito-vars.onthenet.com.au (Postfix) with ESMTPS id 6AE4E209F8CC for ; Tue, 14 Jul 2020 18:34:54 +1000 (AEST) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTPS id 53EA620AE970 for ; Tue, 14 Jul 2020 18:34:54 +1000 (AEST) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id 47F8A213F4A3 for ; Tue, 14 Jul 2020 18:34:54 +1000 (AEST) Received: from iredmail.onthenet.com.au ([127.0.0.1]) by iredmail.onthenet.com.au (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Fhh_7JfZxAeO for ; Tue, 14 Jul 2020 18:34:54 +1000 (AEST) Received: from MacBook-Air-4.local (CPE-120-29-60-82.dsl.OntheNet.net [120.29.60.82]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id DF797213F4A2; Tue, 14 Jul 2020 18:34:52 +1000 (AEST) Subject: Re: bhyve, Windows guest and trim support To: Andrea Venturoli References: <4e0c7427-8bb4-37d6-b717-181d5c9b66d3@freebsd.org> <20200707154025.wm6u4abbrz5tesha@nexus.home.palmen-it.de> <75f28176-c22a-8742-e86c-d73609cd5463@netfence.it> <20200712131347.cjvr4cpbo3rsgnik@nexus.home.palmen-it.de> <2cd7021a-daac-dad8-9fa3-27dc9fc38181@netfence.it> Cc: freebsd-virtualization@freebsd.org From: Peter Grehan Message-ID: <60d2169d-e6e5-7c87-6f75-d128904be90a@freebsd.org> Date: Tue, 14 Jul 2020 18:34:52 +1000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <2cd7021a-daac-dad8-9fa3-27dc9fc38181@netfence.it> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=EuJmUhUA c=1 sm=1 tr=0 a=A6CF0fG5TOl4vs6YHvqXgw==:117 a=5na4vOg5aJ1be1vsGc0NmA==:17 a=IkcTkHD0fZMA:10 a=_RQrkK6FrEwA:10 a=upEVbidBAAAA:20 a=mNjfpg5FCCKvAOycShkA:9 a=QEXdDO2ut3YA:10 a=4LXi868vJ5H6B41lJmxj:22 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=P5GOeRIu c=1 sm=1 tr=0 a=eF5wA05EhuPcU0j7PNT2Vg==:117 a=5na4vOg5aJ1be1vsGc0NmA==:17 a=IkcTkHD0fZMA:10 a=_RQrkK6FrEwA:10 a=upEVbidBAAAA:20 a=mNjfpg5FCCKvAOycShkA:9 a=QEXdDO2ut3YA:10 a=4LXi868vJ5H6B41lJmxj:22 X-Rspamd-Queue-Id: 4B5Yjj3NjRz4kH3 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:9313, ipnet:203.13.68.0/23, country:AU] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 08:35:06 -0000 Hi Andrea, >> Thanks for this hint, I can now confirm this also works with virtio-blk >> (applied Allan's patch to 12.1). REFER for the zvol backing my Windows >> Server 2016 dropped from 315G to 72.5G. > > Hmm... > I applied the same patch and, still using virtio-blk, when trying to > retrim, Windows says "Optimize-Volume : The volume optimization > operation requested is not supported by the hardware backing the volume." > Seems like the guest doesn't think TRIM support is available. > Do I have to set anything? > > I have the following in the machine config (I'm using vm-bhyve): > disk0_type="virtio-blk" > disk0_name="disk0" > disk0_dev="zvol" > disk0_opts="sectorsize=512" You may need a recent Windows viostor driver. A working configuration was reported in https://github.com/virtio-win/kvm-guest-drivers-windows/issues/392 later, Peter.