In mid-September Microsoft announced the new B-series 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.
To get a better understanding how much credits are banked per hour per different VM size, have a look at the following table.
|VM size||Credits banked / hour||Max banked credits|
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.
- [Host] CPU Credits Consumed
- [Host] CPU Credits Remaining
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.
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.
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.
The near real-time alerting was announced at the beginning of this month.
For the configuration of an near real-time metrics alert have a look at the Azure documentation.
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.
Another difference between the metric alert and the near real-time metrics alert is the use of an action group.
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.
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.