This a thing that I had to do in the past, first, not all VM size support Accelerated Network, the supported OS and VM size can be found here:
https://docs.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-cli
https://docs.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-powershell
In order to make the change I had to so deallocate the VM and execute the following PowerShell:
$nic = Get-AzureRmNetworkInterface -ResourceGroupName "RGName" -Name "VMName"
$nic.EnableAcceleratedNetworking = $false
$nic | Set-AzureRmNetworkInterface
Once I did this, I was able to change the size of the VM.
And of course, if you want to change the state of accelerated networking in a scale set, the procedure is slightly different:
Stop-AzVmss -ResourceGroupName "RG-name" -VMScaleSetName "vmss-name"
$vmss = Get-AzVmss -ResourceGroupName "RGName" -VMScaleSetName "vmss-name"
$vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].EnableAcceleratedNetworking = $false
Update-AzVmss -ResourceGroupName "RGName" ` -VMScaleSetName "vmss-name" ` -VirtualMachineScaleSet $vmss
I changed the size of the VM Scale Set and then…
Start-AzVmss -ResourceGroupName "RGname" -VMScaleSetName "vmss-name"
That’s all
Really helpful information, thanks!.
LikeLike