Any possibilities to monitor VM hung status

Sky High 311 Reputation points
2022-08-23T11:17:20.807+00:00

Hi MS,

Is there a way to monitor Azure VM hung status from Azure monitoring or using log analytics? Please suggest.

What are the logs that can be viewed using log analytics from a VM perspective.

Any application based logs be able to capture running on Azure VM?

CIAO

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,803 questions
Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
437 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,362 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Andrew Blumhardt 9,491 Reputation points Microsoft Employee
    2022-08-23T13:55:50.523+00:00

    Any of the tables where the VM is expected to write logs regularly can be used. For example event, perf, heartbeat, etc. You would see a drop in data collection when the system is hung or offline.

    Heartbeat
    | summarize arg_max(TimeGenerated, *) by Computer
    | where TimeGenerated < ago(15m)

    1 person found this answer helpful.
    0 comments No comments

  2. Maxim Sergeev 6,566 Reputation points Microsoft Employee
    2022-08-23T17:58:33.977+00:00

    Typically, if the VM is hung, agents are hung too. Per @Andrew Blumhardt is suggested the query, its required to install Azure Monitoring Agent first (which is basically recommended for many other monitoring scenarios).
    This is an instruction how to install the Azure Monitoring Agent https://learn.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-manage?tabs=ARMAgentPowerShell%2CPowerShellWindows%2CPowerShellWindowsArc%2CCLIWindows%2CCLIWindowsArc#using-the-azure-portal

    Then you will be able to query data as @Andrew Blumhardt suggested to get alerted if something goes wrong with the virtual machine.
    Additionally, if you are interested to monitor availability of the virtual machine from Azure Fabric, you can use the new availability metric (preview) and get notified is the machine is down.

    234128-image.png

    https://azure.microsoft.com/en-us/blog/advancing-azure-virtual-machine-availability-monitoring-with-project-flash/

    1 person found this answer helpful.
    0 comments No comments

  3. Amol Shelar 401 Reputation points
    2022-08-23T20:02:58.21+00:00

    @Sky High

    When you enable monitoring with VM insights in Azure Monitor for the virtual machine, a heartbeat is sent to Azure Monitor every minute. You can create a log query alert rule that sends an alert if a heartbeat isn't detected. This method not only alerts if the virtual machine isn't running, but also if it's not responsive.

    You can follow below steps,

    1. You can create alert when the Azure VM is unavailable due to any reason.
      To achieve this you need to first enable monitoring for Azure virtual machine.
      Refer tutorial-monitor-vm-enable

    https://learn.microsoft.com/en-us/azure/azure-monitor/vm/tutorial-monitor-vm-enable

    1. Create a Heartbeat Query using Logs Events tab.
    2. Create a New Alert Rule
    3. Configure the action group such as sending an email or an SMS whenever the server is unavailable.

    For complete detail, refer below link,
    https://learn.microsoft.com/en-us/azure/azure-monitor/vm/tutorial-monitor-vm-alert

    -Please mark it as Answer if it helps to resolve your query-

    _AmolShelar

    1 person found this answer helpful.

  4. Rishabh mishra 156 Reputation points
    2022-08-23T12:42:17.763+00:00

    You can use boot diagnostics feature Located in the virtual machine blade, the boot diagnostics option is under the Support and Troubleshooting section in the Azure portal. Selecting boot diagnostics will display a screenshot and serial log information. The serial log contains kernel messaging and the screenshot is a snapshot of your VMs current state

    0 comments No comments