诊断日志收集Diagnostic log collection

Azure Stack Hub 是一个集合,同时包含可以彼此交互的 Windows 组件和本地 Azure 服务。Azure Stack Hub is a collection of both Windows components and on-premises Azure services interacting with each other. 所有这些组件和服务都会生成自己的日志集。All these components and services generate their own set of logs. 由于 Azure 支持使用这些日志来识别和修复问题,因此我们提供诊断日志收集。Since Azure Support uses these logs to identify and fix your issues, we offer diagnostic log collection. 使用诊断日志收集功能,你可以快速收集诊断日志并与 Azure 支持共享该日志。Diagnostic log collection helps you quickly collect and share diagnostic logs with Azure Support.

重要

必须注册 Azure Stack Hub 才能使用诊断日志收集。You have to register Azure Stack Hub to use diagnostic log collection. 如果尚未注册 Azure Stack Hub,请使用特权终结点 (PEP) 来共享日志。If you haven't registered Azure Stack Hub, use the privileged endpoint (PEP) to share logs.

Azure Stack Hub 提供了多种方式来收集和保存诊断日志并将其发送到 Azure 支持。Azure Stack Hub has multiple ways to collect, save, and send diagnostic logs to Azure Support. 根据与 Azure 的连接情况,用于收集和发送日志的选项包括:Depending on connectivity to Azure, your options for collecting and sending logs are:

以下流程图显示了各种情况下用于发送诊断日志的选项。The flowchart below shows which option to use for sending diagnostic logs in each case. 如果 Azure Stack Hub 可以连接到 Azure,建议启用“主动日志收集”,这会在引发关键警报时自动将诊断日志上传到 Azure 中由 Azure 控制的存储 blob。If Azure Stack Hub can connect to Azure, we recommend enabling Proactive log collection, which will automatically upload diagnostic logs to a Azure-controlled storage blob in Azure when a critical alert gets raised. 还可使用“立即发送日志”按需收集日志。You can alternatively collect logs on-demand by using Send logs now. 如果 Azure Stack Hub 与 Azure 断开连接,可以“在本地保存日志”。If Azure Stack Hub is disconnected from Azure, you can Save logs locally.

流程图,显示如何将日志立即发送到 Microsoft

主动发送日志Send logs proactively

在你建立支持案例之前,主动收集日志功能会自动从 Azure Stack Hub 收集诊断日志并将其发送给我们。Proactive log collection automatically collects and sends diagnostic logs from Azure Stack Hub to us before you open a support case. 这些日志仅在发出了系统运行状况警报的情况下收集,并且仅在建立了支持案例的情况下供 Azure 支持访问。These logs are only collected when a system health alert is raised and are only accessed by Azure Support in the context of a support case.

从 Azure Stack Hub 版本 2008 开始,主动收集日志的功能使用改进的算法,即使在操作员看不到的错误情况下也可以捕获日志。Beginning with Azure Stack Hub version 2008, proactive log collection uses an improved algorithm that captures logs even during error conditions that aren't visible to an operator. 这样可以确保在适当的时间收集正确的诊断信息,无需操作员进行任何交互。This makes sure that the right diagnostic info is collected at the right time without needing any operator interaction. 在某些情况下,Azure 支持可以更快地开始故障排除工作并解决问题。Azure support can begin troubleshooting and resolve problems sooner in some cases. 初始算法改进侧重于修补升级操作。Initial algorithm improvements focus on patch and update operations. 建议启用主动收集日志的功能,因为更多的操作已经过优化,好处更多。Enabling proactive log collections is recommended as more operations are optimized and the benefits increase.

