Skip to content

Latest commit

 

History

History
76 lines (49 loc) · 2.49 KB

File metadata and controls

76 lines (49 loc) · 2.49 KB
title Virtual machine stuck in failed state
description Resolves issues in which a virtual machine (VM) is stuck in a failed state.
services virtual-machines
author mimckitt
manager dcscontentpm
tags azure-resource-manager
ms.service azure-virtual-machines
ms.topic troubleshooting
ms.date 03/26/2024
ms.author mimckitt
ms.custom sap:VM Admin - Windows (Guest OS)

Virtual machine stuck in a failed state

Applies to: ✔️ Linux VMs ✔️ Windows VMs

This article provides steps to resolve issues in which a Microsoft Azure virtual machine (VM) is stuck in a failed state.

Symptoms

The VM status in the Azure portal is shown as Failed.

Cause

The last operation that was run on the VM failed after the input was accepted.

Resolution

Note

This resolution is supported only for API version "2019-07-01" or a later version.

Update the VM objects and properties by running the reapply command in the Azure portal:

  1. Navigate to the VM that's stuck in the Failed state.
  2. Under Support + troubleshooting, select Redeploy + reapply.
  3. Select the Reapply option.

:::image type="content" source="./media/troubleshoot-vm-reapply/vm-reapply-portal.png" alt-text="Screenshot of the region options that shows the difference in pricing and eviction rates as a table.":::

Update the VM objects and properties by running the az vm reapply command:

az vm reapply -g MyResourceGroup -n MyVm

Update the VM objects and properties by running the Update-AzVM command after you apply the reapply parameter:

Get-AzVM -ResourceGroupName <ResourceGroup> -Name <VMName>
Set-AzVM -ResourceGroupName <ResourceGroup> -Name <VMName> -Reapply
Update-AzVM -VM <PSVirtualMachine> -ResourceGroupName <ResourceGroupName>

Update the VM objects and properties by running the reapply command:

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply?api-version=2021-07-01

Next steps

If reapply doesn't clear the VM Failed state, try redeploying to a new host node.