Redeploy Linux virtual machine to new Azure node
If you face difficulties troubleshooting SSH or application access to a Linux virtual machine (VM) in Azure, redeploying the VM may help. When you redeploy a VM, it moves the VM to a new node within the Azure infrastructure and then powers it back on. All your configuration options and associated resources are retained. This article shows you how to redeploy a VM using Azure CLI or the Azure portal.
After you redeploy a VM, the temporary disk is lost and dynamic IP addresses associated with virtual network interface are updated.
Use the Azure CLI
Redeploy your VM with az vm redeploy. The following example redeploys the VM named myVM in the resource group named myResourceGroup:
az vm redeploy --resource-group myResourceGroup --name myVM
Use the Azure classic CLI
Classic VMs will be retired on March 1, 2023.
If you use IaaS resources from ASM, please complete your migration by March 1, 2023. We encourage you to make the switch sooner to take advantage of the many feature enhancements in Azure Resource Manager.
For more information, see Migrate your IaaS resources to Azure Resource Manager by March 1, 2023.
Install the latest Azure classic CLI and log in to your Azure account. Make sure that you are in Resource Manager mode (
azure config mode arm).
The following example redeploys the VM named myVM in the resource group named myResourceGroup:
azure vm redeploy --resource-group myResourceGroup --vm-name myVM
Use the Azure portal
Select the VM you wish to redeploy, then select the Redeploy button in the Settings blade. You may need to scroll down to see the Support and Troubleshooting section that contains the 'Redeploy' button as in the following example:
To confirm the operation, select the Redeploy button:
The Status of the VM changes to Updating as the VM prepares to redeploy, as shown in the following example:
The Status then changes to Starting as the VM boots up on a new Azure host, as shown in the following example:
After the VM finishes the boot process, the Status then returns to Running, indicating the VM has been successfully redeployed:
If you are having issues connecting to your VM, you can find specific help on troubleshooting SSH connections or detailed SSH troubleshooting steps. If you cannot access an application running on your VM, you can also read application troubleshooting issues.