0

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.

Confounder
  • 469
  • 1
  • 8
  • 23

1 Answers1

0

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.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • Thanks Shiraz Bhaiji. I was wondering if there's a way of updating all the VMs in the scale set without iterating through each one and running Update-AzVmssInstance. I can see examples of using for-each to loop through each VM, but curious to see if there's a single command to do it. The upgrade policy is set to manual, so we can control when to update through our release pipeline. – Confounder Nov 22 '19 at 09:50
  • @Confounder - Update-AzVmssInstance allows you to target a single instance, or a multiple instances if you pass in an array. – Nathan Kuchta Nov 22 '19 at 13:59