Restarts all virtual machine scale set (VMSS) instances or a specified range of instances.
Restart-AzVmss [-ResourceGroupName] <String> [-VMScaleSetName] <String> [[-InstanceId] <String[]>] [-AsJob] [-Force] [-WhatIf] [-Confirm] [ <CommonParameters> ]
| Parameter | Description |
|---|---|
-ResourceGroupName |
The name of the resource group. |
-VMScaleSetName |
The name of the virtual machine scale set. |
-InstanceId |
The instance ID(s) of the virtual machine scale set instances to restart. If not specified, all instances are restarted. |
-AsJob |
Run cmdlet in the background. |
-Force |
Forces the command to run without asking for user confirmation. |
-WhatIf |
Shows what would happen if the cmdlet runs. The cmdlet is not run. |
-Confirm |
Prompts you for confirmation before running the cmdlet. |
This command restarts all virtual machine scale set instances in the specified resource group and scale set.
Restart-AzVmss -ResourceGroupName "MyResourceGroup" -VMScaleSetName "MyVMScaleSet"
This command restarts instances with IDs 0 and 1 for the specified virtual machine scale set.
Restart-AzVmss -ResourceGroupName "MyResourceGroup" -VMScaleSetName "MyVMScaleSet" -InstanceId "0", "1"
This command restarts all virtual machine scale set instances in the specified resource group and scale set, running the operation in the background.
Restart-AzVmss -ResourceGroupName "MyResourceGroup" -VMScaleSetName "MyVMScaleSet" -AsJob