Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

All

I've had a problem on my server since I migrated one of my VM's from Windows 2008 Server to Windows 7 (ultimate): though I've assigned four cores to the VM and it even seems to see them, it seems to think it has two cores!

It recognises my processors but doesn't use them!

Can anyone tell me what's going on here? I thought it could have been some incompatibility between KVM and Windows 7 but since it sees the virtual processors I'm beginning to think not...any clues?

Here's a screenshot of process manager showing only two cores on the same box:

Task manager

share|improve this question
    
Are you sure that it's not showing you two dual-core procs? –  phoebus Jan 11 '10 at 8:20
    
@phoebus: I did wonder that, but then on all versions of windows where I have run this setup before I see four cores when looking in processor monitor, which I don't here. –  jkp Jan 11 '10 at 8:23
    
When you say processor monitor, do you mean the performance monitoring section of task manager? Because based solely on your screenshots, you're showing evidence of two, two-core processors. If that's the case, you should see all 4 cores in the performance monitor. If you don't, then yes, something is wonky. –  phoebus Jan 11 '10 at 8:42
    
@phoebus: yes, I mean the performance monitoring section of task manager. Definitely seems wonky to me... –  jkp Jan 11 '10 at 9:01

4 Answers 4

up vote 7 down vote accepted

I suspect the processors are being presented as single core processors in separate sockets. Windows 7 ultimate supports up to 2 socket systems, so it will use 2 processors.

I don't know if you can configure KVM to present the processors as either a single quad core CPU or 2 dual core CPUs, which should resolve the problem.

share|improve this answer
1  
That's correct. ATM there's no way to change the topology. –  Luca Tettamanti Jan 11 '10 at 12:49
    
Wow, I did't know this. Thanks for correctly putting your finger on the issue. @Luca: do you know if such support is planned? I'm I actually using the extra two cores or are they going to waste? –  jkp Jan 11 '10 at 13:55
1  
@Luca: actually since qemu 0.12 you can change the topology. I've upgraded my userspace kvm components but I think I need the new kernel mod for it to work....anyway, it can be done :) –  jkp Jan 11 '10 at 15:15
    
Ah, cool... I should upgrade too then :) –  Luca Tettamanti Jan 11 '10 at 16:11
    
Keep in mind that you can run the newest kvm kernel module on your current older kernel. You will probably have to compile the module yourself unless you can find a repository for your distro that has the binary for you. But building a module isn't too difficult to do. –  3dinfluence Jan 19 '11 at 1:25

On libvirt 0.8.3, if you type:

virsh capabilities | grep topology

it will list the topology of the host:

<topology sockets='1' cores='4' threads='1'/>

The numbers refer to sockets, cores per socket, and threads per core. Add this line to the cpu entry in the xml file to allow windows to use all 4 cores, e.g.:

 <vcpu>4</vcpu>
 <cpu>
     <topology sockets='1' cores='4' threads='1'/>
 </cpu>
share|improve this answer
    
knew it, but forgot about it - well then again there's serverfault and all those people writing all this awesome stuff. thanks for the tip! –  fen Nov 12 '11 at 17:31

In RHEL/CentOS 5.5 (kvm >= 83-164.el5) the kvm binary supports the "-smp N,cores=N" option too (there are backport patches in the package); however, the libvirt version does not support the <topology> element in the domain XML. A workaround is to create a wrapper script for /usr/libexec/kvm which adds the appropriate option and specify that script in the <emulator> element instead of the default path.

share|improve this answer

It is worth noting that Ubuntu 10.4 (Lucid) has version 0.7.5 of libvirt while support for topology was added to libvirt in version 0.7.6. Ubuntu 10.10 (Maverick) has 0.8.3 libvirt and so should be able to directly support the topology specification in the XML without a wrapper.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.