From mboxrd@z Thu Jan 1 00:00:00 1970 From: RW Subject: Re: KVM and cpu limiting Date: Fri, 02 Jul 2010 10:02:03 +0200 Message-ID: <4C2D9CFB.8090402@tauceti.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from tauceti.net ([62.245.250.166]:41551 "EHLO www.tauceti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238Ab0GBICF (ORCPT ); Fri, 2 Jul 2010 04:02:05 -0400 Received: from [10.0.0.8] (unknown [10.0.0.8]) by www.tauceti.net (Postfix) with ESMTP id BC0DCC2B2AE for ; Fri, 2 Jul 2010 10:02:03 +0200 (CEST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: > Is it possible to limit cpu usage be VM when using qemu+kvm? > First thing you can do is to only provide one or two virtual CPUs to a VM. This is normally a not to bad way to limit CPU usage. But maybe cgroups can help you more: http://www.mjmwired.net/kernel/Documentation/cgroups.txt > I need one server to run a lot of VMs (much more than cpu cores I > have). Each VM must have it's guaranted cpu time or time slice it must > use. > > Is it possible to make such limits? Is it possible to modify > /proc/cpuinfo of VMs? > > You can start Qemu/KVM with different "-cpu" parameter: bern:~ # qemu-kvm -cpu ? x86 qemu64 x86 phenom x86 core2duo x86 kvm64 x86 qemu32 x86 coreduo x86 486 x86 pentium x86 pentium2 x86 pentium3 x86 athlon x86 n270 Or just provied "-cpu host". Then you get the same output inside the guest as the host. - Robert