Microsoft Workloads on AWS

A guide to optimizing Microsoft licensing on AWS

As more businesses move their enterprise workloads to the cloud, optimizing costs has become a top priority for them. Licensing is one of the most significant costs associated with running your Microsoft workloads on Amazon Web Services (AWS). In this blog post, I will discuss seven specific optimization strategies you can implement to help you reduce costs and maintain compliance with your Microsoft licensing on AWS.

Microsoft licensing options on AWS

AWS offers a range of flexible licensing choices for customers who want to run their Microsoft workloads on AWS, as shown in Figure 1.

Figure 1: Microsoft Workloads Licensing options
Figure 1: Microsoft Workloads Licensing options
  1. Use license-included (LI) instances from AWS. Using license-included instances gives you access to fully-compliant Microsoft software licenses bundled with Amazon Elastic Compute Cloud (Amazon EC2) instances. Pay for them as you go with no upfront costs or long-term investments. You can choose Amazon Machine Images (AMIs) with just Microsoft Windows Server or with Windows Server and Microsoft SQL Server pre-installed.
  2. Bring licenses to AWS. You have two options when you Bring Your Own License (BYOL):
    1. BYOL for products with License Mobility: License Mobility is a Microsoft Software Assurance (SA) benefit that allows you to bring specific product licenses to shared cloud infrastructure, including default (shared) tenancy Amazon EC2. License Mobility eligible products include SQL Server, Remote Desktop Services User CALs, System Center Server, Exchange, and SharePoint. Active Software Assurance is required to be eligible for License Mobility. For additional information, please refer to the License Mobility page on the AWS website.
    2. BYOL for products without License Mobility: For Microsoft products that don’t have License Mobility benefits, such as Windows Server or SQL Server without SA, AWS offers dedicated tenancy options to use those eligible licenses in the cloud. Dedicated tenancy also offers you the opportunity to license at the physical core level, which can reduce license usage by 50% or more if you use burstable instances.

Cost comparison: LI and BYOL

BYOL helps you avoid paying for licenses that you already own, which reduces your cost of running Microsoft workloads on AWS. Table 1 shows the monthly cost of running a single c5.xlarge instance 24×7 in the US East (Northern Virginia) Region with various AWS LI pricing models. This shows that much of the Amazon EC2 instance cost 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
Table 1. Price comparison for LI option

7 strategies to optimize your Microsoft licensing on AWS

Rightsize your AWS instances.

One of the key strategies for optimizing license usage is rightsizing your AWS instances. Rightsizing involves selecting an instance type based on CPU, memory, and storage requirements. By choosing an appropriate instance size, you can ensure you’re not paying for resources you don’t need, which can lead to significant cost savings. For example, Windows Server and SQL Server are typically licensed on the number of vCPUs or cores. By rightsizing, you can lower the number of vCPUs or cores that the Microsoft software runs on and reduce both the cost of the instance and the number of licenses required.

AWS offers a no-cost program called the AWS Optimization and Licensing Assessment (OLA) to help you optimize your licensing and reduce costs through rightsizing. OLA evaluates your licensing requirements for workloads running on premises, on AWS, or in another cloud.

Bring Your own eligible Windows server licenses.

Bringing your own Windows Server licenses is one of the most cost-effective strategies as you leverage existing investments to lower your AWS spend.

In 2019, Microsoft changed its licensing terms for products without License Mobility, such as Windows Server and SQL Server without SA. Under these new terms, SQL Server 2017 and prior without SA can only be deployed on a Dedicated Host. For Windows Server to be eligible for BYOL, the following conditions have to be met:

  • Windows Server perpetual licenses purchased before October 1, 2019, or purchased within an Enterprise Agreement term that started before October 1, 2019.
  • Windows Server version 2019 and prior.
  • Windows Server deployed on a Dedicated Host.

License by the physical core.

BYOL allows you to license at the physical core level on Amazon EC2 Dedicated Hosts, enabling you to deploy the maximum number of instances per configuration on a host. This can be done with the Windows Server Data Center Edition and SQL Server Enterprise Edition.

Example of licensing at Physical Core
Figure 2: Example of licensing at Physical Core

For the r5 Dedicated Host with Windows Server Data Center Edition, you would need 48 core licenses, allowing you to deploy a combination of instances using up to 96 vCPUs. By licensing at the physical core level, you can avoid additional licensing costs as compared to licensing by vCPU and achieve the best possible value from your licensing investment.

When deploying SQL Server Enterprise Edition on Dedicated Hosts, you can license either at the physical core or vCPU level. For example, if you use 50% of vCPUs of the Dedicated Host for SQL Server Enterprise, it’s beneficial to license at the physical core level. Consider an r5 Dedicated 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, in shared tenancy, where licensing is done by vCPU, you would need 96 SQL Server Enterprise Edition licenses for the same workload. Thus, licensing by the physical core on Dedicated Hosts can save up to 50% of SQL Server Enterprise Edition licensing costs compared to shared tenancy.

Consolidate SQL Server instances.

SQL Server requires a minimum of four core licenses per Amazon EC2 instance, even if the instance only has two vCPUs. This means that running SQL Server on an Amazon EC2 instance with fewer than four vCPUs will cause you to pay for more licenses than you can actually use.

