将运行 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 并完成迁移。Fail over to Azure and complete the migration.

使用 Azure Migrate 进行迁移Migrate with Azure Migrate

建议使用 Azure Migrate 服务将计算机迁移到 Azure。We recommend that you migrate machines to Azure using the Azure Migrate service.

  • Azure Migrate 是专门为服务器迁移而构建的。Azure Migrate is purpose-built for server migration.
  • Azure Migrate 提供了一个集中式中心,用于发现、评估本地计算机以及将本地计算机迁移到 Azure。Azure Migrate provides a centralized hub for discovery, assessment and migration of on-premises machines to Azure. Azure Site Recovery 应仅用于灾难恢复,而不用于迁移。Azure Site Recovery should be used for disaster recovery only, and not migration.
  • Azure Migrate 支持迁移运行 Windows Server 2008 的服务器。Azure Migrate supports migration of servers running Windows Server 2008.

使用 Site Recovery 进行迁移Migrate with Site Recovery

支持的操作系统Supported operating systems

操作系统Operating System 环境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

警告

  • 不支持迁移运行 Server Core 的服务器。Migration of servers running Server Core is not supported.
  • 确保在迁移前已安装最新的服务包和 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.

  • 复制运行 Windows Server 2008 SP2 的服务器时,不支持应用程序一致性恢复点和多 VM 一致性功能。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.

    提示

    检查此驱动程序是否存在于“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.

    提示

    在迁移服务器之前,强烈建议进行测试性故障转移。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.

入门Get 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. 单击“创建资源” > “监视 + 管理” > “备份和站点恢复(OMS)”。 Click Create a resource > Monitoring + Management > Backup and Site Recovery(OMS).

  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.

警告

确保在复制策略的“应用一致性快照频率”设置中指定“关”。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 Protected items > 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.

    显示完整迁移命令的屏幕截图。

警告

不会取消正在进行的故障转移 :在故障转移开始前,服务器复制已停止。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.