排查 Hyper-V 到 Azure 的复制和故障转移的问题Troubleshoot Hyper-V to Azure replication and failover

本文介绍在使用 Azure Site Recovery 将本地 Hyper-V VM 复制到 Azure 时可能遇到的常见问题。This article describes common issues that you might come across when replicating on-premises Hyper-V VMs to Azure, using Azure Site Recovery.

启用保护的问题Enable protection issues

如果为 Hyper-V VM 启用保护时遇到问题,请查看以下建议:If you experience issues when you enable protection for Hyper-V VMs, check the following recommendations:

  1. 检查 Hyper-V 主机和 VM 是否符合所有要求和先决条件Check that your Hyper-V hosts and VMs meet all requirements and prerequisites.
  2. 如果 Hyper-V 服务器位于 System Center Virtual Machine Manager (VMM) 云中,请验证是否已准备好 VMM 服务器If Hyper-V servers are located in System Center Virtual Machine Manager (VMM) clouds, verify that you've prepared the VMM server.
  3. 检查 Hyper-V 虚拟机管理服务是否在 Hyper-V 主机上运行。Check that the Hyper-V Virtual Machine Management service is running on Hyper-V hosts.
  4. 检查 VM 的 Hyper-V-VMMS\Admin 登录中显示的问题。Check for issues that appear in the Hyper-V-VMMS\Admin sign in to the VM. 此日志位于“应用程序和服务日志” > “Microsoft” > “Windows”中。This log is located in Applications and Services Logs > Microsoft > Windows.
  5. 在来宾 VM 上,验证 WMI 是否已启用并可访问。On the guest VM, verify that WMI is enabled and accessible.
  6. 在来宾 VM 上,确保运行最新版本的 Integration Services。On the guest VM, ensure that the latest version of Integration Services is running.
    • 检查是否安装了最新版本。Check that you have the latest version.
    • 始终使用最新的 Integration Services。Keep Integration Services up-to-date.

复制问题Replication issues

按如下步骤排查初始和持续复制的问题:Troubleshoot issues with initial and ongoing replication as follows:

  1. 确保运行最新版本的 Site Recovery 服务。Make sure you're running the latest version of Site Recovery services.
  2. 验证复制是否已暂停:Verify whether replication is paused:
    • 在 Hyper-V 管理器控制台中检查 VM 运行状况。Check the VM health status in the Hyper-V Manager console.
    • 如果状态为严重,请右键单击 VM 并选择“复制” > “查看复制运行状况”。If it's critical, right-click the VM > Replication > View Replication Health.
    • 如果复制已暂停,请单击“恢复复制”。 If replication is paused, click Resume Replication.
  3. 检查所需的服务是否正在运行。Check that required services are running. 如果未运行,请将其重启。If they aren't, restart them.
    • 如果在不使用 VMM 的情况下复制 Hyper-V,请检查以下服务是否在 Hyper-V 主机上运行:If you're replicating Hyper-V without VMM, check that these services are running on the Hyper-V host:
      • 虚拟机管理服务Virtual Machine Management service
      • Microsoft Azure 恢复服务代理服务Microsoft Azure Recovery Services Agent service
      • Microsoft Azure Site Recovery 服务Microsoft Azure Site Recovery service
      • WMI 提供程序主机服务WMI Provider Host service
    • 如果在使用 VMM 的环境中进行复制,请检查以下服务是否正在运行:If you're replicating with VMM in the environment, check that these services are running:
      • 在 Hyper-V 主机上,检查虚拟机管理服务、Microsoft Azure 恢复服务代理和 WMI 提供程序主机服务是否正在运行。On the Hyper-V host, check that the Virtual Machine Management service, the Microsoft Azure Recovery Services Agent, and the WMI Provider Host service are running.
      • 在 VMM 服务器上,确保 System Center Virtual Machine Manager 服务正在运行。On the VMM server, ensure that the System Center Virtual Machine Manager Service is running.
  4. 检查 Hyper-V 服务器与 Azure 之间的连接。Check connectivity between the Hyper-V server and Azure. 若要检查连接,请在 Hyper-V 主机上打开任务管理器。To check connectivity, open Task Manager on the Hyper V host. 在“性能”选项卡上,单击“打开资源监视器”。 On the Performance tab, click Open Resource Monitor. 在“网络”选项卡上的“网络活动的进程”中,检查 cbengine.exe 是否正在主动发送大量 (Mb) 数据。 On the Network tab > Process with Network Activity , check whether cbengine.exe is actively sending large volumes (Mbs) of data.
  5. 检查 Hyper-V 主机是否能够连接到 Azure 存储 Blob URL。Check if the Hyper-V hosts can connect to the Azure storage blob URL. 若要检查主机是否可以连接,请选择并检查 cbengine.exeTo check if the hosts can connect, select and check cbengine.exe. 查看“TCP 连接”,以验证主机到 Azure 存储 Blob 的连接。 View TCP Connections to verify connectivity from the host to the Azure storage blob.
  6. 按如下所述检查性能问题。Check performance issues, as described below.

