From owner-freebsd-virtualization@FreeBSD.ORG Wed Oct 15 12:32:49 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C435771 for ; Wed, 15 Oct 2014 12:32:49 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id 92406ED for ; Wed, 15 Oct 2014 12:32:47 +0000 (UTC) Received: (qmail 77040 invoked by uid 89); 15 Oct 2014 12:32:45 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@194.97.158.66) by mail.grem.de with ESMTPA; 15 Oct 2014 12:32:45 -0000 Date: Wed, 15 Oct 2014 14:32:45 +0200 From: Michael Gmelin To: freebsd-lists@potato.growveg.org, freebsd-virtualization@freebsd.org Subject: Re: can a bhyve instance be resized? adding another virtual disk? Message-ID: <20141015143245.527a4fff@bsd64.grem.de> In-Reply-To: <20141015115638.GA72800@potato.growveg.org> References: <20141015115638.GA72800@potato.growveg.org> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 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: Wed, 15 Oct 2014 12:32:49 -0000 On Wed, 15 Oct 2014 12:56:38 +0100 freebsd-lists@potato.growveg.org wrote: > Hello list, > > Can a bhyve instance be resized? I'm talking about the disk. > Say your end user needs more diskspace. They have 32GB. They need > 64GB. How do you do it? I presume one has to stop the guest, then use > truncate. What about if the guest OS isn't freebsd, and they use say > ext2 or 3? Will ext3 start yelling at me because I've resized it? > > What if they just want another disk? How does one refer to a > newly created virtual disk from a guest? How is it mounted to the > guest? > > thanks If you're using a zvol with UFS on top the procedure is quite simple, this is how I did it last time (at your own risk), I resized the disk to 15G (was like 5G beforehand). zvol is at tank/bhyve/virt03. Shutdown the VM. zfs set volsize=15G tank/bhyve/virt03 zfs rename tank/bhyve/virt03 tank/bhyve/virtxx gpart recover zvol/tank/bhyve/virtxx zfs rename tank/bhyve/virtxx tank/bhyve/virt03 # this is not the exact size, sorry gpart resize -i1 -s15359M zvol/tank/bhyve/virt03 growfs /dev/zvol/tank/bhyve/virt03p1 Start VM The renaming step was necessary so that GEOM picks up the new zvol size (this was on 10.0-RELEASE, might work without this on CURRENT). You might want to make a backup before doing this. -- Michael Gmelin