[libvirt-users] using more than 1 core by a virtual machine

Zvi Dubitzky DUBI at il.ibm.com
Mon Mar 21 08:49:36 UTC 2011


Zvi Dubitzky 
Email:dubi at il.ibm.com
IBM Haifa Research Laboratory    Phone: +972-4-8296182
Haifa, 31905, ISRAEL 



Osier Yang <jyang at redhat.com> wrote on 21/03/2011 10:27:07:

> From: Osier Yang <jyang at redhat.com>
> To: Zvi Dubitzky/Haifa/IBM at IBMIL
> Cc: libvirt-users at redhat.com
> Date: 21/03/2011 10:27
> Subject: Re: [libvirt-users] using more than 1  core by a virtual 
machine
> 
> 于 2011年03月17日 02:04, Zvi Dubitzky 写道:
> > My virtual machine xml file has<vcpu>2</vcpu>   clause  while the host 
has
> > 2 physical cpus (cores).
> > Is this enough to cause a VM  running 2 endless loop threads  to use 
the 2
> >   cores ?
> > In my case the VM running reports (cat /roc/cpuinfo) that it has 2 
vcpus
> > but it uses only 1 core (at a time)  because
> > the 'top' at the host shows 100%cpu   (out of total 200%)  used by the
> > endless loop application
> > Also virsh vcpuinfo<vm>  shows only 1 CPU and 1 vcpu
> 
> Is it really only 1 vcpu is showed? it should be two, that's
> strange if you specified two vcpus, but only 1 is showed.
> and by default, if you don't specify "cpuset" in <vcpu>, it uses
> all the physical cpus, if I'm right, so you should be able to
> see something like:
> 
>     CPU Affinity:   yy
> 
> Could you try specify "cpuset" explicitly like:
> 
> <vcpu cpuset="0,1">2</vcpu>
> 
> And see what it happens?
> 

NO. There 2 vcpus in the VM screen . I pasted only one of them . yes there 
is 
PU Affinity:   yy   anyhow in 'virsh  vcpuinfo <domain> even before fixing 
the problem as below.

I solved the problem : The BIOS did not have VT enabled although 
multiprocessing item was already enabled in the BIOS and also some item 
called "virtualization " was already  enabled . But that was not enough : 
I also had to drop the following clause from the VM xml file:
'<emulator>/usr/local/bin/qemu-system-x86_64</emulator>'
Anyhow: I do not understand why using multicore under a VM is dependent on 
the VT enabled

Now the 'top' utility (at the host) shows qemu-kvm is the running  process 
instead of qemu-system-x86_64 as before the fix . On the another Debian 
system I did not have to drop the <emulator> clause from the xml and the 
VM was still using all the cores  though ! But the libvirt at the Debian 
was newer (0.8.6) while the fedora14 was running libvirt 0.8.3

Do you know what is exactly qemu-system-x86_64 vs. qemu-kvm . Does the 
latter appear only if 
HW virtualization is active in the BIOS ?

thanks anyhow



> Regards
> Osier
> 




More information about the libvirt-users mailing list