From owner-freebsd-virtualization@freebsd.org Mon Apr 22 02:13:01 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 8674F158BA20 for ; Mon, 22 Apr 2019 02:13:01 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267C66C265 for ; Mon, 22 Apr 2019 02:12:59 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [192.168.2.23] (atc.xcllnt.net [50.0.150.213]) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTP id x3M2Cp0j001366; Sun, 21 Apr 2019 19:12:52 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: bhyve, sparse disk image and trim support? From: Marcel Moolenaar In-Reply-To: <21E25588-ADC0-4101-B122-5782D9A94AC4@lists.zabbadoz.net> Date: Sun, 21 Apr 2019 19:12:58 -0700 Cc: Marcel Moolenaar , FreeBSD virtualization mailing list Content-Transfer-Encoding: quoted-printable Message-Id: References: <21E25588-ADC0-4101-B122-5782D9A94AC4@lists.zabbadoz.net> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3445.9.1) X-Greylist: Sender IP whitelisted, ACL 39 matched, not delayed by milter-greylist-4.6.2 (mail.xcllnt.net [50.0.150.214]); Sun, 21 Apr 2019 19:12:53 -0700 (PDT) X-Rspamd-Queue-Id: 267C66C265 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.29 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; IP_SCORE(-0.15)[asn: 46375(-0.71), country: US(-0.06)]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[xcllnt.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.59)[0.593,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[mail.xcllnt.net]; NEURAL_SPAM_LONG(0.95)[0.945,0]; NEURAL_SPAM_SHORT(0.52)[0.517,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:46375, ipnet:50.0.144.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Mon, 22 Apr 2019 02:13:01 -0000 > On Apr 21, 2019, at 10:01 AM, Bjoern A. Zeeb = wrote: >=20 > Hi, >=20 > I have been wondering about this with other (commercial) = virtualisation solutions in the past. If running on a =E2=80=9Cdisk = image=E2=80=9D ideally I=E2=80=99d love that image to be a sparse file = and ideally I=E2=80=99d love for bhyve/underlying virtualisation for the = disk to understand TRIM so in case one deletes huge junks inside the VM = the disk image can actually shrink again. >=20 > Examples might be: you do a buildworld or an OS update in the guest = and then want to delete the obj tree or temporary files after that. Now = the disk image on the host has been bloated up, and could massively = shrink again saving space on the host. >=20 > Do we support this? Has anyone worked on this? How do people deal = with these problems? I started libvdsk a (long) time back: see = https://svnweb.freebsd.org/base/user/marcel/libvdsk/ I moved it to github to make collaboration easier: see = https://github.com/xcllnt/libvdsk The latest code is in GitHub. I mostly didn't work on it, but recently spent a bit of time on it. With = raw disk support integrated into the bundled bhyve, the next obvious step is to add = support for qcow or vmdk or vhd. Someone has the beginnings of qcow support, so maybe that can be = integrated soonish Into libvdsk. I was thinking that a sparse file could be created for raw disk images = in the context of TRIM, but didn=E2=80=99t yet worry about it. It could be useful in general, = not just raw disk images so I wanted to get off the ground with something like vmdk first... JFYI, --=20 Marcel Moolenaar marcel@xcllnt.net