A VMware ESX 4 (and ESXi 4) virtual machine can have up to 8 virtual CPUs. Even though the underlying physical hardware has multiple cores per socket, each virtual CPU presented to the guest OS appears as a separate socket.
This normally does not matter because guest operating systems treat cores as CPUs anyway. However, there is one significant area that is affected — licensing. Some operating systems and applications are licensed by physical CPU, regardless of the core count. If this license is enforced only by a legal agreement, and not by technology, then there is still no problem — configure a four vCPU VM on a system with a quad-core processor and you are in the clear.
The issue arises when software enforces the CPU socket limitation. One good example of this is an operating system like Windows XP, which supports a maximum of two sockets — there is no way to use four cores if each is presented as a socket even though such an action would still be allowed within the license agreement.
To address this, vSphere 4 introduced a new undocumented VM configuration option called cpuid.coresPerSocket.
If you have experimented with the feature — Duncan Epping already wrote about it a while back — you may have wondered if there is a method to see how many cores and sockets a Windows system has. After all, Device Manager simply shows each core as a CPU.
One of the more recent Sysinternals tools from Mark Russinovich does that very thing.
Acquiring Sysinternals, and gaining Mark Russinovich, was an exceptionally wise move by Microsoft. So far, so good — knock on wood — Microsoft has not done anything ridiculous like restricting the tools to be part of a Software Assurance (SA) incentive.
The Sysinternals utility is called Coreinfo. In these examples I am using it with two flags to show cores and sockets:
coreinfo -c -s
Here is a default VMware ESX 4 VM with 8 vCPUs:
After changing cpuid.coresPerSocket to 8, like so:
The guest OS sees a single socket, 8-core VM:
Setting the value to 4 divides the 8 cores into two sockets like this:
That last setting is the most legitimate for licensing purposes, as the underlying hardware here is a dual quad-core.
Please remember that this feature is currently not supported by VMware GSS. If you need to use it in production, please contact your VMware account team so that your use case can be taken into account when planning future releases.
Pingback: Tweets that mention VMware ESX presents single-core CPU sockets to virtual machines, but this behavior can be modified | VCritical -- Topsy.com
“If this license is enforced only by a legal agreement, and not by technology, then there is still no problem — configure a four vCPU VM on a system with a quad-core processor and you are in the clear.” – you are not in the clear. You should carefully read your legal agreement. In our case (IBM Informix IDS database server/per processor license) they count physical cores, no matter how many vCPUs you configure in your VM. We like CPU power and VMware features more than we like IBM, so we changed our database vendor.
Ralf, thanks for the comment. I enjoyed that last sentence. 🙂
Of course, if the vendor is charging per core in the first place, there is no advantage to grouping multiple virtual cores into a virtual socket.
Thanks for reading VCritical.
Pingback: Huggy les bons tuyaux & licensing au socket - Hypervisor.fr
Pingback: Virtualization Short Take #30 - blog.scottlowe.org - The weblog of an IT pro specializing in virtualization, storage, and servers
Eric, give CPU-Z from http://www.cpuid.com a try and see if it also properly reflects Cores vs CPUs. Might be an easier time for some people rather than command line tool. (Don’t get me wrong, I’m a CMD geek in Windows myself)
Dan, looks like CPU-Z works as well. Thanks for the contribution.
msinfo32 also works.
Is my understanding of VMWare licensing correct that only the top of the line Enterprise Plus edition will allow one VM to access all 8 cores of a modest 2x4core server like you are discussing?
If you have a 2x6core server, would a single VM ever be able to use all the CPUs?
Yes, Enterprise Plus is needed for 8-way SMP and for now, that is the limit for a single VM.