From owner-freebsd-virtualization@freebsd.org Tue Apr 23 11:49:23 2019 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159461597677 for ; Tue, 23 Apr 2019 11:49:23 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE5916DC60 for ; Tue, 23 Apr 2019 11:49:21 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3NBnHiM037664; Tue, 23 Apr 2019 04:49:17 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3NBnGwn037663; Tue, 23 Apr 2019 04:49:16 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201904231149.x3NBnGwn037663@gndrsh.dnsmgr.net> Subject: Re: bhyve, sparse disk image and trim support? In-Reply-To: <9E907736-8F90-4600-853C-7C2F7AF166BA@punkt.de> To: "Patrick M. Hausen" Date: Tue, 23 Apr 2019 04:49:16 -0700 (PDT) CC: "Bjoern A. Zeeb" , FreeBSD virtualization mailing list X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CE5916DC60 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [3.00 / 15.00]; IP_SCORE(0.03)[ip: (0.11), ipnet: 69.59.192.0/19(0.06), asn: 13868(0.03), country: US(-0.06)]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: gndrsh.dnsmgr.net]; NEURAL_HAM_SHORT(-0.14)[-0.136,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.33)[0.329,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.89)[0.892,0]; R_SPF_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 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, 23 Apr 2019 11:49:23 -0000 [ Charset UTF-8 unsupported, converting... ] > Hi! > > > Am 21.04.2019 um 19:01 schrieb Bjoern A. Zeeb : > > Do we support this? Has anyone worked on this? How do people deal with these problems? > > I?m actually surprised this is supported for some configurations - thanks > for starting the thread. As for how others deal with this - e.g. VMware files > never shrink, but there is a ?vacuuming? function that compresses the > virtual disk while the VM is offline in the workstation products. For ESXi > I think the only way is to actually copy the image file to a new one with > vmkfstools. The current state of affairs with respect to ESXi is expressed here: https://www.codyhosterman.com/2016/11/whats-new-in-esxi-6-5-storage-part-i-unmap/ There was some experimental stuff back in 5.0 that was mostly broken. And there is much more information out there to be read.... > Used to use defrag and sdelete a lot in Windows VMs in the past, then > ran the compaction ? I am not sure, but at one time I thought ESXi would detect writes of null blocks to thin provisioned disks and unmap those blocks on its own, and that was basically how the guest tools cleanup disk space thing worked, but I can not find that information on this today. I do know that dd conv=sparse is one way to relaim such null blocks from a FreeBSD host if you do dd if=/dev/zero of=somejunkplace bs=1m rm somejunkplace inside your guest first, shut it down, then run a conv=sparse you can get back host file system space. Though the dd inside the guest well usually fully inflate the disk image so be careful! You may need up to 2 times the volume size to do these operations. > Kind regards > Patrick -- Rod Grimes rgrimes@freebsd.org