随时可以禁用和重新启用主动日志收集。Proactive log collection can be disabled and re-enabled anytime. 按照以下步骤设置主动收集日志功能。Follow these steps to set up proactive log collection.

  1. 登录到 Azure Stack Hub 管理员门户。Sign in to the Azure Stack Hub administrator portal.
  2. 打开“帮助 + 支持概述”。Open Help + support Overview.
  3. 如果出现横幅,请选择“启用主动收集日志功能”。If the banner appears, select Enable proactive log collection. 也可以选择“设置”,将“主动收集日志”设置为“启用”,然后选择“保存” 。Or you can select Settings and set Proactive log collection to Enable, then select Save.

备注

如果为本地文件共享配置了日志位置设置,请确保生命周期管理策略会阻止共享存储达到其容量配额。If log location settings are configured for a local file share, make sure lifecycle management policies will prevent share storage from reaching its size quota. Azure Stack Hub 不会监视本地文件共享或强制执行任何保留策略。Azure Stack Hub does not monitor local file share or enforce any retention policies.

数据处理方式How the data is handled

你同意我们可以仅根据 Azure Stack Hub 系统运行状况警报定期自动收集日志。You agree to periodic automatic log collections by us based only on Azure Stack Hub system health alerts. 你还确认并同意,这些日志可以上传并保留在由 Azure 管理和控制的 Azure 存储帐户中。You also acknowledge and consent to the upload and retention of those logs in an Azure storage account managed and controlled by Azure.

这些数据只用于排查系统运行状况警报问题,在未经你同意的情况下不会用于市场营销、广告或任何其他商业目的。The data will be used only troubleshooting system health alerts and won't be used for marketing, advertising, or any other commercial purposes without your consent. 这些数据最多可保留 90 天,由我们收集的任何数据都会按照我们的标准隐私做法进行处理。The data can be retained for up to 90 days and any data We collect will be handled following our standard privacy practices.

如果你不再同意,则以前在你同意的情况下收集的任何数据都不会受到影响。Any data previously collected with your consent won't be affected by the revocation of your permission.

通过“主动收集日志”方式收集的日志会上传到由 Azure 管理和控制的 Azure 存储帐户中。Logs collected using Proactive log collection are uploaded to an Azure storage account managed and controlled by Azure. 在收到支持案例的情况下,或者是为了改善 Azure Stack Hub 的运行状况,我们可能会访问这些日志。These logs may be accessed by us in the context of a support case and to improve the health of Azure Stack Hub.

主动收集诊断日志时的警报Proactive diagnostic log collection alerts

如果已启用,则当引发以下事件之一时,主动收集日志的功能会上传日志。If enabled, proactive log collection uploads logs when one of the following events is raised.

例如,“更新失败”是一个警报,会触发主动收集诊断日志的操作。For example, Update failed is an alert that triggers proactive diagnostic log collection. 如果启用了主动收集功能,则会在更新失败时主动捕获诊断日志,这样有助于 Azure 支持排查问题。If it's enabled, diagnostic logs are proactively captured during an update failure to help Azure Support troubleshoot the problem. 仅在引发 更新失败 的警报时才收集诊断日志。The diagnostic logs are only collected when the alert for Update failed is raised.

