将运行 Windows Server 2008 的服务器迁移到 AzureMigrate servers running Windows Server 2008 to Azure

本教程介绍如何使用 Azure Site Recovery,将运行 Windows Server 2008 或 2008 R2 的本地服务器迁移到 Azure。This tutorial shows you how to migrate on-premises servers running Windows Server 2008 or 2008 R2 to Azure using Azure Site Recovery. 本教程介绍如何执行下列操作:In this tutorial, you learn how to:

  • 准备好要迁移的本地环境Prepare your on-premises environment for migration
  • 设置目标环境Set up the target environment
  • 设置复制策略Set up a replication policy
  • 启用复制Enable replication
  • 运行测试迁移,确保一切按预期正常工作Run a test migration to make sure everything's working as expected
  • 故障转移到 Azure 并完成迁移Failover to Azure and complete the migration

限制和已知问题部分列出了在将 Windows Server 2008 计算机迁移到 Azure 时存在的限制,以及可能遇到的已知问题的解决方法。The limitations and known issues section, lists some of limitations and workarounds for known issues that you may encounter while migrating Windows Server 2008 machines to Azure.

支持的操作系统和环境Supported Operating Systems and environments

操作系统Operating System 本地环境On-premise environment
Windows Server 2008 SP2 - 32 位和 64 位(IA-32 和 x86-64)Windows Server 2008 SP2 - 32 bit and 64 bit(IA-32 and x86-64)
- Standard- Standard
- Enterprise- Enterprise
- Datacenter- Datacenter
VMware VM、Hyper-V VM 和物理服务器VMware VMs, Hyper-V VMs, and Physical Servers
Windows Server 2008 R2 SP1 - 64 位Windows Server 2008 R2 SP1 - 64 bit
- Standard- Standard
- Enterprise- Enterprise
- Datacenter- Datacenter
VMware VM、Hyper-V VM 和物理服务器VMware VMs, Hyper-V VMs, and Physical Servers

Warning

  • 不支持迁移运行 Server Core 的服务器。Migration of servers running Server Core is not supported.
  • 在迁移之前,请确保已安装最新的 Service Pack 和 Windows 更新。Ensure that you have the latest service pack and Windows updates installed before migrating.

先决条件Prerequisites

在开始之前,最好是查看用于 VMware 和物理服务器迁移Hyper-V 虚拟机迁移的 Azure Site Recovery 体系结构Before you start, it's helpful to review the Azure Site Recovery architecture for VMware and Physical server migration or Hyper-V virtual machine migration

若要迁移运行 Windows Server 2008 或 Windows Server 2008 R2 的 Hyper-V 虚拟机,请遵循将本地计算机迁移到 Azure 教程中的步骤。To migrate Hyper-V virtual machines running Windows Server 2008 or Windows Server 2008 R2, follow the steps in the migrate on-premises machines to Azure tutorial.

本教程的余下部分介绍如何迁移运行 Windows Server 2008 或 2008 R2 的本地 VMware 虚拟机和物理服务器。The rest of this tutorial shows you how you can migrate on-premises VMware virtual machines and Physical servers running Windows Server 2008 or 2008 R2.