SQL Server consolidationFigure 3: SQL Server consolidation

Consolidating SQL Server named instances onto a single Amazon EC2 instance is a great way to optimize licensing 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 the licensing requirement by 50% because only four core licenses are required, not eight.

Downgrade your SQL Server edition.

SQL Server Enterprise Edition is considerably more expensive than the SQL Server Standard Edition, so by downgrading the edition, you will see significant cost savings.

Two widely-used features in SQL Server Enterprise Edition are Transparent Data Encryption (TDE) and Always On Availability Groups (AOAG). However, alternatives for both features are available in SQL Server Standard Edition. With SQL Server 2019, TDE is now part of the Standard Edition, which allows you to improve your data protection strategies without SQL Server Enterprise Edition. If you’re running SQL Server 2017 or an earlier version, you can use Amazon Elastic Block Store (Amazon EBS) storage encryption with AWS Key Management Service (AWS KMS), which is comparable to TDE, particularly when encrypting snapshots or backups.

SQL Server Standard Edition supports basic AOAG, which is limited to a single database. However, if your SQL Server hosts more than one database, you may create multiple availability groups. Alternatively, you can use Always On Failover Cluster Instances (FCI) for instance-level failover using Amazon FSx providing shared storage. For more information, please see the implementation using FSx for Windows and FSx for NetApp ONTAP.

Besides reducing licensing costs, downgrading SQL Server editions can help you reduce your Software Assurance spending and avoid future true-ups. You can avoid additional licensing costs by returning unused licenses to their shelf for later use.

It’s important to evaluate your SQL Server workloads carefully and determine which features are critical for your business needs. Please refer to this AWS guide to evaluate your environment and determine whether your SQL Server database uses Enterprise Edition-specific features.

Use SQL Server Developer Edition in non-production environments.

In non-production, on-premises environments, you may deploy licensable editions of SQL Server, such as Enterprise or Standard Edition, using MSDN subscriptions. However, MSDN subscriptions do not have License Mobility, so when migrating to AWS, you cannot bring those licenses and should use SQL Server Developer Edition instead.

SQL Server Developer Edition has all the features of SQL Server Enterprise Edition, but is available for free in non-production environments. SQL Server Developer Edition 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 the Optimize CPU feature for SQL Server workloads.

Sometimes, you may need to select an Amazon EC2 instance with more vCPUs than necessary for your workloads because of factors like memory or IOPS capabilities. To help you optimize your BYOL licensing requirements in these situations, AWS offers a feature called Optimize CPU.

Since SQL Server licensing is based on cores, you can either disable hyper-threading or deactivate vCPUs for the Amazon EC2 instance, limiting the number of CPUs visible to the operating system. This strategy allows you to benefit from other instance features, such as memory, networking, and IOPS, while reducing the required number of licenses.

Instance type Total vCPUs Active vCPUs with Optimize CPUs SQL Server license savings
r5.4xlarge 16 8 50%
r5.12xlarge 48 8 83%
Table 2: Optimized CPU Comparison

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 cores of SQL Server, you can disable hyper-threading and launch an instance with just 8 active vCPUs. By doing this, you can save 50% on SQL Server licenses because you only need to license the 8 vCPUs that are required by your workload.

The Optimize CPU feature is specifically 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 full instance, including Windows Server licenses.

As AWS introduces new instance types, it is worth evaluating whether these new instances can meet your workload requirements with fewer cores. This approach can be more cost-effective as it eliminates the need for Optimize CPU while still satisfying the workload demands, thereby reducing the overall cost. For example, instead of using the optimized CPU feature on an r5.4xlarge instance, you could consider using an x2iedn.xlarge instance with 4 vCPUs and 128 GiB memory. This would not only reduce the licensing costs but also result in lower instance cost.

Conclusion

Optimizing Microsoft licensing on AWS is crucial for businesses looking to minimize costs while maintaining the functionality and performance required to run their Microsoft workloads in the cloud.

Implementing key optimization strategies, such as bringing eligible licenses, licensing at the physical core level, rightsizing instances, consolidating SQL Server instances, and considering SQL Server edition downgrade options, can help you reduce your licensing costs and optimize your spending.

Leveraging the AWS Optimization and Licensing Assessment (OLA) program and periodically evaluating instance types can ensure that you are using the most cost-effective resources for your workloads. By taking these steps, you can successfully achieve your cost optimization goals while maintaining compliance, performance, and the functionality to run your Microsoft workloads on AWS.

AWS can help you assess how your company can get the most out of cloud. Join the millions of AWS customers that trust us to migrate and modernize their most important applications in the cloud. To learn more on modernizing Windows Server or SQL Server, visit Windows on AWSContact us to start your migration journey today.

Rafet Ducic

Rafet Ducic

Rafet Ducic is a Senior Solutions Architect at Amazon Web Services (AWS). He applies his more than 20 years of technical experience to help Global Industrial and Automotive customers transition their workloads to the cloud cost-efficiently and with optimal performance. With domain expertise in Database Technologies and Microsoft licensing, Rafet is adept at guiding companies of all sizes toward reduced operational costs and top performance standards.