From owner-freebsd-virtualization@freebsd.org Mon May 14 17:37:03 2018 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 7EA1EDFC6DE for ; Mon, 14 May 2018 17:37:03 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: from mail-ot0-x22a.google.com (mail-ot0-x22a.google.com [IPv6:2607:f8b0:4003:c0f::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3DF9763E6 for ; Mon, 14 May 2018 17:37:02 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: by mail-ot0-x22a.google.com with SMTP id t1-v6so15233011ott.13 for ; Mon, 14 May 2018 10:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version; bh=xHbsKR2+/6Bqyh3DEX0v4BzKzgR7wBPQeMRVSnRAN7Y=; b=ZkVTpRg40z7YOBGzWcJyYO/wbS7fmgwU+iVaWSGhrADa8UA6565FRIiwv7quevZl7l k1BPLKtuufOp2nFpjhCfca+nbqgbH+PA3DruGlAgUv0OKdyOG0b2SjC5I1VB+fNeVqc7 hb/7UsGJPcdJkdwQ4HDeBcL3BQm9fgWDpfq9slSYxYpa/1aVZFRtY4yDmmytwDe+7ArQ 4iCRw5wNCQxeiyqtbuH5INygtsIWD6IfU7opUqs8CWQptSX/R58eQ6w8/u1FCx3YOM1j 2mS1ThKOyHDRjJIUQDMkdRJSvYCMm6wrC3QwGIQsntRL2rXDdGyKKxWz6tk9x4HF5LKJ xX2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version; bh=xHbsKR2+/6Bqyh3DEX0v4BzKzgR7wBPQeMRVSnRAN7Y=; b=pjzFhkDwNyXwsWUQIwzPRg9Mjed2jbB15PBCTsLrB9/QOH/onbYSPPChYxlebUg66I BVoE0TfVfOXabh9cm+z0Z/yo5W/TaftCCBB2M4DsanAplBwEJPRTYasLOY0NX6c2Pihq vwnbxsrUt25e22TgeWCbEpVtYMqfvSVSiWWvUXsbB1FbeUnb1Z7tvZtw8VeWeJy7nFWy rbksxe7I1aj3Rg4Ckb/5nzz3MBurVknWwE2hhra80KOiNbljBBjG8UJEu4DsOFzWCjz9 X80HBMFinzT+xBS2XrsRLltpOCwNkfdLrLRjuZwa7iO4DurlZDg07EDDfEcIBtbg7iI+ 7cbg== X-Gm-Message-State: ALKqPwexDKYObGeUlZ04OAri9NIzIi/OadR7pfTUQGbfL2Cic4+eLq1T 481BZagRV+KF9XOYxRh9rtVQ3beC X-Google-Smtp-Source: AB8JxZp7Ewqzc6oEQE7SUJzp7HbtFYb3COs93ybOdg9dzwFJ7A0mGTGPjsBbIAEMG3mO7GmGsDVYjQ== X-Received: by 2002:a9d:4e0d:: with SMTP id p13-v6mr8371082otf.76.1526319421610; Mon, 14 May 2018 10:37:01 -0700 (PDT) Received: from [10.225.75.48] ([8.38.210.27]) by smtp.gmail.com with ESMTPSA id l67-v6sm5250633oia.56.2018.05.14.10.37.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 10:37:00 -0700 (PDT) Date: Mon, 14 May 2018 12:36:36 -0500 From: Dustin Marquess To: "=?utf-8?Q?freebsd-virtualization=40freebsd.org?=" , Paul Esson Message-ID: <4b05ce96-327a-445e-8c12-5d324a1784b9@Spark> In-Reply-To: References: Subject: Re: Releasing deleted blocks from a sparse ZVOL used by bhyve guest X-Readdle-Message-ID: 4b05ce96-327a-445e-8c12-5d324a1784b9@Spark MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.26 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, 14 May 2018 17:37:03 -0000 The bhyve ahci driver does work with guests that issue TRIM. virtio-blk sadly does not. -Dustin On May 14, 2018, 10:34 AM -0500, Paul Esson , wrote: > Hi Folks, > > I'm attempting to use a sparse ZVOL from a FreeBSD 11.1-RELEASE host as a data disk for a bhyve FreeBSD 11.1-RELEASE guest that in turn uses this device as the source for a ZFS filesystem. When I delete data from the filesystem on the guest this is reflected in its used space, but not in the ZVOL on the host. I've read suggestions that the use of a block driver that supports TRIM or SCSi unmap is crucial such as virtio-scsi, but from what I can tell my vm-bhyve implementation is using virtio - certainly the disk1_type parameter in the configuration file has a value of "virtio-blk". > > Can anyone confirm this is indeed the issue and whether it is possible to switch to the relevant driver? Or am I barking up the wrong tree altogether? > > Host ZFS Filesystem > > NAME PROPERTY VALUE SOURCE > dc1-hn-01 type filesystem - > dc1-hn-01 creation Mon Apr 23 14:35 2018 - > dc1-hn-01 used 36.7G - > dc1-hn-01 available 78.2T - > dc1-hn-01 referenced 201K - > dc1-hn-01 compressratio 1.00x - > dc1-hn-01 mounted yes - > dc1-hn-01 quota none default > dc1-hn-01 reservation none default > dc1-hn-01 recordsize 128K default > dc1-hn-01 mountpoint /export/data/dc1-hn-01 local > dc1-hn-01 sharenfs off default > dc1-hn-01 checksum on default > dc1-hn-01 compression off default > dc1-hn-01 atime on default > dc1-hn-01 devices on default > dc1-hn-01 exec on default > dc1-hn-01 setuid on default > dc1-hn-01 readonly off default > dc1-hn-01 jailed off default > dc1-hn-01 snapdir hidden default > dc1-hn-01 aclmode discard default > dc1-hn-01 aclinherit restricted default > dc1-hn-01 canmount on default > dc1-hn-01 xattr off temporary > dc1-hn-01 copies 1 default > dc1-hn-01 version 5 - > dc1-hn-01 utf8only off - > dc1-hn-01 normalization none - > dc1-hn-01 casesensitivity sensitive - > dc1-hn-01 vscan off default > dc1-hn-01 nbmand off default > dc1-hn-01 sharesmb off default > dc1-hn-01 refquota none default > dc1-hn-01 refreservation none default > dc1-hn-01 primarycache all default > dc1-hn-01 secondarycache all default > dc1-hn-01 usedbysnapshots 0 - > dc1-hn-01 usedbydataset 201K - > dc1-hn-01 usedbychildren 36.7G - > dc1-hn-01 usedbyrefreservation 0 - > dc1-hn-01 logbias latency default > dc1-hn-01 dedup off default > dc1-hn-01 mlslabel - > dc1-hn-01 sync standard default > dc1-hn-01 refcompressratio 1.00x - > dc1-hn-01 written 201K - > dc1-hn-01 logicalused 4.12G - > dc1-hn-01 logicalreferenced 36.5K - > dc1-hn-01 volmode default default > dc1-hn-01 filesystem_limit none default > dc1-hn-01 snapshot_limit none default > dc1-hn-01 filesystem_count none default > dc1-hn-01 snapshot_count none default > dc1-hn-01 redundant_metadata all default > > > Host ZFS volume - used by vm-bhyve guest > > NAME PROPERTY VALUE SOURCE > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 type volume - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 creation Wed May 2 14:06 2018 - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 used 4.70G - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 available 78.2T - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 referenced 4.70G - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 compressratio 1.00x - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 reservation none default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 volsize 28T local > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 volblocksize 8K - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 checksum on default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 compression off default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 readonly off default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 copies 1 default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 refreservation none default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 primarycache all default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 secondarycache all default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 usedbysnapshots 0 - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 usedbydataset 4.70G - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 usedbychildren 0 - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 usedbyrefreservation 0 - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 logbias latency default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 dedup off default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 mlslabel - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 sync standard default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 refcompressratio 1.00x - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 written 4.70G - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 logicalused 2.06G - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 logicalreferenced 2.06G - > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 volmode dev local > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 snapshot_limit none default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 snapshot_count none default > dc1-hn-01/vm/dc1-olbp-sn-11/disk1 redundant_metadata all default > > Guest ZFS Filesystem > > NAME PROPERTY VALUE SOURCE > dc1-sn-11 type filesystem - > dc1-sn-11 creation Wed May 2 15:49 2018 - > dc1-sn-11 used 752K - > dc1-sn-11 available 26.9T - > dc1-sn-11 referenced 176K - > dc1-sn-11 compressratio 1.00x - > dc1-sn-11 mounted yes - > dc1-sn-11 quota none default > dc1-sn-11 reservation none default > dc1-sn-11 recordsize 128K default > dc1-sn-11 mountpoint /export/data/dc1-sn-11 local > dc1-sn-11 sharenfs off default > dc1-sn-11 checksum on default > dc1-sn-11 compression off default > dc1-sn-11 atime on default > dc1-sn-11 devices on default > dc1-sn-11 exec on default > dc1-sn-11 setuid on default > dc1-sn-11 readonly off default > dc1-sn-11 jailed off default > dc1-sn-11 snapdir hidden default > dc1-sn-11 aclmode discard default > dc1-sn-11 aclinherit restricted default > dc1-sn-11 canmount on default > dc1-sn-11 xattr off temporary > dc1-sn-11 copies 1 default > dc1-sn-11 version 5 - > dc1-sn-11 utf8only off - > dc1-sn-11 normalization none - > dc1-sn-11 casesensitivity sensitive - > dc1-sn-11 vscan off default > dc1-sn-11 nbmand off default > dc1-sn-11 sharesmb off default > dc1-sn-11 refquota none default > dc1-sn-11 refreservation none default > dc1-sn-11 primarycache all default > dc1-sn-11 secondarycache all default > dc1-sn-11 usedbysnapshots 0 - > dc1-sn-11 usedbydataset 176K - > dc1-sn-11 usedbychildren 576K - > dc1-sn-11 usedbyrefreservation 0 - > dc1-sn-11 logbias latency default > dc1-sn-11 dedup off default > dc1-sn-11 mlslabel - > dc1-sn-11 sync standard default > dc1-sn-11 refcompressratio 1.00x - > dc1-sn-11 written 176K - > dc1-sn-11 logicalused 153K - > dc1-sn-11 logicalreferenced 55K - > dc1-sn-11 volmode default default > dc1-sn-11 filesystem_limit none default > dc1-sn-11 snapshot_limit none default > dc1-sn-11 filesystem_count none default > dc1-sn-11 snapshot_count none default > dc1-sn-11 redundant_metadata all default > > > Regards, > > Paul Esson | Redstor Limited > t +44 (0)118 951 5235 | m +44 (0)776 690 6514 > e paul.esson@redstor.com www.redstor.com [http://partners.redstor.com/files/redstor_email_signatures_linkedin_icon_padding.png][http://partners.redstor.com/files/redstor_email_signatures_twitter_icon_padding.png][http://partners.redstor.com/files/redstor_email_signatures_facebook_icon_padding.png][http://partners.redstor.com/files/redstor_email_signatures_youtube_icon_padding.png] [http://partners.redstor.com/files/NEW_logo_larger.png] [cid:image001.jpg@01D3EB9E.9D818E70] > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"