限制和已知问题Limitations and known issues

  • 用于迁移 Windows Server 2008 SP2 服务器的配置服务器、其他进程服务器和移动服务应运行 9.19.0.0 版或更高版本的 Azure Site Recovery 软件。The Configuration Server, additional process servers, and mobility service used to migrate Windows Server 2008 SP2 servers should be running version 9.19.0.0 or later of the Azure Site Recovery software.

  • 不支持使用应用程序一致性恢复点和多 VM 一致性功能来复制运行 Windows Server 2008 SP2 的服务器。Application consistent recovery points and the multi-VM consistency feature are not supported for replication of servers running Windows Server 2008 SP2. 应将 Windows Server 2008 SP2 服务器迁移到崩溃一致性恢复点。Windows Server 2008 SP2 servers should be migrated to a crash consistent recovery point. 默认情况下,每隔 5 分钟生成崩溃一致性恢复点。Crash consistent recovery points are generated every 5 minutes by default. 由于缺少应用程序一致性恢复点,结合配置的应用程序一致性快照频率使用复制策略会导致应用程序运行状况变得严重。Using a replication policy with a configured application consistent snapshot frequency will cause replication health to turn critical due to the lack of application consistent recovery points. 为避免误报,请将复制策略中的应用程序一致性快照频率设置为“关闭”。To avoid false positives, set the application-consistent snapshot frequency in the replication policy to "Off".

  • 应在要迁移的服务器中安装 .NET Framework 3.5 Service Pack 1,这样才能使移动服务正常工作。The servers being migrated should have .NET Framework 3.5 Service Pack 1 for the mobility service to work.

  • 如果服务器包含动态磁盘,在某些配置中你可能会发现,这些磁盘在故障转移的服务器上已标记为脱机,或显示为外部磁盘。If your server has dynamic disks, you may notice in certain configurations, that these disks on the failed over server are marked offline or shown as foreign disks. 此外还可能发现,不同动态磁盘上的镜像卷的镜像集状态已标记为“故障冗余”。You may also notice that the mirrored set status for mirrored volumes across dynamic disks is marked "Failed redundancy". 可以在 diskmgmt.msc 中通过手动导入并重新激活这些磁盘来解决此问题。You can fix this issue from diskmgmt.msc by manually importing these disks and reactivating them.

  • 要迁移的服务器应有 vmstorfl.sys 驱动程序。The servers being migrated should have the vmstorfl.sys driver. 如果要迁移的服务器中没有该驱动程序,故障转移可能失败。Failover may fail if the driver is not present in the server being migrated.

    Tip

    通过“C:\Windows\system32\drivers\vmstorfl.sys”路径检查是否存在该驱动程序。Check if the driver is present at "C:\Windows\system32\drivers\vmstorfl.sys" . 如果找不到该驱动程序,可以通过就地创建一个虚构文件来解决问题。If the driver is not found, you can workaround the issue by creating a dummy file in place.

    打开命令提示符(单击“运行”并键入 cmd),运行以下命令:“copy nul c:\Windows\system32\drivers\vmstorfl.sys”Open command prompt (run > cmd) and run the following: "copy nul c:\Windows\system32\drivers\vmstorfl.sys"

  • 将运行 32 位操作系统的 Windows Server 2008 SP2 服务器故障转移或测试故障转移到 Azure 之后,可能无法立即通过 RDP 连接到这些服务器。You may be unable to RDP to Windows Server 2008 SP2 servers running the 32-bit operating system immediately after they are failed over or test failed over to Azure. 请在 Azure 门户中重启故障转移的虚拟机,并重试连接。Restart the failed over virtual machine from the Azure portal and try connecting again. 如果仍然无法连接,请检查服务器是否配置为允许远程桌面连接,并确保没有任何防火墙规则或网络安全组阻止连接。If you are still unable to connect, check if the server is configured to allow remote desktop connections, and ensure that there are no firewall rules or network security groups blocking the connection.

    Tip

    在迁移服务器之前,我们强烈建议执行测试故障转移。A test failover is highly recommended before migrating servers. 确保已在每个要迁移的服务器上执行至少一次成功的测试性故障转移。Ensure that you've performed at least one successful test failover on each server that you are migrating. 在执行测试故障转移的过程中,请连接到测试故障转移的计算机,并确保一切符合预期。As part of the test failover, connect to the test failed over machine and ensure things work as expected.

    测试故障转移操作不会造成中断,可帮助你通过在所选的隔离网络中创建虚拟机来测试迁移。The test failover operation is non-disruptive and helps you test migrations by creating virtual machines in an isolated network of your choice. 与故障转移操作不同,在测试故障转移操作期间,数据复制会持续进行。Unlike the failover operation, during the test failover operation, data replication continues to progres. 在准备好迁移之前,可以执行任意次测试故障转移。You can perform as many test failovers as you like before you are ready to migrate.

入门Getting started

执行以下任务,准备好 Azure 订阅和本地 VMware/物理环境:Perform the following tasks to prepare the Azure subscription and on-premises VMware/Physical environment:

  1. 准备 AzurePrepare Azure
  2. 准备本地 VMwarePrepare on-premises VMware

创建恢复服务保管库Create a Recovery Services vault

  1. 登录到 Azure 门户 > 恢复服务Sign in to the Azure portal > Recovery Services.

  2. 单击“创建资源” > “监视 + 管理” > “备份和站点恢复”。Click Create a resource > Monitoring + Management > Backup and Site Recovery.

  3. 在“名称”中,指定友好名称 W2K8-migrationIn Name, specify the friendly name W2K8-migration. 如果有多个订阅,请选择合适的一个。If you have more than one subscription, select the appropriate one.

  4. 创建资源组 w2k8migrateCreate a resource group w2k8migrate.

  5. 指定 Azure 区域。Specify an Azure region. 若要查看受支持的区域,请参阅 Azure Site Recovery 定价详细信息中的“地域可用性”。To check supported regions, see geographic availability in Azure Site Recovery Pricing Details.

  6. 若要从仪表板快速访问保管库,请单击“固定到仪表板”,然后单击“创建”。To quickly access the vault from the dashboard, click Pin to dashboard and then click Create.

    新保管库

新保管库将添加到“仪表板”中的“所有资源”下,以及“恢复服务保管库”主页面上。The new vault is added to the Dashboard under All resources, and on the main Recovery Services vaults page.

准备好要迁移的本地环境Prepare your on-premises environment for migration

设置目标环境Set up the target environment

