Unable to create Windows B2s nodepool in AKS - azure

I need to add a Windows B2s nodepool to AKS. I am getting the folowwing error:
Error: Code="VMSizeIsNotPermittedToEnableAcceleratedNetworkingForVmss" Message="Virtual machine at index 0 of VM scale set /removed id of VMSS/ has size Standard_B2s, which is not compatible with enabling accelerated networking in the network profile on the scale set. Allowed sizes: Standard_D2_v4, Standard_D2s_v4, Standard_D2ds_v4, etc.
I am sure before this was allowed because I had created B2s and B2ms Windows nodepools before. I see it is related to accelerated networking, but how can I influence accelerated netoworking for VMSS that is yet to be created and is controlled by Azure?

I have tested to add B2s in my environment with Linux nodepool and it was successful.
If your instance supports then it should be deployed with Accelerated Networking. If it does not, it should be deployed without AN. Please issue a support ticket if you can. And you can give these steps a try.
Create nodepool with AN supported instance type.
Scale nodepool to zero.
Change instance type to B2s.
Scale nodepool to one.
I shared a link below. Not the same thing but it also can give an idea.
https://github.com/Azure/AKS/issues/1404

Error: Code="VMSizeIsNotPermittedToEnableAcceleratedNetworkingForVmss"
Message="Virtual machine at index 0 of VM scale set /removed id of
VMSS/ has size Standard_B2s, which is not compatible with enabling
accelerated networking in the network profile on the scale set.
Allowed sizes: Standard_D2_v4, Standard_D2s_v4, Standard_D2ds_v4, etc
from the above error we can understand, VMSS/ has size Standard_B2s is not NotPermitted ToEnableAcceleratedNetworking.
You can check the same using this Az CLI cmdlet.
The list of Virtual Machine SKUs that support Accelerated Networking can be queried directly via the following Azure CLI az vm list-skus command.
az vm list-skus \
--location westus \
--all true \
--resource-type virtualMachines \
--query '[].{size:size, name:name, acceleratedNetworkingEnabled: capabilities[?name==`AcceleratedNetworkingEnabled`].value | [0]}' \
--output table
Would suggest you to select the node pool which is recommended one.
You can refer this MS Document for the same information.

Related

Azure k8s HPA on custom metric

I am trying to achieve HPA on azure cluster. But it is not working as expected, as it is not scaling up the pods when it is clearly showing the metric value is double of the target value. As you can see in the below screenshot
Here is the HPA configuration for the same.
Might be your Metrics server is not automatically installed with AKS,The Metrics Server is used to provide resource utilization to Kubernetes, and is automatically deployed in AKS clusters versions 1.10 and higher.
To see the version of your AKS cluster, use the az aks show command, as shown in the following example:
az aks show --resource-group myResourceGroup --name myAKSCluster --query kubernetesVersion --output table
If your AKS cluster is less than 1.10, the Metrics Server is not automatically installed. You can install via url.
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
To use the autoscaler, all containers in your pods and your pods must have CPU requests and limits defined.
For more information how to implement you can refer this Microsoft Document

Choose classic cloud service VM size according deployment region

I'm deploying classic cloud service in different regions using ARM templates, till now was using same VM type(Standard_D2_v2) for all deployments, but found out that this VM is not available in all regions where I'm going to deploy. What are options to choose VM type according deployment region?
Some regions do not have those available sizes. Can you change the VM sizes to the below
Standard_B1ls1. You might also have to check the cost if you using Micorosoft Azure
There might be an issue for that size in that region you are trying to deploy or it may not be available for you. So, you might be getting this error:
The operation '{Operation ID}' failed: 'The requested VM tier is currently not available in Region ({Region ID}) for this subscription. Please try another tier or deploy to a different location.'.
To Check the sizes available for your subscription in that region you can use azure Powershell or azure CLI with the below commands :
az vm list-skus --location southcentralus --output table -- Azure CLI
Get-AzComputeResourceSku | where {$_.Locations -icontains "centralus"} -- Azure Powershell
After getting the output if in restriction you find NotAvailableForSubscription means you cannot use that vm size.

Updating Azure Virtual Machine Scale Set

