您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

跨区域 (资源组中移动资源) Move resources across regions (from resource group)

本文介绍如何将特定资源组中的资源移到其他 Azure 区域。In this article, learn how to move resources in a specific resource group to a different Azure region. 在资源组中,选择要移动的资源。In the resource group, you select the resources you want to move. 然后,使用 Azure 资源移动器移动它们。Then, you move them using Azure Resource Mover.

重要

Azure 资源转移器目前提供公共预览版。Azure Resource Mover is currently in public preview.

先决条件Prerequisites

  • 需要对要移动的资源所在的订阅 拥有所有者 访问权限。You need Owner access on the subscription in which resources you want to move are located.
    • 第一次在 Azure 订阅中添加特定源和目标映射的资源时,资源移动器会创建一个 系统分配的托管标识 , (以前称为托管服务标识订阅所信任的 (MSI) # A3。The first time you add a resource for a specific source and destination mapping in an Azure subscription, Resource Mover creates a system-assigned managed identity (formerly known as Managed Service Identify (MSI)) that's trusted by the subscription.
    • 若要创建标识,并为其分配所需的角色(来源订阅中的参与者或用户访问管理员),用于添加资源的帐户需要对订阅的“所有者”权限。To create the identity, and to assign it the required role (Contributor or User Access administrator in the source subscription), the account you use to add resources needs Owner permissions on the subscription. 详细了解 Azure 角色。Learn more about Azure roles.
  • 订阅需要足够的配额才能在目标区域中创建源资源。The subscription needs enough quota to create the source resources in the target region. 如果不是,则请求额外的限制。If it doesn't, request additional limits. 了解详细信息Learn more.
  • 验证与要将 VM 移动到的目标区域关联的定价和费用。Verify pricing and charges associated with the target region to which you're moving VMs. 请使用定价计算器来帮助你。Use the pricing calculator to help you.
  • 检查资源移动器是否支持你想要移动的资源:Check that the resources you want to move are supported by Resource Mover:
    • Azure VM 和关联的磁盘Azure VMs and associated disks
    • NICNICs
    • 可用性集Availability sets
    • Azure 虚拟网络Azure virtual networks
    • 公共 IP 地址Public IP addresses
    • 网络安全组 (NSG):Network security groups (NSGs)
    • 内部和公共负载均衡器Internal and public load balancers
    • Azure SQL 数据库和弹性池Azure SQL databases and elastic pools

检查 VM 要求Check VM requirements

  1. 检查要移动的 VM 是否受支持。Check that the VMs you want to move are supported.

  2. 请确保 Vm 具有最新的受信任根证书和更新的证书吊销列表 (CRL) 。Make sure VMs have the latest trusted root certificates and an updated certificate revocation list (CRL).

    • 在运行 Windows 的 Azure Vm 上,安装最新的 Windows 更新。On Azure VMs running Windows, install the latest Windows updates.
    • 在运行 Linux 的 Vm 上,按照 Linux 分发程序指南确保计算机具有最新的证书和 CRL。On VMs running Linux, follow the Linux distributor guidance to ensure the machine has the latest certificates and CRL.
  3. 允许来自 VM 的出站连接:Allow outbound connectivity from VMs:

    • 如果使用基于 URL 的防火墙代理来控制出站连接,请允许访问以下 URLIf you're using a URL-based firewall proxy to control outbound connectivity, allow access to these URLs
    • 如果使用网络安全组 (NSG) 规则来控制出站连接,请创建这些服务标记规则If you're using network security group (NSG) rules to control outbound connectivity, create these service tag rules.

选择要移动的资源Select resources to move

选择要移动的资源。Select resources you want to move. 将资源移动到源区域订阅中的目标区域。You move resources to a target region in the source region subscription. 如果要更改订阅,可以在移动资源后进行更改。If you want to change the subscription, you can do that after the resources are moved.

备注

请勿选择关联的磁盘,否则操作将失败。Don't select associated disks or the operation will fail. 关联的磁盘自动包含在 VM 移动中。Associated disks are automatically included in a VM move.

  1. 在 Azure 门户中,打开相关的资源组。In the Azure portal, open the relevant resource group.

  2. 在 "资源组" 页中,选择要移动的资源。In the resource group page, select the resources that you want to move.

  3. 选择 "移动 > 到另一个区域"。Select Move > Move to another region.

    用于将资源移到其他区域的选择

  4. 在 " 源 + 目标" 中,选择要将资源移动到的目标区域。In Source + destination, select the target region to which you want to move the resources. 然后,选择“下一步”。Then select Next.

    用于选择目标区域的源和目标页

  5. 要移动的资源 中,选择 " 下一步"。In Resources to move, select Next.

  6. 在 " 选择资源" 中,选择要移动的资源。In Select resources, select resource you want to move. 只能添加支持移动的资源。You can only add resources supported for move. 然后选择“完成”。Then select Done.

  7. 在 " 移动资源" 中,选择 " 下一步"。In Move resources, select Next.

  8. 评审 + Add 中,检查源和目标的详细信息。In Review + Add, check the source and target details.

  9. 确认你了解有关要移动的资源的元数据将存储在为此目的而创建的资源组中,并允许资源移动器创建系统管理的标识来访问订阅资源。Confirm that you understand that metadata about the resources being moved will be stored in a resource group created for this purpose, and that you allow Resource Mover to create a system-managed identity to access the subscription resources.

  10. 选择 " 继续 " 开始添加资源。Select Proceed to begin adding the resources.

    用于检查详细信息并继续移动的 "摘要" 页

  11. 添加资源操作将启动。The add resource operation starts. 操作完成后,通知会显示已添加的资源,部署已成功。When the operation completes, the notifications show that resources were added, and deployment succeeded.

  12. 在通知中,选择 " 添加要移动的资源"。In the notifications, select Adding resources for move.

    通知中显示的消息

  13. 选择通知后,你选择的资源将添加到 Azure 资源移动器中心的移动集合。After selecting the notification, the resources you selected are added to a move collection in the Azure Resource Mover hub. 资源移动器可帮助您检查依赖关系,并开始将资源移动到目标区域。Resource Mover helps you to check dependencies, and then start moving resources to the target region.

解决依赖项问题Resolve dependencies

正在移动的资源显示在 " 跨区域 " 页中的 " 准备挂起 " 状态。Resources you're moving appear in the Across regions page, in a Prepare pending state. 开始验证,如下所示:Start validation as follows:

  1. 如果资源在 "问题" 列中显示 "验证依赖项" 消息,请选择 "验证依赖项" 按钮。If resources show a Validate dependencies message in the Issues column, select the Validate dependencies button. 验证过程开始。The validation process begins.

    用于验证依赖项的按钮

  2. 如果找到了依赖项,请选择 " 添加依赖关系"。If dependencies are found, select Add dependencies.

  3. 在“添加依赖项”中,选择从属资源 >”添加依赖项” 。In Add dependencies, select the dependent resources > Add dependencies. 在通知中监视进度。Monitor progress in the notifications.

    添加依赖项的按钮

  4. 根据需要添加其他依赖关系,并根据需要验证依赖关系。Add additional dependencies if needed, and validate dependencies as needed. 选择 " 刷新 " 以确保资源显示最新状态。Select Refresh to ensure resources show an up-to-date state.

  5. 在“跨区域”页上,验证资源现在是否处于“准备挂起”状态,且没有任何问题。On the Across regions page, verify that resources are now in a Prepare pending state, with no issues.

    显示所有资源的准备挂起状态的页面

移动源资源组Move the source resource group

在准备和移动资源之前,源资源组必须存在于目标区域中。Before you can prepare and move resources, the source resource group must be present in the target region.

准备以移动源资源组Prepare to move the source resource group

按如下所示准备:Prepare as follows:

  1. 在“跨区域”中,选择源资源组 >“准备” 。In Across regions, select the source resource group > Prepare.

  2. 在 " 准备资源" 中,选择 " 准备"。In Prepare resources, select Prepare.

  3. 用于准备源资源组的按钮

    在准备过程中,资源转移器使用资源组设置生成 Azure 资源管理器 (ARM) 模板。During the Prepare process, Resource Mover generates Azure Resource Manager (ARM) templates using the resource group settings. 资源组内的资源不受影响。Resources inside the resource group aren't affected.

备注

准备资源组后,资源组处于“启动移动挂起”状态。After preparing the resource group, it's in the Initiate move pending state. 刷新以显示最新状态。Refresh to show the latest state.

显示启动挂起状态的状态

移动源资源组Move the source resource group

按如下所示启动移动:Initiate the move as follows:

  1. 在“跨区域”中,选择资源组 >“启动移动” In Across regions, select the resource group > Initiate Move
  2. ln 移动资源,选择 " 启动移动"。ln Move Resources, select Initiate move. 资源组移动到“启动移动进行中”状态。The resource group moves into an Initiate move in progress state.
  3. 启动移动后,根据生成的 ARM 模板创建目标资源组。After initiating the move, the target resource group is created, based on the generated ARM template. 源资源组变为“提交移动挂起”状态。The source resource group moves into a Commit move pending state.

显示提交移动的状态

要提交并完成移动过程:To commit and finish the move process:

  1. 在 " 跨区域" 中,选择资源组 > 提交移动In Across regions, select the resource group > Commit move
  2. ln 移动资源,选择 " 提交"。ln Move Resources, select Commit.

备注

提交移动后,源资源组处于“删除源挂起”状态。After committing the move, the source resource group is in a Delete source pending state.

修改目标设置Modify target settings

如果不想移动源资源,可以执行以下任一操作:If you don't want to move a source resource, you can do either of the following:

  • 使用与源区域中的资源相同的名称和设置在目标区域中创建资源。Create a resource in the target region with the same name and settings as the resource in the source region.
  • 在目标区域中创建新的等效资源。Create a new equivalent resource in the target region. 除了指定的设置,目标资源的设置与源相同。Except for the settings you specify, the target resource is created with the same settings as the source.
  • 使用目标区域中的现有资源。Use an existing resource in the target region.

按如下所述修改设置:Modify a setting as follows:

  1. 若要修改设置,请在 " 目标配置 " 列中选择资源的条目。To modify a setting, select the entry in the Destination configuration column for the resource.
  2. 在 " 目标配置 " 页上,指定要使用的目标设置。In the Destination configuration page, specify the target settings you want to use. 仅对正在编辑的资源进行更改。Changes are only made for the resource you're editing. 需要单独更新所有从属资源。You need to update any dependent resources separately.

所修改的确切设置取决于资源类型。The exact settings you modify depend on the resource type. 了解 有关编辑目标设置的详细信息。Learn more about editing target settings.

准备要移动的资源Prepare resources to move

现在,源资源组已移动,你可以准备移动其他资源。Now that the source resource group is moved, you can prepare to move the other resources.

  1. 在“跨区域”中,选择要准备的资源。In Across regions, select the resources you want to prepare.

    用于选择准备其他资源的页面

  2. 选择“准备”。Select Prepare.

备注

  • 在准备过程中,Azure Site Recovery 移动代理安装在 Vm 上以进行复制。During the prepare process, the Azure Site Recovery Mobility agent is installed on VMs, for replication.
  • VM 数据定期复制到目标区域。VM data is replicated periodically to the target region. 这不会影响源 VM。This doesn't affect the source VM.
  • 资源移动会为其他源资源生成 ARM 模板。Resource Move generates ARM templates for the other source resources.
  • 准备资源后,它们处于“启动移动挂起”状态。After preparing resources, they're in an Initiate move pending state.

显示处于启动移动挂起状态的资源的页面

启动移动Initiate the move

准备好资源后,现在可以启动移动。With resources prepared, you can now initiate the move.

  1. 在“跨区域”中,选择状态“启动移动挂起”的资源。In Across regions, select resources with state Initiate move pending. 然后选择 " 启动移动"。Then select Initiate move.

  2. 在 " 移动资源" 中,选择 " 启动移动"。In Move resources, select Initiate move.

    为 "启动移动" 按钮选择

  3. 跟踪通知栏中的移动进度。Track move progress in the notifications bar.

备注

  • 对于 VM,在目标区域中创建副本 VM。For VMs, replica VMs are created in the target region. 源 VM 已关闭,并出现一段停机时间(通常为几分钟)。The source VM is shut down, and some downtime occurs (usually minutes).
  • 资源转移器使用已准备的 ARM 模板重新创建其他资源。Resource Mover recreates other resources using the ARM templates that were prepared. 通常不会停机。There's usually no downtime.
  • 对于负载均衡器,不会复制 NAT 规则。For load balancers, NAT rules aren't copied. 提交移动后,在目标区域中创建这些文件。Create them in the target region after you commit the move.
  • 对于公共 IP 地址,不会复制 DNS 名称标签。For public IP addresses, the DNS name label isn't copied. 提交移动后,重新创建标签。Recreate the label after you commit the move.
  • 准备资源后,它们处于 提交移动挂起 状态。After preparing resources, they're in an Commit move pending state.

放弃还是提交?Discard or commit?

初始移动后,你可以决定是提交移动,还是放弃它。After the initial move, you can decide whether you want to commit the move, or to discard it.

  • 放弃:如果要测试,并且不想实际移动源资源,则可能需要放弃移动。Discard: You might discard a move if you're testing, and you don't want to actually move the source resource. 放弃移动会将资源返回到“启动移动挂起”状态。Discarding the move returns the resource to a state of Initiate move pending.
  • 提交:提交即完成移动到目标区域的操作。Commit: Commit completes the move to the target region. 提交后,源资源将处于“删除源挂起”状态,你可以决定是否要删除它。After committing, a source resource will be in a state of Delete source pending, and you can decide if you want to delete it.

放弃移动Discard the move

你可以按如下所示放弃移动:You can discard the move as follows:

  1. 在 " 跨区域" 中,选择 "具有状态 提交移动挂起" 的资源,然后选择 " 放弃移动"。In Across regions, select resources with state Commit move pending, and select Discard move.
  2. 在 " 放弃移动" 中,选择 " 放弃"。In Discard move, select Discard.
  3. 跟踪通知栏中的移动进度。Track move progress in the notifications bar.
  4. 如果通知显示移动成功,请选择 " 刷新"。When the notifications show that the move was successful, select Refresh.

备注

对于 Vm,在丢弃资源后,它们处于 启动移动挂起 状态。For VMs, After discarding resources, they're in an Initiate move pending state.

提交移动Commit the move

如果要完成移动过程,请提交移动。If you want to complete the move process, commit the move.

  1. 在 " 跨区域" 中,选择 "具有状态 提交移动挂起" 的资源,然后选择 " 提交移动"。In Across regions, select resources with state Commit move pending, and select Commit move.

  2. 在 " 提交资源" 中,选择 " 提交"。In Commit resources, select Commit.

    用于提交资源以完成移动的页面

  3. 跟踪通知栏中的提交进度。Track the commit progress in the notifications bar.

备注

  • 提交移动后,VM 将停止复制。After committing the move, VMs stop replicating. 源 VM 不受提交影响。The source VM isn't impacted by the commit.
  • 提交不会影响源网络资源。Commit doesn't impact source networking resources.
  • 提交移动后,资源处于“删除源挂起”状态。After committing the move, resources are in a Delete source pending state.

在移动后配置设置Configure settings after the move

  1. 由于 DNS 名称标签不会复制到公共 IP 地址,因此在移动完成后,导航到目标资源并更新标签。Since DNS name labels aren't copied over for public IP addresses, after the move is done, navigate to the target resources and update the label.
  2. 对于内部负载均衡器,由于不会复制 NAT 规则,请导航到在目标区域中创建的资源,并更新 NAT 规则。For internal load balancers, since NAT rules aren't copied over, navigate to the resources created in the target region, and update the NAT rules.
  3. 不会自动从 VM 卸载移动服务。The Mobility service isn't uninstalled automatically from VMs. 手动卸载它,或者如果你计划再次移动服务器,则保留它。Uninstall it manually, or leave it if you plan to move the server again.

提交后删除源资源Delete source resources after commit

移动后,可以选择删除源区域中的资源。After the move, you can optionally delete resources in the source region.

  1. 在 " 跨区域" 中,选择要删除的每个源资源的名称。In Across Regions, select the name of each source resource that you want to delete.
  2. 在每个资源的属性页中,选择“删除”。In the properties page for each resource, select Delete.

删除为移动创建的其他资源Delete additional resources created for move

移动后,你可以手动删除移动集合和创建的 Site Recovery 资源。After the move, you can manually delete the move collection, and Site Recovery resources that were created.

  • 默认情况下,移动集合处于隐藏状态。The move collection is hidden by default. 要查看它,你需要打开隐藏的资源。To see it you need to turn on hidden resources.
  • 必须先删除对缓存存储的锁定,才能删除缓存存储。The cache storage has a lock that must be deleted, before it can be deleted.

按如下所示删除:Delete as follows:

  1. 在源区域中的资源组中找到资源 RegionMoveRG-<sourceregion>-<target-region>Locate the resources in resource group RegionMoveRG-<sourceregion>-<target-region>, in the source region.

  2. 检查移动集合中的所有 VM 和其他源资源是否已移动/删除。Check that all the VM and other source resources in the move collection have been moved/deleted. 这可确保没有挂起的资源使用它们。This ensures that there are no pending resources using them.

  3. 删除资源:Delete the resources:

    • 移动集合名称为 movecollection-<sourceregion>-<target-region>The move collection name is movecollection-<sourceregion>-<target-region>.
    • 缓存存储账户名称为 resmovecache<guid>The cache storage account name is resmovecache<guid>
    • 保管库名称为 ResourceMove-<sourceregion>-<target-region>-GUIDThe vault name is ResourceMove-<sourceregion>-<target-region>-GUID.

后续步骤Next steps

了解 移动过程。Learn about the move process.