If your virtual machine has 4 vCPUs and it’s running on a multiple CPU host, how many SQL Per Proc licenses do you need to buy (if you’re not doing Server/CAL)? Well this question just came up at work and we wanted to get it right for the customer.
Right now, the answer is usually 1 per Proc license per virtual OSE (VOSE or virtual operating system environment – aka a guest OS in a VM) in the Hyper-V world. And here’s why.
Take a 4 vCPU VM running on a host with 2 * quad core CPUs. 4 vCPUs = 4 logical processors. With hyperthreading disabled (or enabled in this case) this VM never runs on more than 1 physical CPU. We can license SQL Server by pCPU. So if it never runs on 1 pCPU then we can buy just 1 copy of SQL Server per proc.
What if this VM runs on a Hyper-V cluster? Do we need to buy 1 per Proc license per host? Nope. We buy the licensing for the VOSE (VM OS).
Let’s change it up. What if the host has 2 dual core CPUs with no hyperthreading? Now we need to use a formula:
VOSE SQL Server Per Proc Licenses = A / B where
- A = number of VPUs in the VM
- B = Cores/CPU
In this case the number of SQL Server per proc licenses = 4/2 = 2. And that makes sense; the 4 vCPUs in the VM run on 4 logical processors, and the 4 logical processors are made up by 2 dual core CPUs.
Things are kind of easy right now with Windows Server 2008 R2 Hyper-V (maximum of 4 vCPUs per VM). But what about Windows Server 8 or vSphere 5.0 where it increases to 32 vCPUs/VM? Let’s have a 32 vCPU VM running on 4 * 10 core Intel CPUs with hyperthreading enabled. Ouch, my head hurts already.
- A = 32
- B = 20 (10 cores by 2 threads)
The formula gives us 32/20 = 1.6 pCPUs. The VM can’t run on 1.6 pCPUs; it will span 2 pCPUs (we always round up). That means the 32 vCPU VM can be licensed with just 2 SQL Server Per Proc licenses on this host.
Who wants to do division, fractions, and roundups? This might sound like hassle but it’s good because it saves you money and keeps you legal. In our most basic example above, the customer pays for 1 per proc license instead of 4. In the most complex one, they pay for 2 per proc licenses instead of 32.
And that’s how to license a single VM. Things get a whole lot more complex when licensing many SQL VMs and then you start looking at buying SQL Enterprise/Datacenter licensing at the host level, and then throw in virtualisation clustering where your SQL licensing impacts on your virtualisation design so you can save large amounts of money. I covered that one about a year ago and am happy to leave it there for the moment