From owner-freebsd-virtualization@freebsd.org Fri Jul 19 10:43:55 2019 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 208A1BEB62 for ; Fri, 19 Jul 2019 10:43:55 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC528F957 for ; Fri, 19 Jul 2019 10:43:54 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 4b52e52e; Fri, 19 Jul 2019 12:37:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=y1MvGSWwQ+Uaaaqx7dHnaMSsIgM=; b=rXuq+XZfOl6J1au0rlz65aTmL2zA n7jxpIW3k1TrpVPD2Xh733v3Auq3a4NNFVCcln+gCxQN5UGHohLbFEBlBOQ55G8n yc3RvTZ5mTBL7Jz6rndzOJVc1gaQcxnXYVXryfZzN1qctqyNj/rXCsLA1HvkQuWO 7Qe28EPQFkcpMAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=R3uSRVxVvSECXrW4SOo6IkgztuU7euSw52zif/pWbGKwrZshGk0pAnc8 B6j7k4/5Pv586B7hBT/qutRdWk/JZML128e3Qj0sUxW035CGcGHwXLFAYEs9DDR2 aYHx0VR3Eb8bN00n8K8CrCqh033XBXVsUvXbkAVV34MFjG5MZac= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id b45bbb9a TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 19 Jul 2019 12:37:11 +0200 (CEST) Date: Fri, 19 Jul 2019 12:37:08 +0200 From: Emmanuel Vadot To: Pete Wright Cc: freebsd-virtualization@freebsd.org Subject: Re: Custom Qcow2 Images Message-Id: <20190719123708.de3ac7c0041a7c356080fa7b@bidouilliste.com> In-Reply-To: <95a027df-46c3-24ba-8acd-ddb24579885e@nomadlogic.org> References: <459c53d0-f00b-6ce3-dfab-de3ddac1c0bb@nomadlogic.org> <95a027df-46c3-24ba-8acd-ddb24579885e@nomadlogic.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 5DC528F957 X-Spamd-Bar: ++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mail header.b=rXuq+XZf; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.177.182 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [8.92 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:212.83.177.182/32]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[cached: mx-backup.blih.net]; NEURAL_HAM_SHORT(-0.43)[-0.430,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.26)[ip: (-1.05), ipnet: 212.83.160.0/19(2.65), asn: 12876(-0.28), country: FR(-0.01)]; ASN(0.00)[asn:12876, ipnet:212.83.160.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[bidouilliste.com:s=mail]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[bidouilliste.com]; NEURAL_SPAM_MEDIUM(1.00)[1.000,0]; BAD_REP_POLICIES(0.10)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; URIBL_SBL(6.50)[bsdrp.net]; RCVD_COUNT_TWO(0.00)[2]; GREYLIST(0.00)[pass,body] X-Spam: Yes 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: Fri, 19 Jul 2019 10:43:55 -0000 Hi Pete, On Thu, 18 Jul 2019 19:53:42 -0700 Pete Wright wrote: >=20 > On 7/14/19 4:37 PM, Pete Wright wrote: > > Hey there folks, > > I am wondering if anyone has any pointers on creating a custom Qcow2=20 > > FreeBSD that is akin in size to nanobsd.=A0 I have an environment where= =20 > > we need to run a single binary and want to keep our disk image as=20 > > small as possible.=A0 It will run inside a user-mode Qemu process.=A0=20 > > Reading through the nanobsd script it seems that it expects a raw disk= =20 > > for installation, so I do think using the nanobsd script itself well=20 > > work well.=A0 Has anyone else done something similar?=A0 My goal is to= =20 > > have a disk image that is around 500MB. > > > > Thanks in advance! > > -pete > > >=20 >=20 > I wanted to close the loop on this discussion as I think I've found a=20 > workable solution for my use-case.=A0 I'm using a three step process: >=20 > 1) generate a raw disk image using "poudriere image".=A0 This phase=20 > references a Jail I've built that has disabled lots of uneeded features=20 > as per the docs here: > https://bsdrp.net/documentation/technical_docs/poudriere >=20 > 2) next I use mkimg(1) to convert the raw disk image to a bootable qcow2= =20 > image that I can boot from Qemu.=A0 this results in a disk image that's=20 > about 800MB. >=20 > 3) the final phase is to use qemu-img to create a compressed qcow2=20 > image.=A0 the resulting artifact of that process is a ~325MB Qcow2=20 > diskimage that actually has decent performance (on my SSD backed zfs=20 > filesystem). >=20 > I attempted to use poudriere image to generate a usb image directly, and= =20 > while that did work well sizing wise i ran into an issue where=20 > insufficient inodes were allocated.=A0 I reference what I ran into in thi= s=20 > github issue: > https://github.com/freebsd/poudriere/issues/701 This is a problem with makefs, I don't recall the details but even when using -f to ensure that a minimum of free inode were present I had problems, I'll try to find my notes on this. Using rawdisk this uses mdconfig/newfs so you don't have inodes problems. > For me this current setup is fine for my purposes, although I'm sure=20 > others can optimize this workflow a bit :) I won't be against you adding qcow2 support in poudriere image :) > Also, thanks again Allan and Dave Cottlehuber (who pinged me offlist)=20 > for giving me some hints and pointing me in the right direction! >=20 > Cheers, > -pete >=20 > --=20 > Pete Wright > pete@nomadlogic.org > @nomadlogicLA >=20 > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@free= bsd.org" --=20 Emmanuel Vadot