性能问题Performance issues

网络带宽限制可能会影响复制。Network bandwidth limitations can impact replication. 按如下所述排查问题:Troubleshoot issues as follows:

  1. 检查环境中是否存在带宽约束或限制约束。Check if there are bandwidth or throttling constraints in your environment.
  2. 运行部署规划器探查器Run the Deployment Planner profiler.
  3. 运行探查器后,遵循带宽存储方面的建议。After running the profiler, follow the bandwidth and storage recommendations.
  4. 检查数据变动限制Check data churn limitations. 如果发现 VM 上的数据变动率较高,请执行以下操作:If you see high data churn on a VM, do the following:
    • 检查 VM 是否标记为重新同步。Check if your VM is marked for resynchronization.
    • 遵循这些步骤来调查变动的起源。Follow these steps to investigate the source of the churn.
    • 当 HRL 日志文件超过可用磁盘空间的 50% 时,可能会发生数据变动。Churn can occur when the HRL log files exceed 50% of the available disk space. 如果这是问题所在,请为出现问题的所有 VM 预配更多的存储空间。If this is the issue, provision more storage space for all VMs on which the issue occurs.
    • 检查并确认复制未暂停。Check that replication isn't paused. 如果已暂停,则它会继续将更改写入 HRL 文件,从而可能导致其大小增加。If it is, it continues writing the changes to the hrl file, which can contribute to its increased size.

“严重”复制状态问题Critical replication state issues

  1. 若要检查复制运行状况,请连接到本地 Hyper-V 管理器控制台,选择 VM,然后检查运行状况。To check replication health, connect to the on-premises Hyper-V Manager console, select the VM, and verify health.

    复制运行状况

  2. 单击“查看复制运行状况”查看详细信息: Click View Replication Health to see the details:

    • 如果复制已暂停,请右键单击 VM 并选择“复制” > “恢复复制”。If replication is paused, right-click the VM > Replication > Resume replication.
    • 如果 Site Recovery 中配置的 Hyper-V 主机上的某个 VM 要迁移到同一群集中的不同 Hyper-V 主机或迁移到独立计算机,则该 VM 的复制不受影响。If a VM on a Hyper-V host configured in Site Recovery migrates to a different Hyper-V host in the same cluster, or to a standalone machine, replication for the VM isn't impacted. 只需检查新的 Hyper-V 主机是否符合所有先决条件,并已在 Site Recovery 中进行配置。Just check that the new Hyper-V host meets all prerequisites, and is configured in Site Recovery.

应用一致的快照问题App-consistent snapshot issues