警报标题Alert title FaultIdTypeFaultIdType
无法连接到远程服务Unable to connect to the remote service UsageBridge.NetworkErrorUsageBridge.NetworkError
更新失败Update failed Urp.UpdateFailureUrp.UpdateFailure
存储资源提供程序基础结构/依赖项不可用Storage Resource Provider infrastructure/dependencies not available StorageResourceProviderDependencyUnavailableStorageResourceProviderDependencyUnavailable
节点未连接到控制器Node not connected to controller ServerHostNotConnectedToControllerServerHostNotConnectedToController
路由发布失败Route publication failure SlbMuxRoutePublicationFailureSlbMuxRoutePublicationFailure
存储资源提供程序内部数据存储不可用Storage Resource Provider internal data store unavailable StorageResourceProvider。StorageResourceProvider. DataStoreConnectionFailDataStoreConnectionFail
存储设备发生故障Storage device failure Microsoft.Health.FaultType.VirtualDisks.DetachedMicrosoft.Health.FaultType.VirtualDisks.Detached
运行状况控制器无法访问存储帐户Health controller can't access storage account Microsoft.Health.FaultType.StorageErrorMicrosoft.Health.FaultType.StorageError
与物理磁盘的连接已丢失Connectivity to a physical disk has been lost Microsoft.Health.FaultType.PhysicalDisk.LostCommunicationMicrosoft.Health.FaultType.PhysicalDisk.LostCommunication
Blob 服务未在节点上运行The blob service isn't running on a node StorageService.The.blob.service.is.not.running.on.a.node-CriticalStorageService.The.blob.service.is.not.running.on.a.node-Critical
基础结构角色不正常Infrastructure role unhealthy Microsoft.Health.FaultType.GenericExceptionFaultMicrosoft.Health.FaultType.GenericExceptionFault
表服务错误Table service errors StorageService.Table.service.errors-CriticalStorageService.Table.service.errors-Critical
文件共享已利用超过 80%A file share is over 80% utilized Microsoft.Health.FaultType.FileShare.Capacity.Warning.InfraMicrosoft.Health.FaultType.FileShare.Capacity.Warning.Infra
缩放单元节点已脱机Scale unit node is offline FRP.Heartbeat.PhysicalNodeFRP.Heartbeat.PhysicalNode
基础结构角色实例不可用Infrastructure role instance unavailable FRP.Heartbeat.InfraVMFRP.Heartbeat.InfraVM
基础结构角色实例不可用Infrastructure role instance unavailable FRP.Heartbeat.NonHaVmFRP.Heartbeat.NonHaVm
基础结构角色“目录管理”报告了时间同步错误The infrastructure role, Directory Management, has reported time synchronization errors DirectoryServiceTimeSynchronizationErrorDirectoryServiceTimeSynchronizationError
挂起的外部证书过期Pending external certificate expiration CertificateExpiration.ExternalCert.WarningCertificateExpiration.ExternalCert.Warning
挂起的外部证书过期Pending external certificate expiration CertificateExpiration.ExternalCert.CriticalCertificateExpiration.ExternalCert.Critical
由于内存容量不足,无法针对特定类别和大小预配虚拟机Unable to provision virtual machines for specific class and size due to low memory capacity AzureStack.ComputeController.VmCreationFailure.LowMemoryAzureStack.ComputeController.VmCreationFailure.LowMemory
无法访问节点以供虚拟机放置Node inaccessible for virtual machine placement AzureStack.ComputeController.HostUnresponsiveAzureStack.ComputeController.HostUnresponsive
备份失败Backup failed AzureStack.BackupController.BackupFailedGeneralFaultAzureStack.BackupController.BackupFailedGeneralFault
由于与失败的操作发生冲突,已跳过计划的备份The scheduled backup was skipped due to a conflict with failed operations AzureStack.BackupController.BackupSkippedWithFailedOperationFaultAzureStack.BackupController.BackupSkippedWithFailedOperationFault

立即发送日志Send logs now

提示

通过使用主动发送日志而不是“立即发送日志”来节省时间。Save time by using Send logs proactively instead of Send logs now.

“立即发送日志”是一个选项,通常用于在建立支持案例之前从 Azure Stack Hub 手动收集并上传诊断日志。Send logs now is an option where you manually collect and upload your diagnostic logs from Azure Stack Hub, usually before opening a support case.

可以通过两种方式手动将诊断日志发送到 Azure 支持:There are two ways you can manually send diagnostic logs to Azure Support:

如果 Azure Stack Hub 已连接到 Azure,建议你使用管理员门户,因为这是直接将日志发送给我们的最简单方法。If Azure Stack Hub is connected to Azure, we recommend using the administrator portal because it's the simplest way to send the logs directly to us. 如果该门户不可用,则应改为使用 PowerShell 发送日志。If the portal is unavailable, you should instead send logs using PowerShell.

