MS-SQL Licensing for Virtualised Environments

Hyperthreading

In a virtualized environment, the compute capacity limit is based on the number of logical processors, not cores. The reason is that the processor architecture is not visible to the guest applications.
For example, a server that has four sockets populated with quad-core processors and the ability to enable two hyperthreads per core contains 32 logical processors with hyperthreading enabled. But it contains only 16 logical processors with hyperthreading disabled. These logical processors can be mapped to virtual machines on the server. The virtual machines' compute load on that logical processor is mapped to a thread of execution on the physical processor in the host server.
You might want to disable hyperthreading when the performance for each virtual processor is important. You can enable or disable hyperthreading by using a BIOS setting for the processor during the BIOS setup. But it's typically a server-scoped operation that will affect all workloads running on the server. This might suggest separating workloads that will run in virtualized environments from workloads that would benefit from the hyperthreading performance boost in a physical operating system environment.
(https://docs.microsoft.com/en-us/sql/sql-server/compute-capacity-limits-by-edition-of-sql-server?view=sqlallproducts-allversions )

SQL2012+ Virtualization Licensing

  • To license a VM with core licenses, buy a core license for each virtual core (virtual thread) allocated to the virtual machine (minimum of 4 core licenses per VM).

  • To license a VM with a server license (for Business Intelligence or Standard only), buy the server license and buy matching SQL Server CALs for each user.

  • Each licensed VM that is covered with Software Assurance (SA) can be moved frequently within a server farm or to a third party hoster or cloud services provider without buying additional SQL Server licenses.

  • Alternatively, license the entire server (or server farm) with EE core licenses and SA based on the total number of physical cores on the servers. This allows an unlimited number of virtual machines that can be moved frequently within a server farm or to a third party hoster or cloud services provider. Without SA you can have the same number of VMs as cores (16 cores = 16 VMs). To run 17 VMs you would need to purchase an additional core license.

  • If you license a single server from a server farm then you must make sure that SQL will only run on that host. For VMWare this means using DRS affinity rules. Note that it would be safer to license at least two servers as this would allow VMWare to protect you from host failure.

NOTE: Licensing individual VMs is the only licensing option available for SQL Server 2014 Standard Edition customers who are running the software in a virtualized environment under the Per Core model.

NOTE: If licensing per host, Microsoft does not care if you disable cores; all cores must be licensed. If you do not want to pay for a core, it physically cannot exist in the server. (1)

NOTE: It is recommended that when licensing per host, you have a method (log, document, etc.) to keep track of vMotion and when VMs are started/stopped to prove compliance if necessary. (1)

From SQL Server 2016 Licensing Guide:

License Mobility is a use right that is available for all editions of SQL Server 2016 software licenses with active Software Assurance (SA) coverage. With this SA benefit, customers can reassign SQL Server licenses to different servers within a server farm as often as needed. Customers can also reassign licenses to third party shared servers. License Mobility is available for licenses under both the Per Core and Server+CAL license models.

SQL Server licenses that are not covered with active SA can only be reassigned to a different server within a server farm once every 90 days, and they cannot be reassigned to a third party web hoster or non-private cloud at any time. (In the event of permanent hardware failure, the 90-day reassignment limit is waived.)

From vmware:

Without SA, you cannot rehost a VM more than once every 90 days. If your company relies heavily on vMotion and moves VMs around all the time (or more than once every 90 days), you will need to purchase SA. Remember that the new host for the VM must have enough licenses on that host to cover the VM if using host-based licensing.(1)

License Audit

Assuming Per Core licensing (rather than Server+CAL)...

To confirm whether you have enough licenses to cover your estate you need to know...

  • The number of vcpus allocated to your virtual servers.

  • The cluster where the virtual server is hosted.

  • The number of physical cpus in all the servers underlying the cluster.


Some of the information above will need to come from your hypervisor but see also the Overview script on the SQL Configuration page.

You need...

  • Enough licenses to cover 4 cores or the number of vcpus per virtual machine (whichever is higher) or enough Enterprise Edition licenses to cover every physical core in all physical servers underlying the cluster