应用一致的快照是 VM 内应用程序数据的时间点快照。An app-consistent snapshot is a point-in-time snapshot of the application data inside the VM. 卷影复制服务 (VSS) 确保 VM 上的应用在创建快照时处于一致状态。Volume Shadow Copy Service (VSS) ensures that apps on the VM are in a consistent state when the snapshot is taken. 本部分详细说明可能会出现的一些常见问题。This section details some common issues you might experience.

VSS 在 VM 中失败VSS failing inside the VM

  1. 检查是否已安装并运行最新版本的 Integration Services。Check that the latest version of Integration services is installed and running. 在 Hyper-V 主机上权限提升的 PowerShell 提示符下运行以下命令,检查是否有可用的更新: get-vm | select Name, State, IntegrationServicesStateCheck if an update is available by running the following command from an elevated PowerShell prompt on the Hyper-V host: get-vm | select Name, State, IntegrationServicesState.

  2. 检查 VSS 服务是否正在运行且正常:Check that VSS services are running and healthy:

    • 若要检查服务,请登录到来宾 VM。To check the services, sign in to the guest VM. 然后打开管理员命令提示符,运行以下命令检查所有 VSS 编写器是否正常。Then open an admin command prompt, and run the following commands to check whether all the VSS writers are healthy.
      • Vssadmin list writersVssadmin list writers
      • Vssadmin list shadowsVssadmin list shadows
      • Vssadmin list providersVssadmin list providers
    • 检查输出。Check the output. 如果编写器处于失败状态,请执行以下操作:If writers are in a failed state, do the following:
      • 在 VM 上的应用程序事件日志中检查 VSS 操作错误。Check the application event log on the VM for VSS operation errors.
    • 尝试重启与失败的编写器关联的以下服务:Try restarting these services associated with the failed writer:
      • 卷影复制Volume Shadow Copy
      • Azure Site Recovery VSS 提供程序Azure Site Recovery VSS Provider
    • 执行此操作后,请等待几个小时再查看是否已成功生成应用一致的快照。After you do this, wait for a couple of hours to see if app-consistent snapshots are generated successfully.
    • 最后一招是尝试重新启动 VM。As a last resort try rebooting the VM. 这可能解决服务处于无响应状态的问题。This might resolve services that are in unresponsive state.
  3. 检查 VM 中是否不包含任何动态磁盘。Check you don't have dynamic disks in the VM. 应用一致的快照不支持动态磁盘。THis isn't supported for app-consistent snapshots. 可在磁盘管理 (diskmgmt.msc) 中进行此项检查。You can check in Disk Management (diskmgmt.msc).

    动态磁盘

  4. 检查是否未将 iSCSI 磁盘附加到 VM。Check that you don't have an iSCSI disk attached to the VM. 不支持此操作。This isn't supported.

  5. 检查是否已启用备份服务。Check that the Backup service is enabled. 请在“Hyper-V 设置” > “Integration Services”中验证它是否已启用。Verify that it is enabled in Hyper-V settings > Integration Services.

  6. 确保创建 VSS 快照的应用未发生冲突。Make sure there are no conflicts with apps taking VSS snapshots. 如果多个应用同时尝试创建 VSS 快照,则可能会发生冲突。If multiple apps are trying to take VSS snapshots at the same time conflicts can occur. 例如,某个备份应用在创建 VSS 快照,同时,Site Recovery 也在根据复制策略的计划创建快照。For example, if a Backup app is taking VSS snapshots when Site Recovery is scheduled by your replication policy to take a snapshot.

  7. 检查 VM 是否遇到较高的变动率:Check if the VM is experiencing a high churn rate:

    • 可以使用 Hyper-V 主机上的性能计数器,测量来宾 VM 的每日数据更改率。You can measure the daily data change rate for the guest VMs, using performance counters on Hyper-V host. 若要测量数据更改率,请启用以下计数器。To measure the data change rate, enable the following counter. 聚合所有 VM 磁盘的此值的 5-15 分钟样本,即可得出 VM 变动率。Aggregate a sample of this value across the VM disks for 5-15 minutes, to get the VM churn.
      • 类别:“Hyper-V Virtual Storage Device”Category: "Hyper-V Virtual Storage Device"
      • 计数器:“Write Bytes / Sec”Counter: "Write Bytes / Sec"
      • 根据 VM 或其应用的繁忙程度,此数据变动率将会提高或保持在较高级别。This data churn rate will increase or remain at a high level, depending on how busy the VM or its apps are.
      • 对于 Site Recovery 的标准存储,平均源磁盘数据变动率为 2 MB/秒。The average source disk data churn is 2 MB/s for standard storage for Site Recovery. 了解详细信息Learn more
    • 此外,可以验证存储可伸缩性目标In addition you can verify storage scalability targets.
  8. 如果使用的是基于 Linux 的服务器,请确保在其上启用了应用一致性。Make sure that if you're using a Linux based server, then you have enabled app-consistency on it. 了解详细信息Learn more

  9. 运行部署规划器Run the Deployment Planner.

  10. 查看有关网络存储的建议。Review the recommendations for network and storage.