通过管理员门户立即发送日志Send logs now with the administrator portal

通过管理员门户立即发送日志:To send logs now using the administrator portal:

  1. 打开“帮助 + 支持”>“日志收集”>“立即发送日志”。Open Help + support > Log Collection > Send logs now.
  2. 指定日志收集的开始时间和结束时间。Specify the start time and end time for log collection.
  3. 选择本地时区。Choose the local time zone.
  4. 选择“收集并上传”。Select Collect and Upload.

如果已断开与 Internet 的连接,或者只想在本地保存日志,请使用 Get-AzureStackLog 方法发送日志。If you are disconnected from the internet or want to only save logs locally, use the Get-AzureStackLog method to send logs.

通过 PowerShell 立即发送日志Send logs now with PowerShell

如果使用“立即发送日志”方法并想要使用 PowerShell 而不是管理员门户,则可使用 Send-AzureStackDiagnosticLog cmdlet 来收集和发送特定日志。If you're using the Send logs now method and want to use PowerShell instead of the administrator portal, you can use the Send-AzureStackDiagnosticLog cmdlet to collect and send specific logs.

  • 可以使用 FromDateToDate 参数来收集特定时间段的日志。The FromDate and ToDate parameters can be used to collect logs for a particular time period. 如果未指定这些参数,则默认收集过去四小时的日志。If these parameters aren't specified, logs are collected for the past four hours by default.

  • 使用 FilterByNode 参数按计算机名筛选日志。Use the FilterByNode parameter to filter logs by computer name. 例如:For example:

    Send-AzureStackDiagnosticLog -FilterByNode azs-xrp01
    
  • 使用 FilterByLogType 参数按类型筛选日志。Use the FilterByLogType parameter to filter logs by type. 可以选择按文件、共享或 WindowsEvent 进行筛选。You can choose to filter by File, Share, or WindowsEvent. 例如:For example:

    Send-AzureStackDiagnosticLog -FilterByLogType File
    
  • 使用 FilterByResourceProvider 参数为增值资源提供程序 (RP) 发送诊断日志。Use the FilterByResourceProvider parameter to send diagnostic logs for value-add Resource Providers (RPs). 常规语法为:The general syntax is:

    Send-AzureStackDiagnosticLog -FilterByResourceProvider <<value-add RP name>>
    

    为 SQL RP 发送诊断日志:To send diagnostic logs for SQL RP:

    Send-AzureStackDiagnosticLog -FilterByResourceProvider SQLAdapter
    

    为 MySQL RP 发送诊断日志:To send diagnostic logs for MySQL RP:

    Send-AzureStackDiagnosticLog -FilterByResourceProvider MySQLAdapter
    

    为 IoT 中心发送诊断日志:To send diagnostic logs for IoT Hub:

    Send-AzureStackDiagnosticLog -FilterByResourceProvider IotHub
    

    为事件中心发送诊断日志:To send diagnostic logs for Event Hubs:

    Send-AzureStackDiagnosticLog -FilterByResourceProvider eventhub
    
  • 使用 FilterByRole 参数从 VirtualMachines 和 BareMetal 角色发送诊断日志:Use the FilterByRole parameter to send diagnostic logs from VirtualMachines and BareMetal roles:

    Send-AzureStackDiagnosticLog -FilterByRole VirtualMachines,BareMetal
    
  • 从 VirtualMachines 和 BareMetal 角色发送诊断日志,通过日期筛选功能筛选出过去 8 小时的日志文件:To send diagnostic logs from VirtualMachines and BareMetal roles, with date filtering for log files for the past 8 hours:

    Send-AzureStackDiagnosticLog -FilterByRole VirtualMachines,BareMetal -FromDate (Get-Date).AddHours(-8)
    
  • 从 VirtualMachines 和 BareMetal 角色发送诊断日志,通过日期筛选功能筛选出 8 小时前到 2 小时前这个时间段的日志文件:To send diagnostic logs from VirtualMachines and BareMetal roles, with date filtering for log files for the time period between 8 hours ago and 2 hours ago:

    Send-AzureStackDiagnosticLog -FilterByRole VirtualMachines,BareMetal -FromDate (Get-Date).AddHours(-8) -ToDate (Get-Date).AddHours(-2)
    

