Do Hyper-V guests see multiple CPUs (sockets) or multiple CPU cores when assigned more than 1 vCPU

hyper-vhyper-v-server-2008-r2

I have SQL Server 2008 Express running on Hyper-V based virtual machine with two vCPU-s. I've just been reading up on SQL Server 2012 Express and noticed that it's CPU is "Limited to lesser of 1 Socket or 4 cores" (http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx)

My question is how do the SQL Server 2012 limits on CPUs/Cores translate into vCPU-s? Are they "processors" or are they "cores"?

EDIT:

I've just found this: Are vCPU the same as 1 Socket, or a single Core?

Basically the solution is download CPU-Z and check, which I did. On my 2 x vCPU VPS the CPUZ is showing 1 core 2 thread so it sounds like my SQL Express should fly on both vCPUs. However when I go into processor affinity configuration it shows 2 processors there making it appear that it is using just one of the vCPUs allocated to my VPS. I am utterly confused :/

Best Answer

Each vCPU counts as a single CPU from within the guest OS, which means that guest OSes and the applications inside them, each physical core is a single CPU.

Virtualization abstracts the physical hardware, so all the guest OS and any application inside it can see are the values the hypervisor passes to them. In your case, the hypervisor tells the OS you have two CPUs because that's how you set it up - to have two virtual CPUs. So when SQL goes to look at how many CPUs you have, SQL sees the two [virtual] CPUs you assigned, so SQL Express limits itself to using one.

I guess I should add this: A quick and dirty on how to configure vCPUs in Hyper-V. If you want SQL Express to use more CPU resources, put in one vCPU and map it to more physical processors and/or a higher resource limit. That will allow SQL Express to use as much of the CPU resources the host can allocated to it, without bumping into the CPU licensing limitation of SQL Express.

Oh, but don't do this on your existing OS, as changing the number of processors between single and multiple CPUs in a Windows OS leads to trouble - it makes the OS unstable. Create a new VM, with a new OS install, and this time just create one vCPU, which you can map to more physical resources.