VM Insights
Ankit Ranjan (DevOps Engineer)
Actively Seeking Azure DevOps/Cloud Role | DevOps Engineer | Automating & Reducing Developer Toil | Modernising IAC like Jam on the Bread | Microsoft Certified: Azure Admin Associate | Certified Terraform Associate |
"VM Insights offers a streamlined approach to monitoring client workloads on virtual machines and virtual machine scale sets. It provides an inventory of your current VMs and guides you through enabling basic monitoring. Additionally, it tracks the performance of your virtual machines and scale sets by collecting data on running processes and their dependencies.
VM Insights supports monitoring for both Windows and Linux operating systems across:
Pricing
"VM Insights itself is free of charge, but you will incur costs for its usage within the Log Analytics workspace. According to the pricing details on the Azure Monitor pricing page, VM Insights billing includes :
Limitations
VM Insights gathers a specific set of metrics from the VM client but does not collect event data. If you need to collect events or additional performance counters, you can create data collection rules in the Azure portal using the same Azure Monitor agent employed by VM Insights.
Note: VM Insights does not support sending data to multiple Log Analytics workspaces (multi-homing).
Enabling VM Insights Overview
VM Insights to monitor the health and performance of:
Agents
When you enable VM Insights for a machine, the following agents are installed.
Azure Monitor Agent or Log Analytics Agent: Gathers data from the virtual machine or Virtual Machine Scale Set and sends it to the Log Analytics workspace.
Dependency Agent: Captures information about processes running on the virtual machine and their external dependencies, which are used by the Map feature in VM Insights. The Dependency Agent relies on the Azure Monitor Agent or Log Analytics Agent to transmit its data to Azure Monitor.
Enable VM Insights in the Azure Portal
A. View Monitored and Unmonitored Machines
To check which virtual machines in your directory are being monitored with VM Insights:
1. In the Portal, go to the Monitor menu and select Virtual Machines > Overview.
2. The Overview page will display all virtual machines and Virtual Machine Scale Sets in the chosen subscriptions.
3. Select the Monitored tab to view the list of machines with VM Insights enabled.
4. Select the Not Monitored tab to see the list of machines without VM Insights enabled.
The Not Monitored tab includes all machines without VM Insights enabled, even if they have the Azure Monitor Agent or Log Analytics Agent installed. If a virtual machine has the Log Analytics Agent but lacks the Dependency Agent, it will be listed as not monitored. In this scenario, the Azure Monitor Agent will be initiated without the option to use the Log Analytics Agent.
B. Enabling VM Insights for Azure Monitor Agent
To enable VM Insights on an unmonitored virtual machine or Virtual Machine Scale Set using the Azure Monitor Agent:
1. In the Azure portal, go to the Monitor menu and select Virtual Machines > Not Monitored.
2. Next to the machine you want to enable, click Enable. If the machine is not currently running, you'll need to start it before enabling VM Insights.
3. On the Insights Onboarding page, click Enable.
4. Then, on the Monitoring Configuration page, choose the Azure Monitor Agent and select a data collection rule from the dropdown menu."
5. The Data Collection Rule dropdown shows only the rules configured for VM Insights. If no rule has been set up for VM Insights yet, Azure Monitor will automatically create one with:
6. To create a new data collection rule, select Create new. This allows you to choose a workspace and decide whether to collect processes and dependencies using the VM Insights Map feature.
7. Click Configure to begin the setup process. It may take a few minutes to install the agent and start data collection. You'll receive status updates during the configuration.
8. If you're using a manual upgrade model for your Virtual Machine Scale Set, you'll need to upgrade the instances to complete the setup. You can initiate the upgrades from the Instances page under the Settings section.
C. Enable VM Insights for Azure Monitor Agent on MAchine Monitored with Log Analytics Agent.
To add the Azure Monitor Agent to machines already using the Log Analytics Agent:
1. In the Azure portal, navigate to the Monitor menu and select Virtual Machines > Overview > Monitored.
2. Next to the machine you want to enable, click Configure using Azure Monitor Agent. If the machine is not currently running, you'll need to start it before enabling the agent.
3. On the Monitoring Configuration page, choose Azure Monitor Agent and select a rule from the Data Collection Rule dropdown menu.
4. The Data Collection Rule dropdown displays only rules configured for VM Insights. If no rule has been set up for VM Insights, Azure Monitor will automatically create one with:
A. To create a new data collection rule, select Create new. This option allows you to choose a workspace and specify whether to collect processes and dependencies using the VM Insights Map feature.
领英推荐
B. With both agents installed, Azure Monitor will show a warning indicating that you might be collecting duplicate data.
5. After confirming that the Azure Monitor Agent is enabled, remove the Log Analytics Agent from the machine to avoid duplicate data collection.
Change Analysis in VM insights
Overview: If you have a VM that's running slowly and want to investigate whether recent configuration changes might be impacting its performance, you can use VM Insights to check the VM's performance. For instance, if you notice a spike in memory usage over the past hour, change analysis can help you identify if any configuration changes made around that time are responsible for the increase.
Enable Change Analysis
To onboard Change Analysis in VM Insights, you need to register the Microsoft.ChangeAnalysis resource provider. When you first activate VM Insights or Application Change Analysis in the Azure portal, this resource provider is automatically registered for you. Note that Application Change Analysis is a free service and does not introduce any performance overhead on your resources.
View Change Analysis
Change Analysis can be accessed from the Performance or Map tab in VM Insights by selecting the Change option.
Click Investigate Changes to open the Application Change Analysis page filtered for the VM. Review the listed changes to determine if any might have caused the issue. If you’re uncertain about a specific change, check the Changed by column to see who made the change.
Edit Workbooks Section
Workbooks have two modes: editing and reading. When you open a new workbook, it defaults to editing mode, which displays all the content, including hidden steps and parameters. Reading mode offers a simplified, report-style view that abstracts away the complexities of the report's creation. However, the underlying details remain accessible for modifications with just a few clicks.
Add Query Section
To add a query section to your workbook, click Add query in the lower-left corner of the workbook or section.
Query sections are highly versatile and can help answer questions such as:
You are not limited to querying data from just the VM that opened the workbook. To query across multiple VMs and Log Analytics workspaces, ensure you have the necessary access permissions.
To include data from other Log Analytics workspaces or a specific Application Insights app, use the workspace identifier. For more information on cross-resource queries, refer to the official guidance.
Add Metrics Section
Metrics sections allow you to integrate Azure Monitor metrics data into your interactive reports. While prebuilt workbooks in VM Insights usually feature analytic query data, you can create workbooks that include metric data, combining the strengths of both features in a single report. You can also pull metric data from resources across any subscriptions you have access to.
For example, you can pull VM data into a workbook to create a grid visualization of CPU performance.
Remove VM Insights Completely
If you still need the Log Analytics workspace but want to remove the VMInsights solution from it:
1. Sign in to the Azure portal.
2. Navigate to All Services. In the search box, type "Log Analytics," and select Log Analytics from the filtered suggestions.
3. In the list of Log Analytics workspaces, choose the workspace you selected when you enabled VM Insights.
4. On the left pane, click Legacy Solutions.
5. In the list of solutions, find and select VMInsights (workspace name). On the solution's Overview page, click Delete. When prompted to confirm, click Yes.
Disable the Monitoring and keep the workspace
1. Sign in to the Azure portal.
2. Go to Virtual Machines.
3. Select the VM from the list.
4. On the left pane, choose Extensions. On the Extensions page, select DependencyAgent.
5. On the extension properties page, click Uninstall.
6. Return to the Extensions page and select MicrosoftMonitoringAgent.On the extension properties page, click Uninstall.