Azure VMSS 10 model limit? - azure

Recently when I update my VMSS model, I received error like
MyVmssName has reached its limit of 10 models that may be referenced
by one or more VMs belonging to the Virtual Machine Scale Set. . Upgrade the VMs to the latest model of the Virtual Machine Scale Set before trying again.
Does Azure have some official documentation on this 10 model limitation? Could not find it anywhere.

I have referred similar Issue:
When a change is made to the VMSS, such as a cluster upgrade, the change must be applied to the existing instances.
If VMSS using the manual upgrade policy. This means that when a change is made, the user must manually update the old instances.
Azure Portal > Impacted VMSS > Instances tab.
The CX can then select each instance which is showing Latest Model as No and upgrade one by one. I would not recommend upgrading all instances at once as this may bring the VMSS down.
Also upgrade VMSS instances using Azure CLI.
if VMSS upgrade policy is set to automatic, instances will upgrade automatically in random order.
You can also upgrade VMSS using Azure CLI.
az vmss update --name <VMSSName> --resource-group <ResourceGroupname> --license-type windows_server
Reference: Update VMSS

Related

Using VM Scale Sets as Application Gateway Backend

I've been trying to use Azure VMSS as my Application Gateway backend but I keep getting this message in my backend pool details page
Virtual machine scale set 'vmss-name' was added to this backend pool. Upgrade all the instances of 'vmss-name' for this change to work.
I don't know which part of the instance should I upgrade. I've tried using a custom image and the official Windows Server 2022 image. Can somebody tell me?
Thanks
It seems that when creating VMSS, we can choose our Upgrade policy under the Management tab. If we chose Manual upgrade mode, we need to manually upgrade our VMSS whenever we introduce a new scale set model. We can use this command in the CloudShell to manually update a VM in the VMSS.
Update-AzVmssInstance -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId instanceId
If we choose Automatic upgrade mode, our VMSS will automatically update itself whenever we introduce a new scale set model.
Please see the official documentation for further details.

Azure VMSS instance "Latest model" meaning

When I look into my VMSS in Azure, and enters the "instances" blade, for each instance there is a property "Latest model" which can be either "No" or "Yes".
What does this property mean? I couldn't find any documentation about it.
The Latest Model inside the VMSS instances blade is know as the Latest Scaleset Model.
If it is Yes, then its the latest scaleset model and vice versa for No. There are couple of ways to change it to Yes i.e. Manual , Automatic and Rolling which can be set from the upgrade policy blade of the VMSS .
In Manual you will have to run the below command to update the scaleset model:
Azure CLI :
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids {instanceIds}
Output :
Before Update:
Only Update the last one with instance ID = 8 :
Update the remaining two by giving space separated instance id's:
For More details on Modify Scaleset Model you can refer this Microsoft Documentaion.

What's the difference between Update-AzureRmVmss, Update-AzureRmVmssInstance and Update-AzureRmVmssVM?

For the life of me, I can't work out what the differences are between Update-AzureRmVmss, Update-AzureRmVmssInstance and Update-AzureRmVmssVM in relation to Azure Resource Manager (AzureRM), even after reading the documentation.
https://learn.microsoft.com/en-us/powershell/module/azurerm.compute/update-azurermvmss?view=azurermps-6.13.0
I'm looking to run a command that will update all my VMs in my Azure VMSS (virtual machine scale set) regardless of the number of instances. The upgrade policy is set to manual.
You have many VM's in a scale set each VM is referred to as an instance.
In manual mode when you update the scale set model, nothing happens to existing VMs.
To update existing VMs, you must do a "manual upgrade" of each existing VM.
The powershell command is:
Update-AzVmssInstance -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId instanceId
You must run this command for each VM in your scale set.
If you want to upgrade all VM's with a single command you need to change the upgrade policy to automatic or rolling.

Azure vmss without a load balancer

My requirement is to scale vm instance (linux based custom image) based on CPU usage. Tried to follow steps mentioned in VMSS (virtual machine scale sets : https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-linux-autoscale), but it creates a LB in front which we don't want. Is it possible to avoid LB in vmss ?
If VMSS without LB is not the option, is there any other way in azure to do this ?
I am able to achieve this in AWS (using autoscale group) and GCP (instance group), so trying to get similar functionality in Azure.
hp
In powershell to make this work you need to provide both double quotes wrapped in single quotes: --load-balancer '""'
az vmss -n myName -g myGroup --load-balancer '""' --image UbuntuLTS
Pass empty id as a load-balancer
az vmss create -n myname -g mygroup --load-balancer "" --public-ip-per-vm --image UbuntuLTS
Though a load balancer is created when you create a VM scale set in the portal, other modes supporting external connectivity to scale sets include:
Create a separate VM with a public IP address in the same VNET as the scale set which can route connections to the scale set VMs (also known as a jump box). E.g. https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-jumpbox or https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-linux-jumpbox
Assign a public IP address to each VM in the scale set. This feature is currently in limited preview. See here for more details: https://github.com/gbowerman/azure-myriad/tree/master/publicip-dns
Public IP per VM in a scale set is not supported today but is on the roadmap. If you submit a support request (e.g. from the question mark in the top-right of the azure portal), we can keep you informed on the timeline :).

How to change the number of target instances in an Azure Virtual Machine Scale Set?

I've created an Azure VMSS and used a target instance count of 1 during my testing. Now that I'm ready to go live for my customer, I really need to change the target instance count to at least 2 for HA reasons. Is there a way to do this via Azure CLI or other means without having to rebuild everything?
Is there a way to do this via Azure CLI or other means without having
to rebuild everything?
Yes, we can use Azure Resource Explorer to configure and update the autoscale setting for a scale set. Azure Resource Explorer is an easy way to manage Azure resources via Resource Manager templates. Here are my steps:
1. login Azure Resource Explorer.
2. switch Read Only to Read/Write.
3. select subscription and resource group, find the vmss and autoscalesettings, then edit it.
4. After edit is complete, select PUT.
5. Then we can find the result from Azure protal.
More information about configure and update the autoscale setting for a scale set, refer to the link.
You can change the capacity of a VM Scale set in the following ways:
Use the Azure portal - Click on your VM scale set and then select the Scaling blade. Use the slider bar.
Use the CLI 2.0 az vmss scale command.
Using Azure PowerShell 5.0.0 or later use this command:
Update-AzureRmVmss -ResourceGroupName myrg -VMScaleSetName myvmss -SkuCapacity 3

Resources