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!
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:
On libvirt 0.8.3, if you type:
it will list the topology of the host:
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.:
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.
Topology settings are fully supported in virt-manager since Ubuntu 15.04.
From virt-manager > CPUs > Topology:
The following is created from the above settings in virt-manager. You do not need to enter these with virsh edit.
Topology stopped being recognized by windows after an update, and again limits the Virtual CPU's to 2 sockets.
To fix this, use 'virsh edit' to hide the kvm feature, and add hyperv features. After a complete shutdown and reboot the windows VM will again recognize multiple CPU's.
Why does my Windows 7 VM running under Linux' KVM not use all the virtual processors?
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.
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.