设置 Azure VM 迁移到 Azure 后的灾难恢复Set up disaster recovery for Azure VMs after migration to Azure

如果已使用 Site Recovery 服务将本地计算机迁移到 Azure VM,请按本文操作。现在,需设置 VM,以便灾难恢复到辅助 Azure 区域。Follow this article if you've migrated on-premises machines to Azure VMs using the Site Recovery service, and you now want to get the VMs set up for disaster recovery to a secondary Azure region. 本文介绍如何确保将 Azure VM 代理安装在迁移的 VM 上,以及如何删除在迁移后不再需要的 Site Recovery 移动服务。The article describes how to ensure that the Azure VM agent is installed on migrated VMs, and how to remove the Site Recovery Mobility service that's no longer needed after migration.

验证迁移Verify migration

设置灾难恢复之前,请确保已按预期完成迁移。Before you set up disaster recovery, make sure that migration has completed as expected. 若要成功完成迁移,在故障转移后,应为要迁移的每台计算机选择“完成迁移” 选项。To complete a migration successfully, after the failover, you should select the Complete Migration option, for each machine you want to migrate.

验证 Azure VM 代理Verify the Azure VM agent

每个 Azure VM 都必须安装 Azure VM 代理Each Azure VM must have the Azure VM agent installed. 为了复制 Azure VM,Site Recovery 会在代理上安装一个扩展。To replicate Azure VMs, Site Recovery installs an extension on the agent.

  • 如果计算机运行 9.7.0.0 或更高版本的 Site Recovery 移动服务,则移动服务会将 Azure VM 代理自动安装在 Windows VM 上。If the machine is running version 9.7.0.0 or later of the Site Recovery Mobility service, the Azure VM agent is automatically installed by the Mobility service on Windows VMs. 在更低版本的移动服务上,需自动安装该代理。On earlier versions of the Mobility service, you need to install the agent automatically.
  • 对于 Linux VM,必须手动安装 Azure VM 代理。仅当迁移计算机上安装的移动服务为 9.6 或更低版本时,才需要安装 Azure VM 代理。For Linux VMs, you must install the Azure VM agent manually.You only need to install the Azure VM agent if the Mobility service installed on the migrated machine is v9.6 or earlier.

在 Windows VM 上安装代理Install the agent on Windows VMs

如果运行的 Site Recovery 移动服务的版本低于 9.7.0.0,或者因有其他需求而必须手动安装代理,则请执行以下操作:If you're running a version of the Site Recovery mobility service earlier than 9.7.0.0, or you have some other need to install the agent manually, do the following:

  1. 确保在 VM 上有管理员权限。Ensure you have admin permissions on the VM.
  2. 下载 VM 代理安装程序Download the VM Agent installer.
  3. 运行安装程序文件。Run the installer file.

验证安装Validate the installation

检查是否已安装代理:To check that the agent is installed:

  1. 在 Azure VM 上的 C:\WindowsAzure\Packages 文件夹中,应看到 WaAppAgent.exe 文件。On the Azure VM, in the C:\WindowsAzure\Packages folder, you should see the WaAppAgent.exe file.
  2. 右键单击该文件,在“属性” 中选择“详细信息” 选项卡。Right-click the file, and in Properties, select the Details tab.
  3. 验证“产品版本” 字段是否显示 2.6.1198.718 或更高版本。Verify that the Product Version field shows 2.6.1198.718 or higher.

详细了解 Windows 的代理安装。Learn more about agent installation for Windows.

在 Linux VM 上安装代理Install the agent on Linux VMs

手动安装 Azure Linux VM 代理,如下所示:Install the Azure Linux VM agent manually as follows:

  1. 确保在计算机上有管理员权限。Make sure you have admin permissions on the machine.
  2. 强烈建议使用分发版包存储库中的 RPM 或 DEB 包安装 Linux VM 代理。We strongly recommend that you install the Linux VM agent using an RPM or a DEB package from your distribution's package repository. 所有认可的分发版提供商会将 Azure Linux 代理包集成到其映像和存储库。All the endorsed distribution providers integrate the Azure Linux agent package into their images and repositories.
    • 强烈建议只通过分发存储库更新代理。We strongly recommend that you update the agent only through a distribution repository.
    • 我们不建议直接从 GitHub 安装 Linux VM 代理并将其更新。We don't recommend installing the Linux VM agent directly from GitHub and updating it.
    • 如果分发没有可用的最新代理,请联系分发支持部门,了解如何安装最新代理。If the latest agent for your distribution is not available, contact distribution support for instructions on how to install it.

验证安装Validate the installation

  1. 运行 ps -e 命令,确保 Azure 代理可在 Linux VM 上运行:Run this command: ps -e to ensure that the Azure agent is running on the Linux VM.
  2. 如果该进程未运行,请使用以下命令进行重启:If the process isn't running, restart it by using the following commands:
    • 对于 Ubuntu:service walinuxagent startFor Ubuntu: service walinuxagent start
    • 对于其他发行版:service waagent startFor other distributions: service waagent start

卸载移动服务Uninstall the Mobility service

  1. 使用以下方法之一从 Azure VM 上手动卸载移动服务。Manually uninstall the Mobility service from the Azure VM, using one of the following methods.
    • 对于 Windows,在控制面板中 >“添加/删除程序” ,卸载“Azure Site Recovery 移动服务/主目标服务器” 。For Windows, in the Control Panel > Add/Remove Programs, uninstall Azure Site Recovery Mobility Service/Master Target server. 在提升的命令提示符下,运行:At an elevated command prompt, run:
      MsiExec.exe /qn /x {275197FC-14FD-4560-A5EB-38217F80CBD1} /L+*V "C:\ProgramData\ASRSetupLogs\UnifiedAgentMSIUninstall.log"
      
    • 对于 Linux,以根用户身份登录。For Linux, sign in as a root user. 在终端中,转到 /user/local/ASR,运行以下命令:In a terminal, go to /user/local/ASR, and run the following command:
      ./uninstall.sh -Y
      
  2. 在配置复制之前,请重新启动 VM。Restart the VM before you configure replication.

后续步骤Next steps

查看故障排除,了解 Azure VM 代理上的 Site Recovery 扩展。Review troubleshooting for the Site Recovery extension on the Azure VM agent. 将 Azure VM 快速复制到次要区域。Quickly replicate an Azure VM to a secondary region.