Skip to content

Commit 4c52d5c

Browse files
authored
Merge pull request #231367 from stevenmatthew/copylog
Copy log: new article
2 parents dd61c52 + c438fb4 commit 4c52d5c

14 files changed

+140
-3
lines changed

articles/storage-mover/TOC.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ items:
4141
expanded: true
4242
- name: Resources
4343
items:
44-
- name: Troubleshooting job run error codes
44+
- name: Monitor copy and job run logs
45+
href: log-monitoring.md
46+
- name: Troubleshoot job run error codes
4547
href: status-code.md
4648
- name: Collect a support bundle
4749
href: troubleshooting.md
4850
- name: Release notes
4951
href: release-notes.md
50-
51-
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
title: Monitor copy logs in Azure Storage Mover
3+
description: Learn how to monitor the status of Azure Storage Mover migration jobs.
4+
author: stevenmatthew
5+
ms.author: shaas
6+
ms.service: storage-mover
7+
ms.topic: how-to
8+
ms.date: 03/20/2023
9+
---
10+
11+
<!--
12+
!########################################################
13+
STATUS: DRAFT
14+
15+
CONTENT:
16+
17+
REVIEW Stephen/Fabian: Reviewed
18+
REVIEW Engineering: not reviewed
19+
EDIT PASS: started
20+
21+
Initial doc score: 97 (1212 words and 2 issues)
22+
23+
!########################################################
24+
-->
25+
26+
# How to enable Azure Storage Mover copy and job logs
27+
28+
When you use a migration tool to move your critical data from on-premises sources to Azure destination targets, you want to be able to monitor operations for potential issues. The data relating to the operations performed during your migration can be stored as either logs entries or metrics. When configured, Azure Storage Mover can provide **Copy logs** and **Job run logs**. These logs are especially useful because they allow you to trace the migration result of job runs and of individual files.
29+
30+
Both the copy and job run logs can be sent to an Azure Analytics Workspace. Analytics workspaces are storage units where Azure services store the log data they generate. Log Analytics is integrated into the Storage Mover portal experience. This integration allows you to see the relevant logs for your copy jobs within the same surface you use to manage them. More importantly, the integration also allows you to create and run log queries from multiple logs and interactively analyze their results.
31+
32+
> [!IMPORTANT]
33+
> Before you can access your migration's log data, you need to ensure that you've created an Azure Analytics Workspace and configured your Storage Mover instance to use it. Any logs generated prior to this configuration will be lost. You may be able to retrieve limited log information directly from the agent.
34+
35+
This article describes the steps involved in creating an analytics workspace and to configure a diagnostic setting within a storage mover resource.
36+
37+
## Configuring Azure Log Analytics and Storage Mover
38+
39+
This section briefly describes how to configure an Azure Monitor Log Analytics Workspace and Storage Mover diagnostic settings. After completing the following steps, you'll be able to query the data provided by your Storage Mover resource.
40+
41+
### Create a Log Analytics workspace
42+
43+
Storage Mover collects copy and job logs, and stores the information in an Azure Log Analytics workspace. After you've created a workspace, you can configure Storage Mover to save its data there. If you don't have an existing workspace, you can create one in the Azure portal.
44+
45+
Enter **Log Analytics** in the search box and select **Log Analytics workspace**. In the content pane, select either **Create** or **Create log analytics workspace** to create a workspace. Provide values for the **Subscription**, **Resource Group**, **Name**, and **Region** fields, and select **Review + Create**.
46+
47+
:::image type="content" source="media/log-monitoring/workspace-create-sml.png" lightbox="media/log-monitoring/workspace-create-lrg.png" alt-text="Screen capture illustrating the methods of creating an Azure Analytics Workspace." :::
48+
49+
You can get more detailed information about Log Analytics and its features by visiting the [Log Analytics overview](/azure/azure-monitor/logs/log-analytics-overview) article. If you prefer to view a tutorial, you can visit the [Log Analytics tutorial](/azure/azure-monitor/logs/log-analytics-tutorial) instead.
50+
51+
### Configure Storage Mover diagnostic settings
52+
53+
After an analytics workspace has been created, you can specify it as the destination in which Storage Mover logs and metrics can be displayed.
54+
55+
There are two options for configuring Storage Mover to send logs to your analytics workspace. First, you can configure diagnostic settings during the initial deployment of your top-level Storage Mover resource. The following example shows how to specify diagnostic settings in the Azure portal during Storage Mover resource creation.
56+
57+
:::image type="content" source="media/log-monitoring/monitoring-configure-sml.png" lightbox="media/log-monitoring/monitoring-configure-lrg.png" alt-text="Screen capture highlighting the ability to enable monitoring during initial deployment." :::
58+
59+
You may also choose to add a diagnostic setting to a Storage Mover resource after it's been deployed. To add the diagnostic setting, navigate to the Storage Mover resource. In the menu pane, select **Diagnostic settings** and then select **Add diagnostic setting** as shown in the following example.
60+
61+
:::image type="content" source="media/log-monitoring/diagnostic-settings-sml.png" lightbox="media/log-monitoring/diagnostic-settings-lrg.png" alt-text="Screen capture highlighting the ability to add a diagnostic setting after deployment." :::
62+
63+
In the **Diagnostic setting** pane, provide a value for the **Diagnostic setting name**. Within the **Logs** group, select one or more log categories to be collected. You may also select the **Job runs** option within the **Metrics** group to view the results of your individual job runs. Within the **Destination details** group, select **Send to Log Analytics workspace**, the name of your subscription, and the name of the Log Analytics workspace to collect your log data. Finally, select **Save** to add your new diagnostic setting. You can view the image provided as a reference.
64+
65+
:::image type="content" source="media/log-monitoring/setting-add-sml.png" lightbox="media/log-monitoring/setting-add-lrg.png" alt-text="Screen capture illustrating the location of the fields required to add a Diagnostic Setting to an existing Storage Mover resource." :::
66+
67+
After your Storage Mover diagnostic setting has been saved, it will be reflected on the Diagnostic settings screen within the **Diagnostic settings** table.
68+
69+
## Analyzing logs
70+
71+
All resource logs in Azure Monitor have the same fields, and are followed by service-specific fields. The common schema is outlined in [Azure Monitor resource log schema](../azure-monitor/essentials/resource-logs-schema.md).
72+
73+
Storage Mover generates two tables, StorageMoverCopyLogsFailed and StorageMoverJobRunLogs. The schema for **StorageMoverCopyLogsFailed** is found in the [Azure Storage Copy log data reference](/azure/azure-monitor/reference/tables/StorageMoverCopyLogsFailed), and the schema for **StorageMoverJobRunLogs** is found in the [Azure Storage Job run log data reference](/azure/azure-monitor/reference/tables/StorageMoverJobRunLogs).
74+
75+
Your log data is integrated into Storage Mover's Azure portal user interface (UI) experience. To access your log data, migrate to your top-level storage mover resource and select **Logs** from within the **Monitoring** group in the navigation pane. Close the initial **Welcome to Log Analytics** window displayed in the main content pane as shown in the following example.
76+
77+
:::image type="content" source="media/log-monitoring/logs-splash-sml.png" lightbox="media/log-monitoring/logs-splash-lrg.png" alt-text="Screen capture illustrating the selections required to open the Logs pane and close the splash screen." :::
78+
79+
After the **Welcome** window is closed within the main content pane, the **New Query** window is displayed. In the schema and filter pane, ensure that the **Tables** object is selected and that the **StorageMoverCopyLogsFailed** and **StorageMoverJobRunLogs** tables are visible. Using Kusto Query Language (KQL) queries, you can begin extracting log data from the tables displayed within the schema and filter pane. Enter your query into the query editing field and select **Run** as shown in the following screen capture. A simple query example is also provided used to retrieve details on any failed copy operations from the previous 60 days.
80+
81+
:::image type="content" source="media/log-monitoring/logs-query-sml.png" lightbox="media/log-monitoring/logs-query-lrg.png" alt-text="Screen capture identifying the panes within the Log Analytics schema and filter page." :::
82+
83+
```kusto
84+
StorageMoverCopyLogsFailed
85+
| top 1000 by timeGenerated desc
86+
```
87+
88+
### Sample Kusto queries
89+
90+
After you send logs to Log Analytics, you can access those logs by using Azure Monitor log queries. For more information, see the [Log Analytics tutorial](../azure-monitor/logs/log-analytics-tutorial.md).
91+
92+
The following sample queries provided can be entered in the **Log search** bar to help you monitor your migration. These queries work with the [new language](../azure-monitor/logs/log-query-overview.md).
93+
94+
- To list all the files that failed to copy from a specific job run within the last 30 days.
95+
96+
```kusto
97+
StorageMoverCopyLogsFailed
98+
| where TimeGenerated > ago(30d) and JobRunName == "[job run ID]"
99+
```
100+
101+
- To list the 10 most common copy log error codes over the last seven days.
102+
103+
```kusto
104+
StorageMoverCopyLogsFailed
105+
| where TimeGenerated > ago(7d)
106+
| summarize count() by StatusCode
107+
| top 10 by count_ desc
108+
```
109+
110+
- To list the 10 most recent job failure error codes over the last three days.
111+
112+
```kusto
113+
StorageMoverJobRunLogs
114+
| where TimeGenerated > ago(3d) and StatusCode != "AZSM0000"
115+
| summarize count() by StatusCode
116+
| top 10 by count_ desc
117+
```
118+
119+
- To create a pie chart of failed copy operations grouped by job run over the last 30 days.
120+
121+
```kusto
122+
StorageMoverCopyLogsFailed
123+
| where TimeGenerated > ago(30d)
124+
| summarize count() by JobRunName
125+
| sort by count_ desc
126+
| render piechart
127+
```
128+
129+
## Next steps
130+
131+
Get started with any of these guides.
132+
133+
- [Log Analytics workspaces](../azure-monitor/logs/log-analytics-workspace-overview.md)
134+
- [Azure Monitor Logs overview](../azure-monitor/logs/data-platform-logs.md)
135+
- [Diagnostic settings in Azure Monitor](../azure-monitor/essentials/diagnostic-settings.md?tabs=portal)
136+
- [Azure Storage Mover support bundle overview](troubleshooting.md)
137+
- [Troubleshooting Storage Mover job run error codes](status-code.md)
125 KB
Loading
32.9 KB
Loading
185 KB
Loading
49.9 KB
Loading
74.9 KB
Loading
20.8 KB
Loading
86.6 KB
Loading
23.2 KB
Loading

0 commit comments

Comments
 (0)