I have hosted a website in azure virtual machine scale set by following the below steps
Create a VM and do the necessary changes/installations in iis.
Create a snapshot of the VM. This ensure that the above instance can be used for future changes.
create a disk from the snapshot.
create a vm from the disk.
RDP to the instance and generalize the instance for deployment (sysprep)
Run %WINDIR%\system32\sysprep\sysprep.exe as admin.
Enter System Out-of-Box Experience (OOBE),
Generalize check box is selected
Shutdown Option = Shutdown
Create Image (capture) from the above instance.
Create VSS from the above image
Suppose their is a change in the web build , Is there a way to update the scale set without following these steps again ?
Azure virtual machine extensions provide capabilities such as post-deployment configuration and management, monitoring, security, and more. Production deployments typically use a combination of multiple extensions configured for the VM instances to achieve desired results.
This is also is a good way to ensure availability of your system. The scale set will apply the update to one VM at a time, leaving the other VMs up and running.
Below example taken from the learn:
Deploy the update by using a custom script extension
In the Azure portal, run the following command to view the current upgrade policy for the scale set:
Azure CLI:
az vmss show \
--name webServerScaleSet \
--resource-group scalesetrg \
--query upgradePolicy.mode
Verify that the upgrade policy is set to Automatic. You specified this policy when you created the scale set in the first lab. If the policy were Manual, you would apply any VM changes by hand. Because the policy is Automatic, you can use the custom script extension and allow the scale set to do the update.
Run the following command to apply the update script:
az vmss extension set \
--publisher Microsoft.Azure.Extensions \
--version 2.0 \
--name CustomScript \
--vmss-name webServerScaleSet \
--resource-group scalesetrg \
--settings "{\"commandToExecute\": \"echo This is the updated app installed on the Virtual Machine Scale Set ! > /var/www/html/index.html\"}"

how to disable Accelerated Networking on Azure VM

i have enabled Accelerated Networking on Azure Vm..now i want to disable accelerating networking but unable to find a way. since i want to change the size of vm and accelerating network is preventing to change the size.
please suggest
This is a setting on the network interface. For a single machine you could try running this command from the cloud shell on the azure portal:
az network nic update --accelerated-networking false --name <network interface name> --resource-group <resource group name>
Recommend typing this command out not copy pasting from this page to avoid hyphen hell. Case sensitive so all lower case.
https://learn.microsoft.com/en-us/cli/azure/network/nic?view=azure-cli-latest#az-network-nic-update
For VMSS (Virtual Machine Scale Sets), the process is a bit less straight forward, but still possible.
Say your resource group is RG001 and the VMSS name is VMSS001, then you can issue
az vmss update -g RG001 -n VMSS001 --set virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].enableAcceleratedNetworking=false
I added a new NIC from the VM networking tab and it seems that accelerated networking is disabled by default. Then I detach the previous NIC (with accelerated networking) and was able to resize my VM.
You could try to use azure powershell to do it.
Remove-AzureRmAcceleratedNIC -ResourceGroupName <ResourceGroupName> -VMName <VMName> -OsType <OsType>
You need to download the script file in this link, then refer to the usage below.
For more details, refer to this link.

How to get a list of available vm sizes in an azure location

I want to deploy a VM in microsoft's azure with a new size.
Usually I use a json template for the vm with size 'Standard_DS3'
Now I would like to have another one with size a3 'A3', but this causes an error
statusMessage:{"error":{"code":"InvalidParameter","target":"vmSize","message":"The value of parameter vmSize is invalid."}}
So I was wondering where can I find valid vm sizes for deployments in a location and the correct name for the deployment with a template file?
One can list all vm-sizes available in specific location(e.g westus) from Azure CLI 2.0 using following command
az vm list-sizes --location "westus"
Since you mentioned json templates in your question then I assume that you are using Azure Resource Manager to provision resources. If that's the case, you can use the following REST API endpoint to list all available virtual machine sizes in a region.
https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={api-version}
This information is accessible using Azure CLI, i.e.: az vm list-sizes --location "eastus"
You can also reference Microsoft documentation to see the list of virtual machine sizes. Sounds like you need to use the "Large" size in your template to provision an A3 Standard VM.
This isn´t always true. I´ve got into a situation where this command gives me a VM size that wasn´t truely avalaible for my location. This is a known issue of the Azure CLI.
Here is the statement from Azure support:
Cause: It is known that the command az vm list-sizes can expose sizes that are actually unavailable and we are working on that situation.
Resolution: The best option is to mitigate this is to cross check the information provided by that query with the restrictions that you have in the subscription that can be analyzed by the command az vm list-skus. For your scenario, you can see the SKU restrictions in West Europe by using the following:
az vm list-skus --location WestEurope --output table
You can use Get-AzureRmVMSize commandlet in PowerShell. This doesn't change too often and I have a .NET library which contains a snapshot of those https://github.com/aloneguid/microsoft-azure-strongtyped

Resources