|
| 1 | +--- |
| 2 | +title: Collect diagnostic logs for Azure Stack HCI using the Azure portal |
| 3 | +description: How to collect diagnostic logs using the Azure portal and share them with Microsoft. |
| 4 | +author: alkohli |
| 5 | +ms.author: alkohli |
| 6 | +ms.topic: how-to |
| 7 | +ms.service: azure-stack |
| 8 | +ms.subservice: azure-stack-hci |
| 9 | +ms.date: 05/05/2024 |
| 10 | +--- |
| 11 | + |
| 12 | +# Collect diagnostic logs for Azure Stack HCI using the Azure portal |
| 13 | + |
| 14 | +[!INCLUDE [applies-to](../../includes/hci-applies-to-23h2.md)] |
| 15 | + |
| 16 | +This article describes how to collect diagnostic logs using the Azure portal and send them to Microsoft to help identify and fix any issues with your Azure Stack HCI solution. |
| 17 | + |
| 18 | +For information on on-demand log collection, its benefits and prerequisites, see [] to collect diagnostic logs via PowerShell, see [Collect diagnostic logs for Azure Stack HCI](./collect-logs.md). |
| 19 | + |
| 20 | +## On-demand log collection |
| 21 | + |
| 22 | +On-demand log collection involves manually collecting and sending diagnostic logs to Microsoft. You can perform on-demand log collection using any of the following methods: |
| 23 | + |
| 24 | +- (Recommended) Azure portal. When you collect logs and send them to Microsoft using the Azure portal, you collect logs at the cluster level. This send the default logs. |
| 25 | +- PowerShell. But if you need like specific parameters around, OK like you need to share them, you need to either like save them to an SMB share or you need to just send the supplementary logs or you only wanna send specific rules, then you still need to use PowerShell. If you want to Use the `Send-DiagnosticData` cmdlet from any node within the Azure Stack HCI cluster to collect logs and send them to Microsoft. When you run this cmdlet, the logs are temporarily copied locally. This copy is parsed, sent to Microsoft, and then deleted from your system. Microsoft retains this diagnostic data for up to 30 days and handles it as per the [standard privacy practices](https://privacy.microsoft.com/). |
| 26 | + |
| 27 | +### When to use on-demand log collection |
| 28 | + |
| 29 | +Here are the scenarios in which you can perform on-demand log collection: |
| 30 | + |
| 31 | +- Microsoft Support requests for logs based on an open case. |
| 32 | +- Logs are collected when a cluster is connected and registered. |
| 33 | +- Logs are collected when the Observability components are operational and installed. |
| 34 | +- Logs are collected when a cluster is only partly registered. |
| 35 | +- Logs are collected for issues not related to registration failures. |
| 36 | + |
| 37 | +To explore additional log collection methods in Azure Stack HCI and understand when to use them, see [Diagnostics](../concepts/observability.md#diagnostics). |
| 38 | + |
| 39 | +## Prerequisites |
| 40 | + |
| 41 | +Before you collect on-demand logs via the Azure portal, you must complete the following prerequisites: |
| 42 | + |
| 43 | +- You must have access to an Azure Stack HCI cluster. |
| 44 | +- You must have access to Azure. |
| 45 | +- You must have installed the `AzureEdgeTelemetryAndDiagnostics` extension to collect telemetry and diagnostics information from your Azure Stack HCI system. For information about the extension, see [Azure Stack HCI telemetry and diagnostics extension overview](../concepts/telemetry-and-diagnostics-overview.md). |
| 46 | +- Review the terms and conditions for log collection. |
| 47 | + |
| 48 | +## Collect logs via the Azure portal |
| 49 | + |
| 50 | +Follow these steps to collect diagnostic logs for you Azure Stack HCI cluster via the Azure portal: |
| 51 | + |
| 52 | +1. the Azure portal, go to the Azure Stack HCI cluster resource. |
| 53 | +1. In the left pane, under **Settings**, select **HCI diagnostics and Support**. |
| 54 | +1. On the **Troubleshoot issues and get support** pane, under the **Send Diagnostics Logs** tile, select **Go to diagnostics**. |
| 55 | +1. The **Diagnostics** tab displays the log activity, the timestamp of collected logs and their statuses. To collect logs now, select **Send logs**. |
| 56 | +1. On the **Send logs** pane on the right, select the *Log start time** and **Log end tme** by selecting a date and time from the. |
| 57 | +1. Select the **Collect and upload logs** button. By selecting this, you agree to the terms and conditions of collection logs. |
| 58 | + |
| 59 | +Run the `Send-DiagnosticData` cmdlet from any node on your Azure Stack HCI cluster to perform on-demand log collection. |
| 60 | + |
| 61 | +Here are some important points to consider: |
| 62 | + |
| 63 | +- The completion time of the `Send-DiagnosticData` cmdlet varies depending on factors, such as the roles for which logs are being collected, time duration specified, and the number of nodes in your Azure Stack HCI environment. |
| 64 | +- If you don't specify any parameters, the `Send-DiagnosticData` cmdlet collects data from all nodes for the previous one-hour duration. |
| 65 | + |
| 66 | +Here's the syntax of `Send-DiagnosticData`: |
| 67 | + |
| 68 | +```powershell |
| 69 | +Send-DiagnosticData [[-FilterByRole] <string[]>] [[-FromDate] <datetime>] [[-ToDate] <datetime>] [[-CollectSddc] <bool>] [<CommonParameters>] |
| 70 | +``` |
| 71 | + |
| 72 | +For reference information on `Send-DiagnosticData`, see the [`Send-DiagnosticData` command reference](#send-diagnosticdata-command-reference) section later in this article. |
| 73 | + |
| 74 | +## Perform on-demand log collection via Windows Admin Center in the Azure portal |
| 75 | + |
| 76 | +The `Diagnostics` extension in Windows Admin Center in the Azure portal enables you to perform on-demand log collection and share the logs with Microsoft. |
| 77 | + |
| 78 | +Follow these steps to perform on-demand log collection via Windows Admin Center in the Azure portal: |
| 79 | + |
| 80 | +1. Connect to Windows Admin Center in the Azure portal. For information, see [Manage Azure Stack HCI clusters using Windows Admin Center in Azure](/windows-server/manage/windows-admin-center/azure/manage-hci-clusters). |
| 81 | +1. In the left pane, under **Extensions**, select **Diagnostics**. |
| 82 | +1. On the **Diagnostics** page, under **Log activity** review log collection history or select a row to show the details about a specific log collection. |
| 83 | +1. Select **Send manually**. In the context pane on the right, enter the log start and end time and then select **Collect & upload logs**. |
| 84 | + |
| 85 | + :::image type="content" source="./media/collect-logs/send-logs-manually.png" alt-text="Screenshot of the Diagnostics page showing the Send manually button for on-demand log collection." lightbox="./media/collect-logs/send-logs-manually.png" ::: |
| 86 | + |
| 87 | +## Next steps |
| 88 | + |
| 89 | +- [Contact Microsoft Support](get-support.md) |
| 90 | +- [Review known issues in Azure Stack HCI](../known-issues-2311-2.md) |
0 commit comments