Skip to content

Commit 15aedb1

Browse files
authored
Merge pull request #214684 from halkazwini/nw-monitor-vms
Network Watcher: Freshness: Tutorial: Monitor network communication between two virtual machines using the Azure portal
2 parents ef312b5 + c6511e9 commit 15aedb1

File tree

4 files changed

+64
-51
lines changed

4 files changed

+64
-51
lines changed

articles/network-watcher/connection-monitor.md

Lines changed: 64 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
---
2-
title: Tutorial - Monitor network communication using the Azure portal
3-
description: In this tutorial, learn how to monitor network communication between two virtual machines with Azure Network Watcher's connection monitor capability.
2+
title: 'Tutorial: Monitor network communication between two virtual machines using the Azure portal'
3+
description: In this tutorial, you learn how to monitor network communication between two virtual machines with Azure Network Watcher's connection monitor capability.
44
services: network-watcher
5-
documentationcenter: na
65
author: damendo
7-
editor: ''
86
tags: azure-resource-manager
9-
# Customer intent: I need to monitor communication between a VM and another VM. If the communication fails, I need to know why, so that I can resolve the problem.
10-
117
ms.service: network-watcher
128
ms.topic: tutorial
13-
ms.tgt_pltfrm: na
14-
ms.workload: infrastructure-services
15-
ms.date: 01/04/2021
9+
ms.workload: infrastructure-services
10+
ms.date: 10/17/2022
1611
ms.author: damendo
1712
ms.custom: mvc
13+
# Customer intent: I need to monitor communication between a VM and another VM. If the communication fails, I need to know why, so that I can resolve the problem.
1814
---
1915

2016
# Tutorial: Monitor network communication between two virtual machines using the Azure portal
2117

2218
> [!NOTE]
23-
> This tutorial cover Connection Monitor (classic). Try the new and improved [Connection Monitor](connection-monitor-overview.md) to experience enhanced connectivity monitoring
19+
> This tutorial covers Connection Monitor (classic). Try the new and improved [Connection Monitor](connection-monitor-overview.md) to experience enhanced connectivity monitoring.
2420
2521
> [!IMPORTANT]
2622
> Starting 1 July 2021, you will not be able to add new connection monitors in Connection Monitor (classic) but you can continue to use existing connection monitors created prior to 1 July 2021. To minimize service disruption to your current workloads, [migrate from Connection Monitor (classic) to the new Connection Monitor](migrate-to-connection-monitor-from-connection-monitor-classic.md) in Azure Network Watcher before 29 February 2024.
2723
28-
Successful communication between a virtual machine (VM) and an endpoint such as another VM, can be critical for your organization. Sometimes, configuration changes are introduced which can break communication. In this tutorial, you learn how to:
24+
Successful communication between a virtual machine (VM) and an endpoint such as another VM, can be critical for your organization. Sometimes, configuration changes break communication. In this tutorial, you learn how to:
2925

3026
> [!div class="checklist"]
3127
> * Create two VMs
32-
> * Monitor communication between VMs with the connection monitor capability of Network Watcher
28+
> * Monitor communication between VMs with the Connection Monitor capability of Network Watcher
3329
> * Generate alerts on Connection Monitor metrics
3430
> * Diagnose a communication problem between two VMs, and learn how you can resolve it
3531
3632
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
3733

34+
## Prerequisites
3835

36+
- An Azure subscription
3937

4038
## Sign in to Azure
4139

@@ -47,58 +45,73 @@ Create two VMs.
4745

4846
### Create the first VM
4947

50-
1. Select **+ Create a resource** found on the upper, left corner of the Azure portal.
51-
2. Select **Compute**, and then select an operating system. In this tutorial, **Windows Server 2016 Datacenter** is used.
52-
3. Enter, or select, the following information, accept the defaults for the remaining settings, and then select **OK**:
48+
1. In the search box at the top of the portal, enter *virtual machine*. Select **Virtual machines**.
49+
50+
1. In **Virtual machines**, select **+ Create** then **+ Azure virtual machine**.
51+
52+
1. Enter or select the following information in **Create a virtual machine**.
53+
54+
| Setting | Value |
55+
| ------- | ----- |
56+
| **Project details** | |
57+
| Subscription | Select your subscription. |
58+
| Resource group | Select **Create new**. </br> Enter *myResourceGroup* in **Name**. </br> Select **OK**. |
59+
| **Instance details** | |
60+
| Virtual machine name | Enter *myVM1*. |
61+
| Region | Select **(US) East US**. |
62+
| Availability options | Select **No infrastructure redundancy required**. |
63+
| Security type | Leave the default of **Standard**. |
64+
| Image | Select **Windows Server 2019 Datacenter - Gen2**. |
65+
| Azure Spot instance | Leave the default. |
66+
| Size | Select a size. |
67+
| **Administrator account** | |
68+
| Username | Enter a username. |
69+
| Password | Enter a password. |
70+
| Confirm password | Confirm password. |
71+
| **Inbound port rules** | |
72+
| Public inbound ports | Leave the default of **Allow selected ports**. |
73+
| Select inbound ports | Leave the default of **RDP (3389)**. |
74+
75+
1. Select **Advanced** tab, then select **Select an extension to install**.
5376