选择并验证目标资源。Select and verify target resources.

  1. 单击“准备基础结构” > “目标”,然后选择要使用的 Azure 订阅。Click Prepare infrastructure > Target, and select the Azure subscription you want to use.
  2. 指定资源管理器部署模型。Specify the Resource Manager deployment model.
  3. Site Recovery 检查是否有一个或多个兼容的 Azure 存储帐户和网络。Site Recovery checks that you have one or more compatible Azure storage accounts and networks.

设置复制策略Set up a replication policy

  1. 若要创建新的复制策略,请单击“Site Recovery 基础结构” > “复制策略” > “+复制策略”。To create a new replication policy, click Site Recovery infrastructure > Replication Policies > +Replication Policy.
  2. 在“创建复制策略”中指定策略名称。In Create replication policy, specify a policy name.
  3. 在“RPO 阈值”中,指定恢复点目标 (RPO) 限制。In RPO threshold, specify the recovery point objective (RPO) limit. 如果复制 RPO 超过此限制,则会生成警报。An alert is generated if the replication RPO exceeds this limit.
  4. 在“恢复点保留期”中,指定每个恢复点的保留期时长(以小时为单位)。In Recovery point retention, specify how long (in hours) the retention window is for each recovery point. 可以将复制的服务器恢复到此窗口中的任何点。Replicated servers can be recovered to any point in this window. 复制到高级存储的计算机最多支持 24 小时的保留期,复制到标准存储的计算机最多支持 72 小时的保留期。Up to 24 hours retention is supported for machines replicated to premium storage, and 72 hours for standard storage.
  5. 在“应用一致性快照频率”中,指定“关闭”。In App-consistent snapshot frequency, specify Off. 单击“确定”创建该策略。Click OK to create the policy.

此策略自动与配置服务器关联。The policy is automatically associated with the configuration server.

Warning

确保在复制策略的“应用一致性快照频率”设置中指定“关闭”。Ensure that you specify OFF in the App-consistent snapshot frequency setting of the replication policy. 复制运行 Windows Server 2008 的服务器时,仅支持崩溃一致性恢复点。Only crash-consistent recovery points are supported while replicating servers running Windows Server 2008. 为“应用一致性快照频率”指定任何其他值时,由于缺少应用一致性恢复点,会导致服务器的复制运行状况出现严重问题,因此会生成假警报。Specifying any other value for the App-consistent snapshot frequency will result in false alerts by turning replication health of the server critical due to lack of App-consistent recovery points.

创建复制策略

启用复制Enable replication

为要迁移的 Windows Server 2008 SP2/Windows Server 2008 R2 SP1 服务器启用复制Enable replication for the Windows Server 2008 SP2 / Windows Server 2008 R2 SP1 server to be migrated.

添加物理服务器

启用复制

运行测试迁移Run a test migration

初始复制完成并且服务器状态变为“受保护”后,可对服务器复制执行测试故障转移。You can perform a test failover of replicating servers after initial replication completes and the server status turns to Protected.

运行测试故障转移,确保一切如预期正常运行。Run a test failover to Azure, to make sure everything's working as expected.

测试故障转移

迁移到 AzureMigrate to Azure

为想要迁移的计算机运行故障转移。Run a failover for the machines you want to migrate.

  1. 在“设置” > “复制的项”中,单击计算机 >“故障转移”。In Settings > Replicated items click the machine > Failover.

  2. 在“故障转移”中,选择要故障转移到的“恢复点”。In Failover select a Recovery Point to fail over to. 选择最新恢复点。Select the latest recovery point.

  3. 选择“在开始故障转移前关闭计算机”。Select Shut down machine before beginning failover. Site Recovery 在触发故障转移之前会尝试关闭服务器。Site Recovery will attempt to shut down the server before triggering the failover. 即使关机失败,故障转移也仍会继续。Failover continues even if shutdown fails. 可以在“作业”页上跟踪故障转移进度。You can follow the failover progress on the Jobs page.

  4. 检查 Azure VM 是否在 Azure 中按预期显示。Check that the Azure VM appears in Azure as expected.

  5. 在“复制的项”中,右键单击服务器 >“完成迁移”。In Replicated items, right-click the server > Complete Migration. 这样会执行以下操作:This does the following:

    • 完成迁移过程,停止服务器复制,并停止服务器的 Site Recovery 计费。Finishes the migration process, stops replication for the server, and stops Site Recovery billing for the serve.

    • 此步骤清除复制数据。This step cleans up the replication data. 它不删除迁移的 VM。It doesn't delete the migrated VMs.

      完成迁移

Warning

请勿取消正在进行的故障转移:在故障转移开始前,服务器复制已停止。Don't cancel a failover in progress: Server replication is stopped before failover starts. 如果取消正在进行的故障转移,故障转移会停止,但服务器将不继续复制。If you cancel a failover in progress, failover stops, but the server won't continue to replicate.