Managing and Optimizing Your Azure Hybrid Benefit Usage (With Tools!)

As more businesses shift their operations to the cloud, one of the challenges they face is optimizing licensing costs for their virtual machines (VMs) in the cloud. Microsoft's Azure Hybrid Benefit (AHUB) is a licensing benefit that can help businesses save money on their Azure VMs by using their existing on-premises licenses. However, in some cases, it can be hard to keep track of which VMs have the benefit enabled, prioritize VMs to have AHUB and how many CPU Cores are being consumed in the environment.

With this challenge in mind, I have developed this Workbook that will help you manage your AHUB usage.

In this blog post, I will cover the basics of AHUB and explain to you deploy and use this Workbook.

AHUB at a glance

Before we talk about the workbook, we'll explain how AHUB works, how to activate it in Azure, and how to optimize its use to maximize cost savings and streamline licensing management.

The Microsoft Azure Hybrid Benefit (AHUB) is a licensing benefit that allows customers to use their on-premises Windows Server licenses with Software Assurance to run virtual machines in Azure at a reduced cost.

Azure Hybrid benefit can be enabled to the following Services:

 Windows /VMSS VM / VMSSAzure , SQL Server on Azure VMs and SQL Managed Instance
How it worksAzure Hybrid Benefit allows you to exchange your existing licenses for discounted rates on Azure Virtual Machines or Azure Virtual Machine Scale Sets (VMSS).Azure Hybrid Benefit for virtual machines enables you to take advantage of discounted reserved instance rates for your Red Hat Enterprise (RHEL) and SUSE Linux Enterprise Server (SLES) VMs.Azure Hybrid Benefit allows you to exchange your existing licenses for discounted rates on Azure and Azure SQL Managed Instance.
Licensing ModelEach 2-processor license or each set of 16-core licenses is entitled to two instances of up to 8 cores, or one instance of up to 16 cores. The Azure Hybrid Benefit for Standard Edition licenses can only be used once either on-premises or in Azure. Datacenter Edition benefits allow for simultaneous usage both on-premises and in Azure.In Azure, there are two main licensing pricing options: ‘pay-as-you-go' (PAYG) and ‘bring-your-own-subscription' (BYOS).Apply to SQL Server 1 to 4 vCPUs exchange: For every 1 core of SQL Server Enterprise Edition, you get 4 vCPUs of SQL Managed Instance or Azure general purpose and Hyperscale tiers, or 4 vCPUs of SQL Server Standard edition on Azure VMs.
DiscountsUp to 30 percent or more on Windows VMs or VMSSs by using your Software Assurance-enabled SQL Server licenses on Azure.Customers may see savings estimated to up to 76% with Azure Hybrid Benefit for Linux.Up to 30 percent or more on SQL Database and SQL Managed Instance by using your Software Assurance-enabled SQL Server licenses on Azure.

Azure Hybrid Benefit Workbook Overview

Deployment

  • Consider the following least-privilege (minimum) RBAC permissions when deploying the workbook:
    • Reader and Workbook Contributor: allows you to import the workbook, view all of the workbook tabs and save the workbook in a resource group.
    • Reader: allows you to import the workbook and view all of the workbook tabs.
  • You can find the latest version of this workbook together with the deployment steps on my Github page: https://github.com/arthurclares/AzureHybridBenefitWorkbook

Disclaimer
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

Workbook Overview

The Azure Hybrid Benefit Workbook provides a detailed overview of Windows VMs, Linux VMs, and Windows VMSS with and without Azure Hybrid Benefit (AHUB) enabled. The workbook also allows you to filter the results by subscription, resource group, or tags.

Table of Contents

Workbook Overview

Filtering

The Azure Hybrid Benefit Workbook allows you to filter the results by subscription, resource group, or tags. This can be useful if you need to focus on specific parts of your environment

FilterBy

Resource Location

NOTE:

The Resource Location parameter is required to load the SKU available in that region. Please note that not all the SKUs are available in all regions, so if you are using some specific SKUs, make sure this parameter is set to the correct location. By default, the parameter will pick any location.

The Resource Location parameter is important to ensure that the workbook displays accurate information about the SKUs available in your region. Be sure to set this parameter correctly to ensure that you are seeing the most relevant information.

Virtual Machine/VMSS Tab

In this tab, you can see the list of Windows VMs, Linux VMs and Windows VMSS with and without AHUB.

Windows VMs Overview

In this subtab, you can see the list of Windows VMs where AHUB is enabled and where it is not enabled.

The virtual machines (VMs) with less than 8 cores are categorized as Low Priority, while those with 8 or more cores are classified as High Priority. In situations where there are insufficient Azure Hybrid Benefit licenses to cover all the VMs in the environment, it is recommended to prioritize the High Priority VMs.

WindowsOverview

This workbook also provides you with the view of VMs that have enabled the Hybrid Benefit in the past 7 days. This can be useful for you to monitor and prioritize VMs that you will bring the biggest savings.

Cores Enabled 7 days Overview

View list of Windows VMs

You can change the above parameters to see the list of all VMs that have AHUB enabled / disabled. It is also possible to download those results to a CSV file by clicking in the download button at the top right of each table.

AHUB Enabled1

AHUB Disabled1

AHUB7DaysDetails

Linux VMs Overview

In this tab, you can see the list of Linux VMs where AHUB is enabled and where it is not enabled.

LinuxOverview

Windows VMSS Overview

In this tab, you can see the list of Windows VMSS where AHUB is enabled and where it is not enabled. For Windows VMSS, the same AHUB prioirtization rule applies. The Virtual Machines Scale Set(VMSS) with less than 8 cores are categorized as Low Priority, while those with 8 or more cores are classified as High Priority. In situations where there are insufficient Azure Hybrid benefit licenses to cover all the VMSS in the environment, it is recommended to prioritize the High Priority VMSS.

VMSSOverview

SQL Tab

In this tab, you can see the list of SQL Databases, SQL Managed Instances and SQL on VMs with and without AHUB.

VMSSOverview

Thanks for taking the time to read this blog post. I hope you found it helpful for you in understanding how to leverage Azure Hybrid Benefit for your VMs and SQL workloads.!

If you have any suggestions or feedback, please feel free to let me know on my GitHub page. I'm always looking for ways to improve this workbook and make it more useful for the community.

You can also find me on LinkedIn where I share some shorter posts about Azure cost optimization, feel free to connect with me there also.

Thanks again for your support and I'll see you in the next one!

 

This article was originally published by Microsoft's Core Infrastructure and Security Blog. You can find the original article here.