[one-users] CPU issues with KVM

Javier Fontan jfontan at gmail.com
Tue Oct 11 04:23:14 PDT 2011


VCPU means the number of cores available for the VM so if you want
more than one core visible in your VM change VCPU to the value you
will need. By default VCPU is 1 so if you do not specify it you will
see one processor.

CPU in KVM is only used as a hint to the scheduler on how much CPU the
VM will consume so there's no overcommitment. You will usually ask the
same CPU as VCPU.

On Sat, Jul 16, 2011 at 10:15 PM, Madhurranjan Mohaan
<mohanma at thoughtworks.com> wrote:
> Hi All,
>
> I have the same issue as the other thread on overcommitment of CPU
> (http://lists.opennebula.org/pipermail/users-opennebula.org/2011-May/005227.html)
> .
>
> I have an Intel Xeon server on which I am currently running open nebula over
> kvm.
>
> I went through how KVM takes care of CPU and saw my template file from which
> I spawn VMs and that doesn't specify VCPUs. I have 2 questions :
>
> 1. Does VCPU value itself matter ? Because its 0 in all my VMs .  Htop on
> the box shows high cpu usage on specific cores .
>
> for i in `virsh list | grep running | cut -d " " -f3` ; do echo $i ,  `virsh
> vcpuinfo $i`  ; done
> one-27 , VCPU: 0 CPU: 15 State: running CPU time: 13579.7s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-37 , VCPU: 0 CPU: 11 State: running CPU time: 35643.0s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-41 , VCPU: 0 CPU: 8 State: running CPU time: 224883.1s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-50 , VCPU: 0 CPU: 15 State: running CPU time: 59100.8s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-51 , VCPU: 0 CPU: 14 State: running CPU time: 196545.6s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-52 , VCPU: 0 CPU: 13 State: running CPU time: 75126.3s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-53 , VCPU: 0 CPU: 1 State: running CPU time: 148284.6s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-54 , VCPU: 0 CPU: 4 State: running CPU time: 53316.7s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-56 , VCPU: 0 CPU: 13 State: running CPU time: 11596.5s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-57 , VCPU: 0 CPU: 6 State: running CPU time: 12659.4s CPU Affinity:
> yyyyyyyyyyyyyyyy
> one-68 , VCPU: 0 CPU: 13 State: running CPU time: 18008.8s CPU Affinity:
> yyyyyyyyyyyyyyyy
>
> 2. When I actually have multiple cores in kvm, the link
> http://docs.fedoraproject.org/en-US/Fedora/13/html/Virtualization_Guide/ch25s06.html
> shows me that this will be displayed in the following manner. When I have an
> equivalent VM with 2 dedicated CPUs ( CPU 2 in open nebula) , i don't see 2
> cpus actually allocated to that VM  like below.:
>
> # virsh vcpuinfo guest1
> VCPU:           0
> CPU:            3
> State:          running
> CPU time:       0.5s
> CPU Affinity:   yyyyyyyy
> VCPU:           1
>
> CPU:            1
> State:          running
> CPU Affinity:   yyyyyyyy
> VCPU:           2
> CPU:            1
> State:          running
> CPU Affinity:   yyyyyyyy
> VCPU:           3
> CPU:            2
> State:          running
>
>
> Thoughts ?
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>



-- 
Javier Fontan, Virtualization Technology Engineer/Researcher
DSA Research Group: http://dsa-research.org
OpenNebula Virtual Infrastructure Engine: http://www.OpenNebula.org



More information about the Users mailing list