This post comes after spending two days working with some customers that have started to move all their on-premise infrastructure to IaaS on the Azure cloud.
They have used Azure VMs for hosting their Microsoft Dynamics NAV databases and servers and they have sized the VMs by starting from my suggestion and increasing the size by 2 (“we want to move to Dynamics 365 Business Central on-premise soon, so I don’t want to have problems with resources” was the absurde reason for that decision). What I see always in these cases is that the art of scaling the VMs resources is a mistery for everyone!
One of the main benefits of a cloud-based infrastructure is that you can scale (horizontally or vertically) accordingly to your needs, so why using (and paying for) an enormous Azure machine for NAV or SQL Server when we’re for example in the developing phase and few users are working with the ERP?
I think that everyone in the IT field should work with Azure VMs by scaling them as needed. And scaling a VM in Azure is very simple.
As a sample, I have this test Azure VM for NAV with 4 vcpus and 8 GB of memory.
To reduce the size of the VM (but the same process if for increase the power) click on the Size menu to the left in the Virtual Machine blade:
In the Choose a size page, you can see all the available sizing for this VM, you can filter by type, disk and vCPUs (in the following images I’ve decided to see only VMs that has Premium Storage and >= 4vCPUs), then you can select the size where you want to scale and by clicking the Select button the resizing process is performed.
In few minutes, you have a VM ready to go with the new size. Resizing a VM requires a reboot of the machine, so plan it accordingly.
As always, the best part of this is that you can also perform a resizing via Powershell (and so schedule it for example by running a runbook in Azure Automation).
By using Azure CLI and Powershell, here I’ve declared a Resource Group name variable and a VM name variable. Then I retrieve all the available sizes for my VM:
$resourceGroup = "vmeidnav2017"
$vmName = "vmeidnav2017"
Get-AzureRmVMSize -ResourceGroupName $resourceGroup -VMName $vmName
This is the output of this command:
Here I want to resize my Azure VM to a smaller size (Standard_A3) and this is the command to use for this task:
$vm = Get-AzureRmVM -ResourceGroupName $resourceGroup -VMName $vmName
$vm.HardwareProfile.VmSize = "Standard_A3"
Update-AzureRmVM -VM $vm -ResourceGroupName $resourceGroup
Wait few seconds and the machine is resized:
Why paying for resources that you’re not using or having poor performances only because you don’t scale up un particular heavy business hours? Remember this for tuning your Microsoft Dynamics NAV or (future) Dynamics 365 Business Central on-premise infrastructure in the cloud.