Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Oct 2014 14:32:45 +0200
From:      Michael Gmelin <freebsd@grem.de>
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>

next in thread | previous in thread | raw e-mail | index | archive | help


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



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