54-
|Setting|Value|
55-
|---|---|
56-
|Name|myVm1|
57-
|User name| Enter a user name of your choosing.|
58-
|Password| Enter a password of your choosing. The password must be at least 12 characters long and meet the [defined complexity requirements](../virtual-machines/windows/faq.yml?toc=%2fazure%2fnetwork-watcher%2ftoc.json#what-are-the-password-requirements-when-creating-a-vm-).|
59-
|Subscription| Select your subscription.|
60-
|Resource group| Select **Create new** and enter **myResourceGroup**.|
61-
|Location| Select **East US**|
77+
1. Enter *Network Watcher Agent for Windows* in the search box. Select **Network Watcher Agent for Windows** and then select **Next**.
6278

63-
4. Select a size for the VM and then select **Select**.
64-
5. Under **Settings**, select **Extensions**. Select **Add extension**, and select **Network Watcher Agent for Windows**, as shown in the following picture:
79+
:::image type="content" source="./media/connection-monitor/network-watcher-agent-for-windows.png" alt-text="Screenshot of installing Network Watcher Agent for Windows when creating a Windows VM.":::
6580

66-
![Network Watcher agent extension](./media/connection-monitor/nw-agent-extension.png)
81+
1. In **Configure Network Watcher Agent for Windows Extension** page, select **Create**.
6782

68-
6. Under **Network Watcher Agent for Windows**, select **Create**, under **Install extension** select **OK**, and then under **Extensions**, select **OK**.
69-
7. Accept the defaults for the remaining **Settings** and select **OK**.
70-
8. Under **Create** of the **Summary**, select **Create** to start VM deployment.
83+
1. In **Create a virtual machine** page, select **Review + create** and then **Create** to start VM deployment.
7184

7285
### Create the second VM
7386

7487
Complete the steps in [Create the first VM](#create-the-first-vm) again, with the following changes:
7588

76-
|Step|Setting|Value|
77-
|---|---|---|
78-
| 1 | Select a version of **Ubuntu Server** | |
79-
| 3 | Name | myVm2 |
80-
| 3 | Authentication type | Paste your SSH public key or select **Password** and enter a password. |
81-
| 3 | Resource group | Select **Use existing** and select **myResourceGroup**. |
82-
| 6 | Extensions | **Network Watcher Agent for Linux** |
89+
|Setting|Value|
90+
|---|---|
91+
| Resource group | Select **myResourceGroup**. |
92+
| Virtual machine name | Enter *myVM2*. |
93+
| Image | Select **Ubuntu Server 18.04 LTS - Gen2**. |
94+
| Public inbound ports | Select **Allow selected ports**. |
95+
| Select inbound ports | Select **SSH (22)**. |
96+
| Extensions | Select **Network Watcher Agent for Linux**. |
8397

8498
The VM takes a few minutes to deploy. Wait for the VM to finish deploying before continuing with the remaining steps.
8599

86100
## Create a connection monitor
87101

88102
Create a connection monitor to monitor communication over TCP port 22 from *myVm1* to *myVm2*.
89103

90-
1. On the left side of the portal, select **All services**.
91-
2. Start typing *network watcher* in the **Filter** box. When **Network Watcher** appears in the search results, select it.
92-
3. Under **MONITORING**, select **Connection monitor**.
93-
4. Select **+ Add**.
94-
5. Enter or select the information for the connection you want to monitor, and then select **Add**. In the example shown in the following picture, the connection monitored is from the *myVm1* VM to the *myVm2* VM over port 22:
104+
1. In the search box at the top of the portal, enter *network watcher*. Select **Network Watcher**.
105+
1. Under **Monitoring**, select **Connection monitor (classic)**.
106+
1. Select **+ Add**.
107+
1. Enter or select the information for the connection you want to monitor, and then select **Add**. In the example shown in the following picture, the connection monitored is from the *myVm1* VM to the *myVm2* VM over port 22:
95108

96109
| Setting | Value |
97110
| --------- | --------- |
98111
| Name | myVm1-myVm2(22) |
99-
| Source | |
112+
| **Source** | |
100113
| Virtual machine | myVm1 |
101-
| Destination | |
114+
| **Destination** | |
102115
| Select a virtual machine | |
103116
| Virtual machine | myVm2 |
104117
| Port | 22 |
@@ -117,22 +130,22 @@ Create a connection monitor to monitor communication over TCP port 22 from *myVm
117130

118131
Note the following information:
119132

120-
| Item | Value | Details |
121-
| --------- | --------- |-------- |
122-
| Status | Reachable | Lets you know whether the endpoint is reachable or not.|
133+
| Item | Value | Details |
134+
| ---------| ---------|--------|
135+
| Status | Reachable | Lets you know whether the endpoint is reachable or not.|
123136
| AVG. ROUND-TRIP | Lets you know the round-trip time to make the connection, in milliseconds. Connection monitor probes the connection every 60 seconds, so you can monitor latency over time. |
124-
| Hops | Connection monitor lets you know the hops between the two endpoints. In this example, the connection is between two VMs in the same virtual network, so there is only one hop, to the 10.0.0.5 IP address. If any existing system or custom routes, route traffic between the VMs through a VPN gateway, or network virtual appliance, for example, additional hops are listed. |
137+
| Hops | Connection monitor lets you know the hops between the two endpoints. In this example, the connection is between two VMs in the same virtual network, so there's only one hop, to the 10.0.0.5 IP address. If any existing system or custom routes, route traffic between the VMs through a VPN gateway, or network virtual appliance, for example, additional hops are listed. |
125138
| STATUS | The green check marks for each endpoint let you know that each endpoint is healthy. ||
126139

127140
## Generate alerts
128141

129142
Alerts are created by alert rules in Azure Monitor and can automatically run saved queries or custom log searches at regular intervals. A generated alert can automatically run one or more actions, such as to notify someone or start another process. When setting an alert rule, the resource that you target determines the list of available metrics that you can use to generate alerts.
130143

131144
1. In Azure portal, select the **Monitor** service, and then select **Alerts** > **New alert rule**.
132-
2. Click **Select target**, and then select the resources that you want to target. Select the **Subscription**, and set the **Resource type** to filter down to the Connection Monitor that you want to use.
145+
2. Select **Select target**, and then select the resources that you want to target. Select the **Subscription**, and set the **Resource type** to filter down to the Connection Monitor that you want to use.
133146

134147
![alert screen with target selected](./media/connection-monitor/set-alert-rule.png)
135-
1. Once you have selected a resource to target, select **Add criteria**. The Network Watcher has [metrics on which you can create alerts](../azure-monitor/alerts/alerts-metric-near-real-time.md#metrics-and-dimensions-supported). Set **Available signals** to the metrics ProbesFailedPercent and AverageRoundtripMs:
148+
1. Once you've selected a resource to target, select **Add criteria**. The Network Watcher has [metrics on which you can create alerts](../azure-monitor/alerts/alerts-metric-near-real-time.md#metrics-and-dimensions-supported). Set **Available signals** to the metrics ProbesFailedPercent and AverageRoundtripMs:
136149

137150
![alert page with signals selected](./media/connection-monitor/set-alert-signals.png)
138151
1. Fill out the alert details like alert rule name, description, and severity. You can also add an action group to the alert to automate and customize the alert response.
@@ -145,9 +158,9 @@ By default, Azure allows communication over all ports between VMs in the same vi
145158
2. Select the **myVm2-nsg** network security group.
146159
3. Select **Inbound security rules**, and then select **Add**, as shown in the following picture:
147160

148-
![Inbound security rules](./media/connection-monitor/inbound-security-rules.png)
161+
:::image type="content" source="./media/connection-monitor/inbound-security-rules-inline.png" alt-text="Screenshot of Inbound security rules." lightbox="./media/connection-monitor/inbound-security-rules-expanded.png":::
149162

150-
4. The default rule that allows communication between all VMs in a virtual network is the rule named **AllowVnetInBound**. Create a rule with a higher priority (lower number) than the **AllowVnetInBound** rule that denies inbound communication over port 22. Select, or enter, the following information, accept the remaining defaults, and then select **Add**:
163+
4. The default rule that allows communication between all VMs in a virtual network is the rule named **AllowVnetInBound**. Create a rule with a higher priority (lower number) than the **AllowVnetInBound** rule that denies inbound communication over port 22. Select, or enter, the following information, accept the remaining defaults, and then select **+ Add**:
151164

152165
| Setting | Value |
153166
| --- | --- |
45 KB
Loading
131 KB
Loading
70.4 KB
Loading

0 commit comments

Comments
 (0)