VSS 在 Hyper-V 主机中失败VSS failing inside the Hyper-V Host

  1. 在事件日志中查找 VSS 错误和建议:Check event logs for VSS errors and recommendations:

    • 在 Hyper-V 主机服务器上,通过“事件查看器” > “应用程序和服务日志” > “Microsoft” > “Windows” > “Hyper-V” > “管理”打开 Hyper-V 管理事件日志。 On the Hyper-V host server, open the Hyper-V Admin event log in Event Viewer > Applications and Services Logs > Microsoft > Windows > Hyper-V > Admin.
    • 检查是否有任何事件指示发生应用一致的快照失败。Verify whether there are any events that indicate app-consistent snapshot failures.
    • 典型的错误消息如下:“Hyper-V 无法为虚拟机 'XYZ' 生成 VSS 快照集:编写器遇到非暂时性错误。A typical error is: "Hyper-V failed to generate VSS snapshot set for virtual machine 'XYZ': The writer experienced a non-transient error. 如果服务无响应,重启 VSS 服务可能会解决问题。”Restarting the VSS service might resolve issues if the service is unresponsive."
  2. 若要为 VM 生成 VSS 快照,请检查 VM 上是否已安装 Hyper-V Integration Services,并已启用备份 (VSS) 集成服务。To generate VSS snapshots for the VM, check that Hyper-V Integration Services are installed on the VM, and that the Backup (VSS) Integration Service is enabled.

    • 确保 Integration Services VSS 服务/守护程序在来宾上运行,并处于“正常”状态。Ensure that the Integration Services VSS service/daemons are running on the guest, and are in an OK state.
    • 可以在 Hyper-V 主机上权限提升的 PowerShell 会话中,使用命令 Get-VMIntegrationService -VMName<VMName>-Name VSS 执行此项检查。也可以登录到来宾 VM 来获取此信息。You can check this from an elevated PowerShell session on the Hyper-V host with command Get-VMIntegrationService -VMName<VMName>-Name VSS You can also get this information by logging into the guest VM. 了解详细信息Learn more.
    • 确保 VM 上的备份/VSS Integration Services 正在运行且处于正常状态。Ensure that the Backup/VSS integration Services on the VM are running and in healthy state. 否则,请重启这些服务,并重启 Hyper-V 主机服务器上的 Hyper-V 卷影复制请求程序服务。If not, restart these services, and the Hyper-V Volume Shadow Copy requestor service on the Hyper-V host server.

常见错误Common errors

错误代码Error code 消息Message 详细信息Details
0x800700EA0x800700EA “Hyper-V 无法为虚拟机生成 VSS 快照集:有更多数据可用。"Hyper-V failed to generate VSS snapshot set for virtual machine: More data is available. (0x800700EA)。(0x800700EA). 如果备份操作正在进行,VSS 快照集生成可能失败。VSS snapshot set generation can fail if backup operation is in progress.

