From owner-freebsd-virtualization@freebsd.org Wed Nov 25 10:37:33 2015 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA031A36911 for ; Wed, 25 Nov 2015 10:37:33 +0000 (UTC) (envelope-from matt.churchyard@userve.net) Received: from smtp-outbound.userve.net (smtp-outbound.userve.net [217.196.1.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.userve.net", Issuer "Go Daddy Secure Certificate Authority - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 903AD14F3 for ; Wed, 25 Nov 2015 10:37:33 +0000 (UTC) (envelope-from matt.churchyard@userve.net) Received: from owa.usd-group.com (owa.usd-group.com [217.196.1.2]) by smtp-outbound.userve.net (8.15.1/8.15.1) with ESMTPS id tAPAIF2e088296 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 25 Nov 2015 10:18:19 GMT (envelope-from matt.churchyard@userve.net) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=userve.net; s=201508; t=1448446699; bh=xWQb1cJ4owSKVp/KoOfXfBsHVDXYXBSCcVBrFSJ4bXQ=; h=From:To:Subject:Date:References:In-Reply-To; b=ne4haeJtjTHk3Pjrx0gE8m5DybKePMFEu00GhpjSKKpNPJuMCUODYRT6DjV4FlYf3 Lr7KpBQTOBty3kevLDnnuVU1WQBVMpwLQ7Y2zjC0g00ZpRk4AvwHDDgLktP7zO0ATi qYOxHCaOa4sinAHlxdgIaQPc10opBXHfbxmtyogg= Received: from SERVER.ad.usd-group.com (192.168.0.1) by SERVER.ad.usd-group.com (192.168.0.1) with Microsoft SMTP Server (TLS) id 15.0.847.32; Wed, 25 Nov 2015 10:18:09 +0000 Received: from SERVER.ad.usd-group.com ([fe80::b19d:892a:6fc7:1c9]) by SERVER.ad.usd-group.com ([fe80::b19d:892a:6fc7:1c9%12]) with mapi id 15.00.0847.030; Wed, 25 Nov 2015 10:18:09 +0000 From: Matt Churchyard To: FreeBSD virtualization Subject: RE: adding diskspace to a bhyve instance Thread-Topic: adding diskspace to a bhyve instance Thread-Index: AQHRIvGkSMYVLLUmkUGU2mBxKPQEdp6jvw8AgAjLkqA= Date: Wed, 25 Nov 2015 10:18:09 +0000 Message-ID: <6ee51d8f276a4b259bda009dc863e9e7@SERVER.ad.usd-group.com> References: <20151119172034.GA93977@potato.growveg.org> <564E263A.3030106@gmail.com> In-Reply-To: <564E263A.3030106@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.0.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Nov 2015 10:37:33 -0000 On 19/11/15 12:20 PM, John wrote: > Hello list, >=20 > What's the best way of increasing the space of a bhyve guest instance? > Would it be via growfs? Inside or outside of the vm? Or would it be=20 > better to truncate another chunk of space and refer to it in /etc/fstab? >=20 > thanks, > Hello John, >=20 > - Do you use virtio-blk (a file created with 'truncate') or ahci-hd (A > ZFS filesystem, for example) for your guest disk? You have to increase th= e space of the virtual disk that bhyve uses. I see no reason to associate truncated files with virtio, and ZVOL with ahc= i-hd. You could just as easily use virtio with a ZVOL and ahci-hd with a tr= uncated file. The choice between the two emulation modes really just comes = down to which is supported better by the guest, or the one that performs be= tter in your environment. (For example Windows doesn't support virtio-blk, = so you need to use ahci-hd regardless of whether you're using ZFS/ZVOL stor= age or a sparse file). > - If you used 'truncate', my guess is that you can use truncate to create= a new file of larger size. Then, boot into a livecd in bhyve with both > d= isks and do a 'dd' from one disk to the other. I have tried to 'dd' between= files on the host but that didn't seem to work. > - If it is a ZFS filesystem, create a new filesystem with 'zfs create -V = 50gb zroot/new-volume/' then use a 'zfs send ... | zfs receive ...' > Not that I've ever done it, but I'm under the impression you should be able= to just make the existing disk device bigger by 'truncating' it to a large= r size, or by using ZFS commands to increase the size of a ZVOL. There shou= ld be no need to create a brand new disk image and dd or send/recv the data= over. Of course that's the easy bit. The more dangerous part is resizing the part= itions inside the guest (if it's not whole disk ZFS), and then resizing the= filesystems. If the disk is GPT partitioned in the guest you will probably= have to recover the partition table first, as the secondary copy will no l= onger exist at the end of the disk. You'll then need to resize the partitio= ns (hopefully the 'main' partition you want to resize is the last on the di= sk as that'll probably make it easier). Once done you then need to resize t= he filesystem. For ZFS you can usually just 'zpool online -e'. For UFS you'= ll need to grow the filesystem as shown in the handbook. Adding another disk image to the guest and just using that is obviously a m= uch simpler solution, if you're happy to permanently have multiple disks at= tached to the guest and reorganise your data. That's what I did when one of= my mail vm's got too full; I just created a second disk, formatted and mou= nted it on '/mail', and moved all the users there. Matt > - Are these FreeBSD guests (and which filesystem - UFS or ZFS) or Linux > guests? > - If these are FreeBSD guests running UFS, look at https://www.freebsd.or= g/doc/handbook/disks-growing.html > - If these are FreeBSD guests running ZFS, you can probably create the fi= lesystems on your new disk and then use zfs send & receive > - If these are linux guests, you will have to use a livecd and something = like 'gpart'. > Thanks, > Manas _______________________________________________ freebsd-virtualization@freebsd.org mailing list https://lists.freebsd.org/m= ailman/listinfo/freebsd-virtualization To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebs= d.org" From owner-freebsd-virtualization@freebsd.org Thu Nov 26 04:21:28 2015 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B5F7A3796B for ; Thu, 26 Nov 2015 04:21:28 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (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 5B72C1C18 for ; Thu, 26 Nov 2015 04:21:28 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: by igcph11 with SMTP id ph11so3758814igc.1 for ; Wed, 25 Nov 2015 20:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=f+T+Rn43/h2FCPNkalPeu2itCEYRIJEngvEwiWy6sfE=; b=z5MToQwyld1lKQN1Tb+3Nlx3GCBnBbAjavYOwyCZicEKv/iOg6a+xU/79WnhNrtyru WSSxHziL/U3PAjCAVNxrabYWAfbLumrgrTWXUPZDlAWUjcDgFimHIfnx++D0Qrc2wpPP PXP0TXwEyOQx9X0pbI9CyqKnNRHnpEMbLnm9LwFbdyBYpS8r9GLJjtSrtESWDaiOEjaq fweE5tYiELVn5CHmpmgL5EtozAuOWXaMdPCbkFyd00IOVWsKhnuRm0gcO9362Q5XnSLD HsqzkzUNNBA+AAYXM9ha+BViUEWGw01tUOTE7SKQoBYNMASssI+BZZf4rMJdKuEWDSgw FtMA== MIME-Version: 1.0 X-Received: by 10.50.4.105 with SMTP id j9mr1074398igj.76.1448511687783; Wed, 25 Nov 2015 20:21:27 -0800 (PST) Received: by 10.107.16.22 with HTTP; Wed, 25 Nov 2015 20:21:27 -0800 (PST) Date: Wed, 25 Nov 2015 22:21:27 -0600 Message-ID: Subject: Debugging high(ish) CPU usage on an idle VM From: Dustin Marquess To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 26 Nov 2015 04:21:28 -0000 I'm running an 11.0-CURRENT (from exactly a week ago) on a 32-core (16-module) AMD Bulldozer system. Guest is NetBSD 7.99.21 HEAD, with timecounter hard-forced to ACPI-safe instead of hpet (HPET seemed unstable, although HPET is being used in the host FreeBSD). I start bhyve using a simple script: #!/bin/sh RAM=8192M VM=netbsd VMROOT=/usr/local/vm CPUS=8 grub-bhyve -m ${VMROOT}/${VM}/device.map -d ${VMROOT}/${VM} -M ${RAM} ${VM} exec bhyve -A -H -P -w -u -s 0:0,amd_hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap0 -s 3:0,virtio-blk,/dev/zvol/pool/vm/${VM},nocache -s 4:0,virtio-rnd -l com1,stdio -c ${CPUS} -m ${RAM} ${VM} While the guest is entirely idle: 37975 root 1 20 0 13084K 3016K wait 31 0:00 0.00% sh load averages: 0.00, 0.00, 0.00; up 1+22:00:40 03:34:40 18 processes: 16 sleeping, 2 on CPU CPU states: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle Memory: 923M Act, 6996K Wired, 12M Exec, 900M File, 5911M Free Swap: 8195M Total, 8195M Free Bhyve itself seems to go bounce around between ~6% CPU usage to 18%: last pid: 37995; load averages: 0.22, 0.38, 0.41 up 5+20:05:17 21:26:35 24 processes: 1 running, 23 sleeping CPU: 0.0% user, 0.0% nice, 0.5% system, 0.1% interrupt, 99.4% idle Mem: 2572M Active, 5735M Inact, 19G Wired, 61M Buf, 35G Free ARC: 14G Total, 3656M MFU, 10G MRU, 16K Anon, 128M Header, 566M Other Swap: 64G Total, 64G Free PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 18577 root 18 20 0 9247M 5048M kqread 15 427:55 18.65% bhyve Any ideas to help troubleshoot where the CPU usage is going, DTrace? Thanks! -Dustin