Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2019 04:49:16 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd-rwg@gndrsh.dnsmgr.net>
To:        "Patrick M. Hausen" <hausen@punkt.de>
Cc:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, FreeBSD virtualization mailing list <freebsd-virtualization@freebsd.org>
Subject:   Re: bhyve, sparse disk image and trim support?
Message-ID:  <201904231149.x3NBnGwn037663@gndrsh.dnsmgr.net>
In-Reply-To: <9E907736-8F90-4600-853C-7C2F7AF166BA@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help
[ Charset UTF-8 unsupported, converting... ]
> Hi!
> 
> > Am 21.04.2019 um 19:01 schrieb Bjoern A. Zeeb <bzeeb-lists@lists.zabbadoz.net>:
> > 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904231149.x3NBnGwn037663>