备注

如果已断开与 Internet 的连接,或者只想在本地保存日志,请使用 Get-AzureStackLog 方法发送日志。If you are disconnected from the internet or want to only save logs locally, use Get-AzureStackLog method to send logs.

数据处理方式How the data is handled

启动从 Azure Stack Hub 收集诊断日志的操作即表明你确认并同意,这些日志可以上传并保留到 Azure 管理和控制的 Azure 存储帐户中。By initiating diagnostic log collection from Azure Stack Hub, you acknowledge and consent to uploading those logs and retaining them in an Azure storage account managed and controlled by Azure. Azure 支持人员可以通过支持案例立即访问这些日志,而不必与客户联系以收集日志。Azure Support can access these logs right away with the support case without having to engage with the customer for log collection.

在本地保存日志Save logs locally

当 Azure Stack Hub 与 Azure 断开连接时,可以将日志保存到本地服务器消息块 (SMB) 共享。You can save logs to a local Server Message Block (SMB) share when Azure Stack Hub is disconnected from Azure. 在“设置”边栏选项卡中,输入具有共享写入权限的路径、用户名和密码。In the Settings blade, enter the path and a username and password with permission to write to the share. 在支持案例期间,Azure 支持会提供详细步骤来说明如何传输这些本地日志。During a support case, Azure Support will provide detailed steps on how to get these local logs transferred. 如果管理员门户不可用,则可以使用 Get-AzureStackLog 在本地保存日志。If the Administrator portal is unavailable, you can use Get-AzureStackLog to save logs locally.

诊断日志收集选项的屏幕截图

带宽注意事项Bandwidth considerations

进行诊断日志收集时日志的平均大小各不相同,具体取决于它是主动运行还是手动运行。The average size of diagnostic log collection varies based on whether it runs proactively or manually. “主动收集日志”选项对应的日志平均大小约为 2 GB。The average size for Proactive log collection is around 2 GB. “立即发送日志”选项对应的收集大小取决于需要收集多少小时。The collection size for Send logs now depends on how many hours are being collected.

下表列出了在以受限或计量方式连接到 Azure 时的环境注意事项。The following table lists considerations for environments with limited or metered connections to Azure.

网络连接Network connection 影响Impact
低带宽/高延迟连接Low-bandwidth/high-latency connection 完成日志上传的时间会延长。Log upload will take an extended amount of time to complete.
共享连接Shared connection 上传也可能影响共享网络连接的其他应用/用户。The upload may also impact other apps/users sharing the network connection.
计量连接Metered connection ISP 可能会针对你额外使用网络的情况收取额外费用。There may be an additional charge from your ISP for the extra network usage.

查看日志集合View log collection

以往从 Azure Stack Hub 收集的日志显示在“帮助 + 支持”中的“日志收集”页上,其中提供了以下日期和时间 :The history of logs collected from Azure Stack Hub appears on the Log collection page in Help + support, with the following dates and times:

  • 收集的时间:日志收集操作的开始时间。Time Collected: When the log collection operation began.
  • 状态:“正在进行”或“已完成”。Status: Either in progress or complete.
  • 日志开始:要收集日志的时段的开始时间。Logs start: Start of the time period for which you want to collect.
  • 日志结束:收集时段的结束时间。Logs end: End of the time period.
  • 类型:是手动收集日志还是主动收集日志。Type: If it's a manual or proactive log collection.

“帮助 + 支持”中的日志集合

另请参阅See also

Azure Stack Hub 日志和客户数据处理Azure Stack Hub log and customer data handling