A guide to optimising Microsoft licensing on AWS
Cost optimization has become a priority as more companies move their corporate workloads to the cloud. Licensing is one of the most significant costs associated with running Microsoft workloads on Amazon Web Services (AWS). In this article, the authors will discuss seven specific optimization strategies you can implement to help reduce costs and remain compliant with Microsoft licensing on AWS.
Microsoft licensing options on AWS
AWS offers a range of flexible licensing options for customers who want to run their Microsoft workloads on AWS, as shown in Figure 1.
- Use Licensed Instances (LI) with AWS. Using licensed instances provides access to fully compliant Microsoft software licenses bundled with Amazon Elastic Compute Cloud (Amazon EC2) instances. Pay for them continuously, with no upfront costs or long-term investment. You can choose Amazon Machine Images (AMI) with Microsoft Windows Server only or with Windows Server and Microsoft SQL Server pre-installed.
- Transfer licences to AWS. By transferring your licence (BYOL), you have two options:
- BYOL for products with license portability: Licence portability is a Microsoft Software Assurance (SA) benefit that allows you to move specific product licenses to a shared cloud infrastructure, including the default (shared) Amazon EC2 lease. Products eligible for license portability include SQL Server, CAL licenses for Remote Desktop Services users, System Center Server, Exchange, and SharePoint. An active Software Assurance package is required to be eligible for license mobility. Additional information can be found on the License Mobility page on the AWS website.
- BYOL for products without license portability: for Microsoft products that do not have the benefit of license portability, such as Windows Server or SQL Server without SA, AWS offers dedicated lease options to enable these eligible licenses in the cloud. A dedicated lease also offers licensing at the physical core level, which can reduce licence usage by 50% or more if you are using upgradable instances.
Cost Comparison: LI and BYOL
BYOL helps you avoid paying for the licenses you own, reducing the cost of supporting Microsoft workloads on AWS. Table 1 shows the monthly cost of supporting a single c5.xlarge instance 24/7 in the Eastern United States (Northern Virginia) region with different AWS LI pricing models. This indicates that a significant proportion of the cost of Amazon EC2 instances comes from licensing when using the LI model.
Product | Monthly On Demand Cost |
---|---|
Windows Server + SQL Server Enterprise | $1357/month (LI) |
Windows Server + SQL Server Standard | $610/month (LI) |
Windows Server only | $259/month (LI) |
Compute Only (Linux) | $127/month |
7 strategies for optimizing Microsoft licensing on AWS
Customise your AWS instances
One of the key strategies for optimizing license usage is to resize your AWS instances. Resizing involves selecting an instance type based on CPU, memory, and storage requirements. By choosing the right instance size, you can ensure that you are not paying for resources you do not need, which can result in significant savings. For example, Windows and SQL servers are typically licensed based on the number of virtual processors or cores. By adjusting the size, you can reduce the number of virtual processors or cores that Microsoft software runs on and reduce the instance's cost and the number of licenses required.
AWS offers a free program called AWS Optimisation and Licensing Assessment (OLA) to help you optimize your licensing and reduce costs by sizing accordingly. OLA assesses your licensing requirements for workloads running locally, on AWS, or in another cloud.
Bring your qualifying licenses to the Windows Server
Owning your Windows Server licenses is one of the most cost-effective strategies to leverage your existing investments to reduce your AWS spend.
2019 Microsoft changed the licensing terms for non-transferable products such as Windows and SQL Server without SA. Under the new terms, SQL Server 2017 and earlier versions without SA can only be deployed on a dedicated host. For Windows Server to qualify for BYOL, the following conditions must be met:
- Perpetual, perpetual licences of Windows Server purchased before 1 October 2019 or under an Enterprise Agreement that started before 1 October 2019.
- Windows Server versions 2019 and earlier.
- Windows Server deployed on a dedicated host.
Physical core licensing
BYOL allows licensing at the physical core level on dedicated Amazon EC2 hosts, enabling the maximum number of instances deployed per-host configuration. This can be done with Windows Server Data Centre Edition and SQL Server Enterprise Edition.
For a dedicated r5 host running Windows Server Data Centre Edition, 48 licenses per core are required, allowing a combination of instances to be deployed using up to 96 virtual processors. Licensing at the physical core level avoids additional costs compared to vCPU licensing and achieves the best possible value from the licensing investment.
When deploying SQL Server Enterprise Edition on dedicated hosts, you can license at the physical core or virtual processor level. For example, if you use 50% of the virtual processors of a dedicated host for SQL Server Enterprise, licensing at the physical core level is beneficial. In this situation, consider a dedicated r5 host with 48 physical cores. By licensing SQL Server Enterprise Edition at the physical core level, you need 48 licenses to license the entire host. In contrast, with a shared lease, where vCPU does licensing, you would need 96 SQL Server Enterprise Edition licenses for the same workload. Therefore, licensing by the physical core on dedicated hosts can save up to 50% of SQL Server Enterprise Edition licensing costs compared to a shared lease.
Merge SQL Server instances
SQL Server requires at least four licenses per core per Amazon EC2 instance, even if the instance only has two virtual processors. Running SQL Server on an Amazon EC2 instance with fewer than four vCPUs will result in paying for more licences than you can actually use.
Consolidating named SQL Server instances into a single Amazon EC2 instance is a great way to optimize license usage and reduce costs. For example (see Figure 3), consolidating two Amazon EC2 instances, each with two vCPUs, into a single Amazon EC2 instance with four vCPUs can reduce licensing requirements by 50% because only four licenses per core are required, rather than eight.
Change to an older version of SQL Server
SQL Server Enterprise Edition is significantly more expensive than SQL Server Standard Edition, so downgrading the version will result in more significant savings.
Two commonly used SQL Server Enterprise Edition features are Transparent Data Encryption (TDE) and Always Availability Groups (AOAG). However, alternatives to both features are available in SQL Server Standard Edition. With SQL Server 2019, TDE is now part of Standard Edition, allowing you to improve your data protection strategies without SQL Server Enterprise Edition. Suppose you are running SQL Server 2017 or earlier. In that case, you can use Amazon Elastic Block Store (Amazon EBS) encryption with AWS Key Management Service (AWS KMS), comparable to TDE, especially when encrypting snapshots or backups.
SQL Server Standard Edition supports basic AOAG but is limited to a single database. However, if your SQL Server supports more than one database, you can create multiple availability groups. Alternatively, you can use Always On Failover Cluster Instances (FCI) for instance-level failover using Amazon FSx shared storage. For more information, see the FSx implementation for Windows and FSx for NetApp ONTAP.
In addition to reducing licensing costs, downgrading to an older version of SQL Server can help you reduce your Software Assurance spend and avoid future patches. You can avoid additional costs by putting unused licenses 'on the shelf' for later use.
It is essential to carefully assess your SQL Server workloads and determine which features are critical to your business needs. Refer to the AWS guide to evaluate your environment and determine if your SQL Server database benefits from Enterprise version-specific features.
Use SQL Server Developer Edition in non-production environments
You can deploy licensed editions of SQL Server, such as Enterprise or Standard Edition, locally in non-production environments using MSDN subscriptions. However, MSDN subscriptions do not have the option to transfer licenses, so when migrating to AWS, you cannot transfer these licenses and must use SQL Server Developer Edition instead.
SQL Server Developer Edition has all the features of SQL Server Enterprise Edition but is free in non-production environments. It is available for versions 2016 and later and can be downloaded from the Microsoft website. Read Automating SQL Server Developer Edition deployments for information on automating this process.
Use Optimise CPU for SQL Server workloads
Sometimes, you may need to select an Amazon EC2 instance with more virtual processors than necessary for your workloads due to factors such as memory or IOPS capabilities. To help you optimize your BYOL licensing requirements in such situations, AWS offers a feature called Optimize CPU.
Because SQL Server licensing is based on cores, you can disable hyper-threading or deactivate vCPUs for Amazon EC2 instances, reducing the number of CPUs visible to the operating system. This strategy allows you to take advantage of other instance features such as memory, networking, and IOPS while reducing the number of licenses required.
Instance type | Total vCPUs | Active vCPUs with Optimize CPUs | SQL Server license savings |
---|---|---|---|
r5.4xlarge | 16 | 8 | 50% |
r5.12xlarge | 48 | 8 | 83% |
For example, as shown in Table 2, if you deploy an r5.4xlarge instance because your workload requires 128 GB of memory but you only need 8 SQL Server cores, you can disable hyper-threading and run the example with only eight active vCPU cores. In this way, you can save 50% on SQL Server licenses because you only need permits for the eight vCPUs required by your workload.
The Optimize CPU feature was explicitly designed for BYOL and cannot be used with LI. Enabling Optimize CPU reduces the number of SQL Server BYOL licenses required, but you still need to pay for the entire instance, including Windows Server licenses.
As AWS introduces new instance types, it is worth assessing whether these new instances can meet your load requirements with fewer cores. This approach can be more cost-effective as it removes the need to optimize the CPU while still meeting the load requirements, thus reducing the overall cost. For example, instead of the optimized CPU feature in an r5.4xlarge instance, you might consider using an x2iedn.xlarge instance with four virtual processors and 128 GiB of memory. This would reduce the license costs and affect the lower instance costs.
Conclusion
Optimizing Microsoft licenses on AWS is critical for companies that want to minimize costs while maintaining the functionality and performance required to support Microsoft workloads in the cloud.
Implementing key optimization strategies such as making eligible licenses available, licensing at the physical core level, adjusting instance sizes, consolidating SQL Server instances, and considering switching to an older version of SQL Server can help reduce license costs and optimize spend.
Using AWS Optimisation and Licensing Assessment (OLA) and periodically evaluating your instance types can ensure that you use the most cost-effective resources for your workloads. By taking these steps, you can successfully achieve your cost optimization goals while maintaining compatibility, performance, and functionality to run Microsoft workloads on AWS.
AWS can help you assess how your business can get the most out of the cloud. Join the millions of AWS customers who entrust AWS to migrate and upgrade their critical cloud applications. To learn more about upgrading Windows Server or SQL Server, visit Windows on AWS. Contact Hostersi to start your migration journey today.