I'm running kvm on a MPU system with two Xeon E5-2680v2 @ 2.8GHz CPUs. All my VMs are Windows boxes, predominantly version 10. libvirtd is in version 5 though I experienced the described issues also with earlier versions.

As for the CPU mode, I'm using a "host-passthrough" configuration so that the VM can use the whole feature set of the CPU.

<vcpu placement='static'>6</vcpu>
<cpu mode='host-passthrough' check='partial'/>

Now, here is where I get a bit lost. Say I configured a VM with 6 vCPUs as above, and I don't specify a topology (which seems a valid thing to do), then my Windows VM claims it has access to 2 sockets and only 2 virtual processors, in total. This is not just a matter of what's shown there, it's clearly reflected in the performance.

As soon as I specify the topology and change the above lines to look as follows:

<vcpu placement='static'>6</vcpu>
<cpu mode='host-passthrough' check='partial'>
   <topology sockets='1' cores='6' threads='1'/>

the Windows VM now recognizes the correct amount of vCPUs and performance increases accordingly.

While I understand that the topology might differ in terms of how sockets, processors and threads are distributed, it just seems weird that not the right number of total vCPUs is given to the VM unless the topology is specified.

While I'm glad it works fine now, I'd still like to better understand why this issue exists and if I chose the best way to work around it.

1 Answer 1


More than a year has passed since I asked here, I may have the answer myself by now.

Although I couldn't find any corroborating information on the website of libvirt itself, on the OpenStack wiki it says:

The libvirt driver will expose all vCPUs as individual sockets, with 1 core and no hyper-threads.

While it would be nice to see such a clear explanation from the libvirt project itself, this indeed seems to be confirmed by my own observation as mentioned in my question. So, if true, then it's clear why my Windows 10 Pro VMs won't show the correct number of vCPUs: Windows 10 Pro is limited to two physical sockets, as described in this Wikipedia article. It seems safe to say that libvirt is creating six sockets of which only 2 are allowed by Windows 10 Pro, explaining the behavior I described.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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