虚拟机的复制操作失败:有更多数据可用。”Replication operation for virtual machine failed: More data is available."
检查是否在 VM 上启用了动态磁盘。Check if your VM has dynamic disk enabled. 不支持此操作。This isn't supported.
0x800700320x80070032 “由于版本与 Hyper-V 预期的版本不匹配,Hyper-V 卷影复制请求程序无法连接到虚拟机 <./VMname>”"Hyper-V Volume Shadow Copy Requestor failed to connect to virtual machine <./VMname> because the version does not match the version expected by Hyper-V 检查是否安装了最新的 Windows 更新。Check if the latest Windows updates are installed.

升级到最新版本的 Integration Services。Upgrade to the latest version of Integration Services.

收集复制日志Collect replication logs

所有 Hyper-V 复制事件都记录在“应用程序和服务日志” > “Microsoft” > “Windows”下的 Hyper-V-VMMS\Admin 日志中。 All Hyper-V replication event are logged in the Hyper-V-VMMS\Admin log, located in Applications and Services Logs > Microsoft > Windows. 此外,可按如下所示为 Hyper-V 虚拟机管理服务启用分析日志:In addition, you can enable an Analytic log for the Hyper-V Virtual Machine Management Service, as follows:

  1. 在事件查看器中显示分析和调试日志。Make the Analytic and Debug logs viewable in the Event Viewer. 若要使日志可用,请在事件查看器中,单击“视图” > “显示分析和调试日志”。 To make the logs available, in the Event Viewer, click View > Show Analytic and Debug Logs.. 分析日志显示在“Hyper-V-VMMS”下。The Analytic log appears under Hyper-V-VMMS.

  2. 在“操作”窗格中,单击“启用日志”。In the Actions pane, click Enable Log.

    启用日志

  3. 启用后,日志将作为“事件跟踪会话”显示在“性能监视器”中的“数据收集器集”下。 After it's enabled, it appears in Performance Monitor , as an Event Trace Session under Data Collector Sets.

  4. 若要查看收集到的信息,请禁用日志,从而停止跟踪会话。To view the collected information, stop the tracing session by disabling the log. 然后保存日志,并再次在事件查看器中打开日志,或使用其他工具根据需要转换日志。Then save the log, and open it again in Event Viewer, or use other tools to convert it as required.

事件日志位置Event log locations

事件日志Event log 详细信息Details
应用程序和服务日志/Microsoft/VirtualMachineManager/服务器/管理 (VMM 服务器)Applications and Service Logs/Microsoft/VirtualMachineManager/Server/Admin (VMM server) 用于排查 VMM 问题的日志。Logs to troubleshoot VMM issues.
Applications and Service Logs/MicrosoftAzureRecoveryServices/Replication (Hyper-V 主机)Applications and Service Logs/MicrosoftAzureRecoveryServices/Replication (Hyper-V host) 用于排查 Microsoft Azure 恢复服务代理问题的日志。Logs to troubleshoot Microsoft Azure Recovery Services Agent issues.
Applications and Service Logs/Microsoft/Azure Site Recovery/Provider/Operational (Hyper-V 主机)Applications and Service Logs/Microsoft/Azure Site Recovery/Provider/Operational (Hyper-V host) 用于排查 Azure Site Recovery 服务问题的日志。Logs to troubleshoot Azure Site Recovery Service issues.
Applications and Service Logs/Microsoft/Windows/Hyper-V-VMMS/Admin (Hyper-V 主机)Applications and Service Logs/Microsoft/Windows/Hyper-V-VMMS/Admin (Hyper-V host) 用于排查 Hyper-V VM 管理问题的日志。Logs to troubleshoot Hyper-V VM management issues.

用于高级故障排除的日志集合Log collection for advanced troubleshooting

以下工具可帮助进行高级故障排除:These tools can help with advanced troubleshooting: