使用 Azure Site Recovery 迁移到高级存储Migrate to Premium Storage by using Azure Site Recovery

Azure 高级 SSD 为运行 I/O 密集型工作负荷的虚拟机 (VM) 提供高性能、低延迟的磁盘支持。Azure premium SSDs delivers high-performance, low-latency disk support for virtual machines (VMs) that are running I/O-intensive workloads. 本指南帮助用户使用 Azure Site Recovery 将其 VM 磁盘从标准存储帐户迁移到高级存储帐户。This guide helps you migrate your VM disks from a standard storage account to a premium storage account by using Azure Site Recovery.

Site Recovery 是一个 Azure 服务,可通过协调从本地物理服务器和 VM 到云 (Azure) 或辅助数据中心的复制,来为业务连续性和灾难恢复策略提供辅助。Site Recovery is an Azure service that contributes to your strategy for business continuity and disaster recovery by orchestrating the replication of on-premises physical servers and VMs to the cloud (Azure) or to a secondary datacenter. 当主要位置发生故障时,可以故障转移到辅助位置,使应用程序和工作负荷保持可用。When outages occur in your primary location, you fail over to the secondary location to keep applications and workloads available. 当主要位置恢复正常时,可以故障转移回到主要位置。You fail back to your primary location when it returns to normal operation.

Site Recovery 提供测试故障转移,既能支持灾难恢复练习,又不会影响生产环境。Site Recovery provides test failovers to support disaster recovery drills without affecting production environments. 可针对意外灾难以最低的数据丢失程度(取决于复制频率)运行故障转移。You can run failovers with minimal data loss (depending on replication frequency) for unexpected disasters. 在迁移到高级存储的方案中,可以使用 Site Recovery 中的故障转移,将目标磁盘迁移到高级存储帐户。In the scenario of migrating to Premium Storage, you can use the failover in Site Recovery to migrate target disks to a premium storage account.

之所以建议使用 Site Recovery 迁移到高级存储,是因为此选项造成的停机时间最短。We recommend migrating to Premium Storage by using Site Recovery because this option provides minimal downtime. 它还可以避免手动复制磁盘和创建新 VM。This option also avoids the manual execution of copying disks and creating new VMs. 在故障转移过程中,Site Recovery 系统性地复制磁盘并创建新的 VM。Site Recovery will systematically copy your disks and create new VMs during failover.

Site Recovery 支持多种类型的、停机时间极短或不造成停机的故障转移。Site Recovery supports a number of types of failover with minimal or no downtime. 若要规划停机时间和评估数据丢失情况,请参阅 Site Recovery 中的故障转移类型To plan your downtime and estimate data loss, see the types of failover in Site Recovery. 如果已准备好在故障转移后连接到 Azure VM,应该能够在故障转移后使用 RDP 连接到 Azure VM。If you prepare to connect to Azure VMs after failover, you should be able to connect to the Azure VM by using RDP after failover.


Azure Site Recovery 组件Azure Site Recovery components

这些是与此迁移方案相关的 Site Recovery 组件。These Site Recovery components are relevant to this migration scenario:

  • 配置服务器 是用于协调通信以及管理数据复制和恢复过程的 Azure VM。Configuration server is an Azure VM that coordinates communication and manages data replication and recovery processes. 在此 VM 上运行单个安装程序文件来安装配置服务器,以及一个称作进程服务器、用作复制网关的附加组件。On this VM, you run a single setup file to install the configuration server and an additional component, called a process server, as a replication gateway. 请阅读配置服务器必备组件Read about configuration server prerequisites. 配置服务器只需设置一次,在迁移到同一区域的所有过程中都可以使用它。You set up the configuration server only once, and you can use it for all migrations to the same region.

  • 进程服务器是一种复制网关,其职能包括:Process server is a replication gateway that:

    1. 接收来自源 VM 的复制数据。Receives replication data from source VMs.
    2. 通过缓存、压缩和解密来优化数据。Optimizes the data with caching, compression, and encryption.
    3. 向存储帐户发送数据。Sends the data to a storage account.

    它还处理从移动服务到源 VM 的推送安装,执行源 VM 的自动发现。It also handles push installation of the mobility service to source VMs and performs automatic discovery of source VMs. 默认的进程服务器安装在配置服务器上。The default process server is installed on the configuration server. 可以部署更多的独立进程服务器以扩展部署。You can deploy additional standalone process servers to scale your deployment. 请阅读进程服务器部署的最佳做法部署其他进程服务器Read about best practices for process server deployment and deploying additional process servers. 进程服务器只需配置一次,在迁移到同一区域的所有过程中都可以使用它。You set up the process server only once, and you can use it for all migrations to the same region.

  • 移动服务是在想要复制的每个标准 VM 上部署的组件。Mobility service is a component that is deployed on every standard VM that you want to replicate. 它可以捕获标准 VM 上的数据写入,并将其转发到进程服务器。It captures data writes on the standard VM and forwards them to the process server. 阅读复制的计算机先决条件Read about replicated machine prerequisites.

此图显示了这些组件的交互方式:This graphic shows how these components interact:

Site Recovery 组件的交互


Site Recovery 不支持迁移存储空间磁盘。Site Recovery does not support the migration of Storage Spaces disks.

有关其他方案的其他组件,请参阅方案体系结构For additional components for other scenarios, see Scenario architecture.

Azure 概要Azure essentials

这些是此迁移方案的 Azure 要求:These are the Azure requirements for this migration scenario:

  • Azure 订阅。An Azure subscription.
  • 用于存储复制数据的 Azure 高级存储帐户。An Azure premium storage account to store replicated data.
  • 故障转移时创建的 VM 要连接到的 Azure 虚拟网络。An Azure virtual network to which VMs will connect when they're created at failover. Azure 虚拟网络必须位于 Site Recovery 运行所在的同一区域。The Azure virtual network must be in the same region as the one in which Site Recovery runs.
  • 存储复制日志的 Azure 标准存储帐户。An Azure standard storage account to store replication logs. 可以是要迁移的 VM 磁盘的同一存储帐户。This can be the same storage account for the VM disks that are being migrated.


设置和迁移步骤Setup and migration steps

可以使用 Site Recovery 在区域之间或者在同一区域内部迁移 Azure IaaS VM。You can use Site Recovery to migrate Azure IaaS VMs between regions or within same region. 以下说明是在将 VMware VM 或物理服务器复制到 Azure 一文的基础上,专门针对此迁移方案编写的。The following instructions are tailored for this migration scenario from the article Replicate VMware VMs or physical servers to Azure. 除了本文中所述的说明以外,请单击相关的链接了解详细步骤。Please follow the links for detailed steps in addition to the instructions in this article.

步骤 1:创建恢复服务保管库Step 1: Create a Recovery Services vault

  1. 打开 Azure 门户Open the Azure portal.
  2. 选择“创建资源” > “管理” > “备份和 Site Recovery (OMS)” 。Select Create a resource > Management > Backup and Site Recovery (OMS). 或者,可以选择“浏览” > “恢复服务保管库” > “添加” 。Alternatively, you can select Browse > Recovery Services Vault > Add.
  3. 指定将 VM 复制到的区域。Specify a region that VMs will be replicated to. 若要在同一区域中迁移,请选择源 VM 和源存储帐户所在的区域。For the purpose of migration in the same region, select the region where your source VMs and source storage accounts are.

步骤 2:选择保护目标Step 2: Choose your protection goals

  1. 在想要安装配置服务器的 VM 上,打开 Azure 门户On the VM where you want to install the configuration server, open the Azure portal.

  2. 转到“恢复服务保管库” > “设置” > “Site Recovery” > 步骤 1: 准备基础结构” > “保护目标”。Go to Recovery Services vaults > Settings > Site Recovery > Step 1: Prepare Infrastructure > Protection goal.


  3. 在“保护目标”下,从第一个下拉列表中选择“到 Azure”。 Under Protection goal, in the first drop-down list, select To Azure. 在第二个下拉列表中,选择“未虚拟化/其他”,并选择“确定” 。In the second drop-down list, select Not virtualized / Other, and then select OK.


步骤 3:设置源环境(配置服务器)Step 3: Set up the source environment (configuration server)

  1. 转到“准备基础结构” > “准备源” > “添加服务器”窗格,下载 Azure Site Recovery 统一安装程序和保管库注册密钥 。Download Azure Site Recovery Unified Setup and the vault registration key by going to the Prepare infrastructure > Prepare source > Add Server panes.

    需要使用保管库注册密钥来运行统一安装程序。You will need the vault registration key to run the unified setup. 生成的密钥有效期为 5 天。The key is valid for five days after you generate it.


  2. 在“添加服务器”窗格中添加配置服务器。In the Add Server pane, add a configuration server.


  3. 在用作配置服务器的 VM 上,运行统一安装程序以安装配置服务器和进程服务器。On the VM that you're using as the configuration server, run Unified Setup to install the configuration server and the process server. 可以参考提供的屏幕截图逐步完成安装You can walk through the screenshots to complete the installation. 可以参考以下屏幕截图了解针对此迁移方案指定的步骤。You can refer to the following screenshots for steps specified for this migration scenario.

    1. 在“开始之前”中,选择“安装配置服务器和进程服务器” 。In Before You Begin, select Install the configuration server and process server.


    2. 在“注册”中,通过浏览查找并选择从保管库下载的注册密钥。In Registration, browse and select the registration key that you downloaded from the vault.


    3. 在“环境详细信息”中,选择是否要复制 VMware VM。In Environment Details, select whether you're going to replicate VMware VMs. 对于此迁移方案,请选择“否”。For this migration scenario, choose No.


  4. 安装完成后,请在“Azure Site Recovery 配置服务器”窗口中执行以下操作:After the installation is complete, do the following in the Azure Site Recovery Configuration Server window:

    1. 使用“管理帐户”选项卡创建可供 Site Recovery 用于执行自动发现的帐户。Use the Manage Accounts tab to create the account that Site Recovery can use for automatic discovery. (在保护物理计算机的相关方案中,没有必要设置帐户,但至少要有一个帐户才能启用以下步骤之一。(In the scenario about protecting physical machines, setting up the account isn't relevant, but you need at least one account to enable one of the following steps. 在此情况下,可以指定任意帐户和密码。)In this case, you can name the account and password as any.)

    2. 使用“保管库注册”选项卡上上传保管库凭据文件。Use the Vault Registration tab to upload the vault credential file.


步骤 4:设置目标环境Step 4: Set up the target environment

选择“准备基础结构” > “目标”,并指定要在故障转移后用于 VM 的部署模型 。Select Prepare infrastructure > Target, and specify the deployment model that you want to use for VMs after failover. 可以根据方案选择“经典”或“Resource Manager”。 You can choose Classic or Resource Manager, depending on your scenario.


Site Recovery 会检查是否有一个或多个兼容的 Azure 存储帐户和网络。Site Recovery checks that you have one or more compatible Azure storage accounts and networks.


如果使用高级存储帐户保存复制的数据,则需要设置附加的标准存储帐户来存储复制日志。If you're using a premium storage account for replicated data, you need to set up an additional standard storage account to store replication logs.

步骤 5:设置复制设置Step 5: Set up replication settings

要验证配置服务器是否已成功与创建的复制策略相关联,请遵循设置复制设置To verify that your configuration server is successfully associated with the replication policy that you create, follow Set up replication settings.

步骤 6:规划容量Step 6: Plan capacity

  1. 使用 Capacity Planner 根据复制需要准确估算网络带宽、存储和其他要求。Use the capacity planner to accurately estimate network bandwidth, storage, and other requirements to meet your replication needs.

  2. 完成后,请在“是否已完成容量规划?”中选择“是,已完成” 。When you're done, select Yes, I have done it in Have you completed capacity planning?.


步骤 7:安装移动服务并启用复制Step 7: Install the mobility service and enable replication

  1. 可以选择向源 VM 执行推送安装,或者在源 VM 上手动安装移动服务You can choose to push installation to your source VMs or to manually install the mobility service on your source VMs. 可在提供的链接中找到推送安装的要求以及手动安装程序的路径。You can find the requirement of pushing installation and the path of the manual installer in the provided link. 如果执行手动安装,可能需要使用内部 IP 地址来查找配置服务器。If you're doing a manual installation, you might need to use an internal IP address to find the configuration server.


    故障转移 VM 包含两个临时磁盘:一个磁盘来自主 VM,另一个磁盘是在恢复区域中预配 VM 期间创建的。The failed-over VM will have two temporary disks: one from the primary VM and the other created during the provisioning of the VM in the recovery region. 若要在复制之前排除临时磁盘,请在启用复制之前安装移动服务。To exclude the temporary disk before replication, install the mobility service before you enable replication. 若要详细了解如何排除临时磁盘,请参阅从复制中排除磁盘To learn more about how to exclude the temporary disk, see Exclude disks from replication.

  2. 请按如下所述启用复制:Enable replication as follows:

    1. 选择“复制应用程序” > “源” 。Select Replicate Application > Source. 首次启用复制后,请在保管库中选择“+复制”,对其他计算机启用复制。After you've enabled replication for the first time, select +Replicate in the vault to enable replication for additional machines.
    2. 在步骤 1 中,将“源”设置为进程服务器。In step 1, set up Source as your process server.
    3. 在步骤 2 中,指定故障转移后的部署模型、要迁移到的高级存储帐户、用于保存日志的标准存储帐户,以及要故障转移到的虚拟网络。In step 2, specify the post-failover deployment model, a premium storage account to migrate to, a standard storage account to save logs, and a virtual network to fail to.
    4. 在步骤 3 中,按 IP 地址添加受保护的 VM。In step 3, add protected VMs by IP address. (要找到它们可能需要用到内部 IP 地址。)(You might need an internal IP address to find them.)
    5. 在步骤 4 中,通过选择前面在进程服务器上设置的帐户来配置属性。In step 4, configure the properties by selecting the accounts that you set up previously on the process server.
    6. 在步骤 5 中,选择前面在“步骤 5:设置复制设置”中创建的复制策略。In step 5, choose the replication policy that you created previously in "Step 5: Set up replication settings."
    7. 选择“确定”。Select OK.


    解除分配并再次启动 Azure VM 后,无法保证它会获得相同的 IP 地址。When an Azure VM is deallocated and started again, there is no guarantee that it will get the same IP address. 如果配置服务器/进程服务器或受保护 Azure VM 的 IP 地址发生变化,此方案中的复制可能无法正常工作。If the IP address of the configuration server/process server or the protected Azure VMs changes, the replication in this scenario might not work correctly.


设计 Azure 存储环境时,我们建议针对可用性集中的每个 VM 使用不同的存储帐户。When you design your Azure Storage environment, we recommend that you use separate storage accounts for each VM in an availability set. 我们建议按照存储层中的最佳做法为每个可用性集使用多个存储帐户We recommend that you follow the best practice in the storage layer to use multiple storage accounts for each availability set. 将 VM 磁盘分配到多个存储帐户有助于改善存储可用性,以及在整个 Azure 存储基础结构中分配 I/O。Distributing VM disks to multiple storage accounts helps to improve storage availability and distributes the I/O across the Azure storage infrastructure.

如果 VM 位于可用性集中,我们强烈建议分多次迁移多个 VM,而不要将所有 VM 的磁盘都复制到一个存储帐户。If your VMs are in an availability set, instead of replicating disks of all VMs into one storage account, we highly recommend migrating multiple VMs multiple times. 这是为了避免同一个可用性集中的 VM 共享单个存储帐户。That way, the VMs in the same availability set do not share a single storage account. 使用“启用复制”窗格为每个 VM 设置目标存储帐户,一次设置一个。Use the Enable Replication pane to set up a destination storage account for each VM, one at a time.

可以根据需要选择故障转移后的部署模型。You can choose a post-failover deployment model according to your need. 如果选择 Azure 资源管理器作为故障转移后的部署模型,则可将一个 VM(资源管理器)故障转移至另一个 VM(资源管理器),或将一个 VM(经典版)故障转移至一个 VM(资源管理器)。If you choose Azure Resource Manager as your post-failover deployment model, you can fail over a VM (Resource Manager) to a VM (Resource Manager), or you can fail over a VM (classic) to a VM (Resource Manager).

步骤 8:运行测试故障转移Step 8: Run a test failover

要检查复制是否完成,请选择“Site Recovery”实例,并单击“设置” > “已复制的项” 。To check whether your replication is complete, select your Site Recovery instance and then select Settings > Replicated Items. 此时显示复制过程的状态和完成百分比。You will see the status and percentage of your replication process.

初始复制完成后,请运行测试故障转移来验证复制策略。After initial replication is complete, run a test failover to validate your replication strategy. 有关测试故障转移的详细步骤,请参阅 在 Site Recovery 中运行测试故障转移For detailed steps of a test failover, see Run a test failover in Site Recovery.


运行故障转移之前,请确保 VM 和复制策略满足要求。Before you run any failover, make sure that your VMs and replication strategy meet the requirements. 有关运行测试故障转移的详细信息,请阅读在 Site Recovery 中执行到 Azure 的测试故障转移For more information about running a test failover, see Test failover to Azure in Site Recovery.

可在“设置” > “作业” > “YOUR_FAILOVER_PLAN_NAME”中查看测试故障转移的状态 。You can see the status of your test failover in Settings > Jobs > YOUR_FAILOVER_PLAN_NAME. 在窗格中,可以看到具体的步骤,以及成功/失败结果。In the pane, you can see a breakdown of the steps and success/failure results. 如果测试故障转移在执行任一步骤时失败,请选择该步骤查看错误消息。If the test failover fails at any step, select the step to check the error message.

步骤 9:运行故障转移Step 9: Run a failover

完成测试故障转移后,请运行故障转移,将磁盘迁移到高级存储并复制 VM 实例。After the test failover is completed, run a failover to migrate your disks to Premium Storage and replicate the VM instances. 请遵循运行故障转移中的详细步骤。Follow the detailed steps in Run a failover.

请务必选择“关闭 VM 并同步最新数据”。Be sure to select Shut down VMs and synchronize the latest data. 此操作将指定 Site Recovery 应尝试关闭受保护的 VM 并同步数据,以便对最新版的数据进行故障转移。This option specifies that Site Recovery should try to shut down the protected VMs and synchronize the data so that the latest version of the data will be failed over. 如果不选择此选项或尝试不成功,系统将从 VM 的最近恢复点开始故障转移。If you don't select this option or the attempt doesn't succeed, the failover will be from the latest available recovery point for the VM.

Site Recovery 会创建类型与支持高级存储的 VM 相同或类似的 VM 实例。Site Recovery will create a VM instance whose type is the same as or similar to a Premium Storage-capable VM. 可以参阅 Windows 虚拟机定价Linux 虚拟机定价了解各种 VM 实例的性能和价格。You can check the performance and price of various VM instances by going to Windows Virtual Machines Pricing or Linux Virtual Machines Pricing.

迁移后的步骤Post-migration steps

  1. 将复制的 VM 配置到可用性集(如果适用)Configure replicated VMs to the availability set if applicable. Site Recovery 不支持连同可用性集一起迁移 VM。Site Recovery does not support migrating VMs along with the availability set. 根据复制的 VM 的部署,执行以下操作之一:Depending on the deployment of your replicated VM, do one of the following:

    • 对于通过经典部署模型创建的 VM:将 VM 添加到 Azure 门户中的可用性集。For a VM created through the classic deployment model: Add the VM to the availability set in the Azure portal. 有关详细步骤,请参阅将现有虚拟机添加到可用性集For detailed steps, go to Add an existing virtual machine to an availability set.
    • 对于通过资源管理器部署模型创建的 VM:保存 VM 的配置,并在可用性集中删除并再重新创建 VM。For a VM created through the Resource Manager deployment model: Save your configuration of the VM and then delete and re-create the VMs in the availability set. 为此,请使用 Set Azure Resource Manager VM Availability Set(设置 Azure Resource Manager VM 可用性集)中所述的脚本。To do so, use the script at Set Azure Resource Manager VM Availability Set. 运行此脚本之前,请检查其自身的限制并规划停机时间。Before you run this script, check its limitations and plan your downtime.
  2. 删除旧 VM 和磁盘Delete old VMs and disks. 请确保高级磁盘与源磁盘一致,并且新 VM 执行的功能与源 VM 相同。Make sure that the Premium disks are consistent with source disks and that the new VMs perform the same function as the source VMs. 通过 Azure 门户删除源存储帐户中的 VM 和磁盘。Delete the VM and delete the disks from your source storage accounts in the Azure portal. 如果出现了即使删除 VM 也无法删除磁盘的问题,请参阅排查存储资源删除错误If there's a problem in which the disk is not deleted even though you deleted the VM, see Troubleshoot storage resource deletion errors.

  3. 清理 Azure Site Recovery 基础结构Clean the Azure Site Recovery infrastructure. 如果不再需要 Site Recovery,可清理其基础结构。If Site Recovery is no longer needed, you can clean its infrastructure. 删除复制的项、配置服务器和恢复策略,然后删除 Azure Site Recovery 保管库。Delete replicated items, the configuration server, and the recovery policy, and then delete the Azure Site Recovery vault.


后续步骤Next steps

有关虚拟机迁移的特定方案,请参阅以下资源:For specific scenarios for migrating virtual machines, see the following resources:

另请参阅以下资源,深入了解 Azure 存储和 Azure 虚拟机:Also, see the following resources to learn more about Azure Storage and Azure Virtual Machines: