In this post, Partition Magic tells you what to do if Azure Virtual Machine (VM) is shutting down or stopping unexpectedly. If you encounter unexpected shutdown of Azure virtual machine, apply the given methods to fix it.
Azure virtual machine can shut down or stop unexpectedly due to scheduled Auto-shutdowns, reclaim resources, high CPU/memory/disk usage, third-party programs, hardware failures or storage issues with Azure, group policies for Windows VMs, and other reasons.
Based on the above causes, this post offers you several troubleshooting methods for unexpected shutdown of Azure virtual machine. You can try them one by one and check which method solves the issue.
MiniTool Partition Wizard FreeClick to Download100%Clean & Safe
Fix 1: Disable Auto-shutdown
Before trying other methods, you should check if you have enabled Auto-shutdown. If so, you need to disable Auto-shutdown. The following steps show you the whole process.
Step 1: Check the Azure Portal under the VM’s Operations settings to see if Auto-shutdown is enabled. Then toggle the OFF option and click Save.

Step 2: Review Automation Accounts to make sure that no scheduled tasks or runbook scripts are set to shut down the VM at specific times by mistake.
Step 3: After disabling Auto-shutdown, check if Azure Virtual Machine (VM) is shutting down or stopping unexpectedly.
Fix 2: Restart Azure Linux Agent
Azure Linux Agent is one of the main reasons for unexpected shutdown of Azure virtual machine. Even if the agent is not problematic, it impacts the environments heavily and any glitch can let the whole environment stop.
When Azure virtual machine shut down, it’s strongly recommended to restart Azure Linux Agent. Before troubleshooting or managing services on the VM, you must log into the Azure VM via Remote Desktop Protocol (RDP) or Secure Shell (SSH).
In this scenario, I show you how to log into Azure VM through RDP.
This method requires IP address and credentials offered during VM creation.
- Go to the Azure portal.
- Look for and choose Virtual Machines.
- Locate the VM you want to connect to.
- On the VM’s page, pick Connect > RDP.
- Tap Download RDP file to download the file with connection details.
- Double-click the downloaded file to open the Remote Desktop Connection window.
- Input the username and password.
- Tap Connect to set up the connection.
Once done, execute this command: systemctl status waagent. Please note that the command queries the status of the WAAGENT service using the system service manager. To restart Azure Linux Agent, you need to run the “systemctl restart waagent” command.
After you restart Azure Linux Agent, see if Azure virtual machine shut down all of sudden.
Fix 3: Check Azure-Initiated Shutdowns via Root Cause Analysis
You can check the VM’s Resource Health section in the Azure Portal with Azure’s Root Cause Analysis tools to find events like Unexpected shutdown or Platform-initiated shutdown. These issues might indicate hardware failures or storage timeouts.
In addition, review the Activity Logs to filter shutdown events and check the Event Initiated By column for causes like hardware auto-recovery or connectivity loss. If the issue is related to host node failure, utilize the Redeploy feature to move the VM to a healthy node.
Fix 4: Run Azure Virtual Machine in Safe Mode
To exclude the cause of third-party programs, try running Azure virtual machine in Safe Mode. As you know, Safe Mode is a diagnostic mode for Windows OS and applications. System boots up with only a minimal set of essential drivers and services in Safe Mode.
Non-vital components like third-party applications and drivers will be disabled, preventing interference of these programs. In this scenario, you can run Azure virtual machine in Safe Mode to see if it runs properly. How to do that? Here’s are the steps for you.
Step 1: Access the Serial Console for the Azure VM through the Azure portal.
Step 2: Initiate a restart of the VM with the Serial Console.
Step 3: During the startup process, navigate to the Advanced Boot Options menu via Serial Console.
Step 4: According to your needs, choose Safe Mode or Safe Mode with Networking from the menu. Then check if Azure virtual machine shut down suddenly.
Fix 5: Modify VM Size
As high CPU/memory/disk usage can lead to unexpected shutdown of Azure virtual machine, you should monitor the resource utilization of CPU/memory/disk with Azure Monitor and Metrics in time. Once you find that the VM configuration lags behind, scale up to a more powerful SKU.
In addition, you should also evaluate running applications and optimize/offload intensive processes. By doing so, you can stop your machine from getting overwhelmed and stopping unexpectedly.
In Conclusion
What to do if Azure Virtual Machine (VM) is shutting down or stopping unexpectedly? Here are 5 available methods for you. Pick one to solve the issue right now!
User Comments :