Monitoring Azure B-series VM banked credits

In mid-September Microsoft announced the new B-series VM size.

-> https://azure.microsoft.com/en-us/blog/introducing-b-series-our-new-burstable-vm-size/

Have a look at the following description to understand how the B-series VMs are working.

The B-series burstable VMs are ideal for workloads that do not need the full performance of the CPU continuously, like web servers, small databases and development and test environments. These workloads typically have burstable performance requirements. The B-Series provides these customers the ability to purchase a VM size with a price conscience baseline performance that allows the VM instance to build up credits when the VM is utilizing less than its base performance. When the VM has accumulated credit, the VM can burst above the VM’s baseline using up to 100% of the CPU when your application requires the higher CPU performance.

-> https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes-general#b-series-preview

To get a better understanding how much credits are banked per hour per different VM size, have a look at the following table.

VM sizeCredits banked / hourMax banked credits
Standard_B1s6144
Standard_B1ms12288
Standard_B2s24576
Standard_B2ms36864
Standard_B4ms541296
Standard_B8ms811944

So how you can monitor the banked credits of your B-series VMs? The answer is easy and included in the Azure platform. The Azure service you are looking for is Azure Monitor with its metrics. The metrics are directly included in the VM blade of an Azure VM.

Here you get two different monitoring options for the credits.

  1. [Host] CPU Credits Consumed
  2. [Host] CPU Credits Remaining

Bseries1Bseries2

We will focus on the metric [Host] CPU Credits Remaining. Monitoring the metric in a separate Azure Dashboard is possible, but not the way you would like to go.

Bseries10

The better way is to use a metric alert or a near real-time metrics alert. I have created both in my subscription for one of my B-series VMs.

Let us start with the metric alert. The configuration is very easy and comfortable through the Azure portal, but can also be done via Azure CLI, PowerShell or through Azure Resource Manager templates.

-> https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/insights-alerts-portal

The important configuration part is the max banked credits value for the specific B-series VM size and that the condition is set to “Greater than or equal to”. Just have a look at the following screenshots on how I have configured the metric alert for my VM.

Bseries3Bseries4Bseries5

The near real-time alerting was announced at the beginning of this month.

-> https://azure.microsoft.com/en-us/blog/get-alerts-faster-with-near-real-time-alerting-for-azure-platform-metrics/

For the configuration of an near real-time metrics alert have a look at the Azure documentation.

-> https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-near-real-time-metric-alerts

The important part again is the max banked credits value for the specific B-series VM size for the threshold value and that the condition is set to “Greater than or equal to”. Be aware that the value for the time aggregation configuration must be set to “Average”. Just have a look again at the following screenshots on how I have configured the near real-time metrics alert for my VM.

Bseries6Bseries7Bseries8Bseries9

Another difference between the metric alert and the near real-time metrics alert is the use of an action group.

-> https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-action-groups

With action groups you have more flexibility, when it comes down to configure your preferred notification channel.

Now, you get notified every time the max banked credits are reached for the B-series VM and you can take further actions. For example, let the alert trigger a runbook that kickoffs a compute intensive workload on the B-series VM to consume the banked credits.

Bseries11Bseries12

Another use of the metric alerts would be to monitor the credit consumption of your B-series VMs.

Need more information about Azure Monitor or monitoring Azure resources? Have a look at the following two links.

-> https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview-azure-monitor
-> https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-overview

Facebooktwittergoogle_pluslinkedinmail

Leave a Reply