如何在 Azure 门户中还原 Azure VM 数据How to restore Azure VM data in Azure portal

本文介绍如何从 Azure 备份恢复服务保管库中存储的恢复点还原 Azure VM 数据。This article describes how to restore Azure VM data from the recovery points stored in Azure Backup Recovery Services vaults.

还原选项Restore options

Azure 备份提供了几种用来还原 VM 的方法。Azure Backup provides several ways to restore a VM.

还原选项Restore option 详细信息Details
创建新 VMCreate a new VM 从还原点快速创建并正常运行一个基本的 VM。Quickly creates and gets a basic VM up and running from a restore point.

可以指定 VM 的名称,选择要将此 VM 放入到的资源组和虚拟网络 (VNet),以及为已还原的 VM 指定存储帐户。You can specify a name for the VM, select the resource group and virtual network (VNet) in which it will be placed, and specify a storage account for the restored VM. 新 VM 必须在源 VM 所在的区域创建。The new VM must be created in the same region as the source VM.

如果由于 Azure VM SKU 在指定的 Azure 区域中不可用,或者由于任何其他问题,VM 还原失败,则 Azure 备份仍将还原指定资源组中的磁盘。If a VM restore fails because an Azure VM SKU wasn't available in the specified region of Azure, or because of any other issues, Azure Backup still restores the disks in the specified resource group.
还原磁盘Restore disk 还原某个 VM 磁盘,然后使用它来创建新的 VM。Restores a VM disk, which can then be used to create a new VM.

Azure 备份提供一个模板来帮助你自定义和创建 VM。Azure Backup provides a template to help you customize and create a VM.

还原作业会生成一个模板,可以下载该模板,并使用它来指定自定义的 VM 设置和创建 VM。The restore job generates a template that you can download and use to specify custom VM settings, and create a VM.

磁盘将复制到指定的资源组。The disks are copied to the Resource Group you specify.

或者,可将磁盘附加到现有 VM,或使用 PowerShell 创建新的 VM。Alternatively, you can attach the disk to an existing VM, or create a new VM using PowerShell.

若要自定义 VM、添加在备份时不存在的配置设置,或添加必须使用模板或 PowerShell 配置的设置,则此选项非常有用。This option is useful if you want to customize the VM, add configuration settings that weren't there at the time of backup, or add settings that must be configured using the template or PowerShell.
替换现有项Replace existing 可以还原某个磁盘,并使用它来替换现有 VM 上的磁盘。You can restore a disk, and use it to replace a disk on the existing VM.

当前 VM 必须存在。The current VM must exist. 如果已将其删除,则无法使用此选项。If it's been deleted, this option can't be used.

Azure 备份会在替换磁盘之前获取现有 VM 的快照,并将其存储在指定的暂存位置。Azure Backup takes a snapshot of the existing VM before replacing the disk, and stores it in the staging location you specify. 连接到该 VM 的现有磁盘将替换为所选的还原点。Existing disks connected to the VM are replaced with the selected restore point.

快照将复制到保管库,并根据保留策略进行保留。The snapshot is copied to the vault, and retained in accordance with the retention policy.

替换磁盘操作完成后,原始磁盘会保留在资源组中。After the replace disk operation, the original disk is retained in the resource group. 如果不需要原始磁盘,可选择手动删除它们。You can choose to manually delete the original disks if they aren't needed.

对于未加密的托管 VM(包括使用自定义映像创建的 VM),支持替换现有磁盘。Replace existing is supported for unencrypted managed VMs, including VMs created using custom images. 对于经典 VM 和非托管 VM,不支持此方法。It's unsupported for classic VMs and unmanaged VMs.

如果还原点中的磁盘数多于或少于当前 VM 中的磁盘数,则还原点中的磁盘数只反映 VM 配置。If the restore point has more or less disks than the current VM, then the number of disks in the restore point will only reflect the VM configuration.

对于包含链接资源的 VM(例如用户分配的托管标识Key Vault),还支持替换现有磁盘。Replace existing is also supported for VMs with linked resources, like user-assigned managed-identity or Key Vault.
跨区域(次要区域)Cross Region (secondary region) 跨区域还原可用于还原次要区域(Azure 配对区域)中的 Azure VM。Cross Region restore can be used to restore Azure VMs in the secondary region, which is an Azure paired region.

如果备份在次要区域中完成,则可针对所选恢复点还原所有 Azure VM。You can restore all the Azure VMs for the selected recovery point if the backup is done in the secondary region.

在备份期间,不会将快照复制到次要区域。During the backup, snapshots aren't replicated to the secondary region. 仅会复制存储在保管库中的数据。Only the data stored in the vault is replicated. 因此,次要区域还原只是保管库层还原。So secondary region restores are only vault tier restores. 次要区域的还原时间与主要区域的保管库层还原时间几乎相同。The restore time for the secondary region will be almost the same as the vault tier restore time for the primary region.

此功能适用于以下选项:This feature is available for the options below:
  • 创建 VMCreate a VM
  • 还原磁盘Restore Disks

    当前不支持替换现有磁盘选项。We don't currently support the Replace existing disks option.

    权限Permissions
    次要区域中的还原操作可由备份管理员和应用管理员执行。The restore operation on secondary region can be performed by Backup Admins and App admins.
  • 备注

    还可以恢复 Azure VM 上的特定文件和文件夹。You can also recover specific files and folders on an Azure VM. 了解详细信息Learn more.

    存储帐户Storage accounts

    一些有关存储帐户的详细信息:Some details about storage accounts:

    • 创建 VM:在创建新的 VM 时,该 VM 将放置于指定的存储帐户中。Create VM: When you create a new VM, the VM will be placed in the storage account you specify.
    • 还原磁盘:当你还原磁盘时,该磁盘将复制到指定的存储帐户。Restore disk: When you restore a disk, the disk is copied to the storage account you specify. 还原作业会生成一个模板,你可以下载该模板,并使用它来指定自定义的 VM 设置。The restore job generates a template that you can download and use to specify custom VM settings. 此模板放置于指定的存储帐户中。This template is placed in the specified storage account.
    • 替换磁盘:替换现有 VM 中的磁盘时,Azure 备份会在替换该磁盘前创建现有 VM 的快照。Replace disk: When you replace a disk in an existing VM, Azure Backup takes a snapshot of the existing VM before replacing the disk. 快照还将通过数据传输复制到恢复服务保管库,以后台进程执行。The snapshot is also copied to the Recovery Services vault through data transfer, as a background process. 但是,快照阶段一旦完成,就会触发替换磁盘操作。However, once the snapshot phase is completed, the replace disks operation is triggered. 替换磁盘操作完成后,源 Azure VM 的磁盘将保留在指定资源组中供操作使用,而 VHD 则存储在指定的存储帐户中。After the replace disk operation, the disks of the source Azure VM are left in the specified Resource group for your operation and the VHDs are stored in the specified storage account. 你可选择删除或保留这些 VHD 和磁盘。You can choose to delete or retain these VHDs and disks.
    • 存储帐户位置:存储帐户必须与保管库位于同一个区域中。Storage account location: The storage account must be in the same region as the vault. 仅显示这些帐户。Only these accounts are displayed. 如果该位置中没有任何存储帐户,你需要创建一个存储帐户。If there are no storage accounts in the location, you need to create one.
    • 存储类型:不支持 Blob 存储。Storage type: Blob storage isn't supported.
    • 存储冗余:不支持区域冗余存储 (ZRS)。Storage redundancy: Zone redundant storage (ZRS) isn't supported. 帐户的复制和冗余信息显示在帐户名之后的括号内。The replication and redundancy information for the account is shown in parentheses after the account name.
    • 高级存储Premium storage:
      • 在还原非高级 VM 时,高级存储帐户不受支持。When restoring non-premium VMs, premium storage accounts aren't supported.
      • 在还原托管 VM 时,使用网络规则配置的高级存储帐户不受支持。When restoring managed VMs, premium storage accounts configured with network rules aren't supported.

    开始之前Before you start

    若要还原 VM(创建新的 VM),请确保对“还原 VM”操作具有正确的 Azure 基于角色的访问控制 (Azure RBAC) 权限To restore a VM (create a new VM), make sure you have the correct Azure role-based access control (Azure RBAC) permissions for the Restore VM operation.

    如果没有权限,则可以还原磁盘,然后在该磁盘还原后,可以使用模板(在执行还原操作的过程中生成)来创建新的 VM。If you don't have permissions, you can restore a disk, and then after the disk is restored, you can use the template that was generated as part of the restore operation to create a new VM.

    选择还原点Select a restore point

    1. 在与要还原的 VM 关联的保管库中,选择“备份项” > “Azure 虚拟机”。 In the vault associated with the VM you want to restore, select Backup items > Azure Virtual Machine.

    2. 选择 VM。Select a VM. VM 仪表板默认会显示过去 30 天的恢复点。By default on the VM dashboard, recovery points from the last 30 days are displayed. 可以显示 30 天以前的恢复点,或者根据日期、时间范围和不同类型的快照一致性进行筛选,以找到所需的恢复点。You can display recovery points older than 30 days, or filter to find recovery points based on dates, time ranges, and different types of snapshot consistency.

    3. 若要还原 VM,请选择“还原 VM”。To restore the VM, select Restore VM.

      还原点

    4. 选择用于恢复的还原点。Select a restore point to use for the recovery.

    选择 VM 还原配置Choose a VM restore configuration

    1. 在“还原虚拟机”中,选择一个还原选项:In Restore Virtual Machine, select a restore option:

      • 新建:若要创建新的 VM,请使用此选项。Create new: Use this option if you want to create a new VM. 可以使用简单的设置创建 VM,或还原某个磁盘并创建自定义的 VM。You can create a VM with simple settings, or restore a disk and create a customized VM.

      • 替换现有项:若要替换现有 VM 上的磁盘,请使用此选项。Replace existing: Use this option if you want to replace disks on an existing VM.

        “还原虚拟机配置”向导

    2. 为选定的还原选项指定设置。Specify settings for your selected restore option.

    创建 VMCreate a VM

    作为还原选项之一,你可以使用基本的设置从还原点快速创建 VM。As one of the restore options, you can create a VM quickly with basic settings from a restore point.

    1. 在“还原虚拟机” > “新建” > “还原类型”中,选择“创建虚拟机” 。In Restore Virtual Machine > Create new > Restore Type, select Create a virtual machine.

    2. 在“虚拟机名称”中,指定订阅中不存在的 VM。In Virtual machine name, specify a VM that doesn't exist in the subscription.

    3. 在“资源组”中,为新 VM 选择现有的资源组,或者创建具有全局唯一名称的新资源组。In Resource group, select an existing resource group for the new VM, or create a new one with a globally unique name. 如果分配的名称已存在,则 Azure 将为该组分配与 VM 相同的名称。If you assign a name that already exists, Azure assigns the group the same name as the VM.

    4. 在“虚拟网络”中,选择要将 VM 放入到的 VNet。In Virtual network, select the VNet in which the VM will be placed. 此时会显示与订阅关联的所有 VNet。All VNets associated with the subscription are displayed. 选择子网。Select the subnet. 默认已选择第一个子网。The first subnet is selected by default.

    5. 在“暂存位置”中,为该 VM 指定存储帐户。In Staging Location, specify the storage account for the VM. 了解详细信息Learn more.

      “还原配置”向导 - 选择还原选项

    6. 选择“还原”来触发还原操作。Select Restore to trigger the restore operation.

    还原磁盘Restore disks

    作为还原选项之一,你可以从还原点快速创建磁盘。As one of the restore options, you can create a disk from a restore point. 然后可使用该磁盘执行以下操作之一:Then with the disk, you can do one of the following actions:

    • 使用执行还原操作期间生成的模板来自定义设置,并触发 VM 部署。Use the template that's generated during the restore operation to customize settings, and trigger VM deployment. 编辑默认模板设置,然后提交模板进行 VM 部署。You edit the default template settings, and submit the template for VM deployment.
    • 将已还原的磁盘附加到现有 VM。Attach restored disks to an existing VM.
    • 使用 PowerShell 从已还原的磁盘创建新的 VMCreate a new VM from the restored disks using PowerShell.
    1. 在“还原配置” > “新建” > “还原类型”中,选择“还原磁盘”。 In Restore configuration > Create new > Restore Type, select Restore disks.

    2. 在“资源组”中,为已还原的磁盘选择现有资源组,或者创建具有全局唯一名称的新资源组。In Resource group, select an existing resource group for the restored disks, or create a new one with a globally unique name.

    3. 在“暂存位置”中,指定要将 VHD 复制到的存储帐户。In Staging location, specify the storage account to which to copy the VHDs. 了解详细信息Learn more.

      选择“资源组”和“暂存位置”

    4. 选择“还原”来触发还原操作。Select Restore to trigger the restore operation.

    当虚拟机使用托管磁盘,而你选择“创建虚拟机”选项时,Azure 备份不使用指定的存储帐户。When your virtual machine uses managed disks and you select the Create virtual machine option, Azure Backup doesn't use the specified storage account. 在使用“还原磁盘”和“即时还原”时,存储帐户仅用于存储模板。In the case of Restore disks and Instant Restore, the storage account is used only for storing the template. 在指定的资源组中创建了托管磁盘。Managed disks are created in the specified resource group. 当虚拟机使用非托管磁盘时,它们会以 Blob 的形式还原到存储帐户。When your virtual machine uses unmanaged disks, they're restored as blobs to the storage account.

    使用模板自定义还原 VMUse templates to customize a restored VM

    还原磁盘后,使用执行还原操作期间生成的模板进行自定义并创建新的 VM:After the disk is restored, use the template that was generated as part of the restore operation to customize and create a new VM:

    1. 在“备份作业”中,选择相关还原作业。In Backup Jobs, select the relevant restore job.

    2. 在“还原”中,选择“部署模板”来启动模板部署 。In Restore, select Deploy Template to initiate template deployment.

      深入到还原作业

    3. 若要自定义模板中提供的 VM 设置,请选择“编辑模板”。To customize the VM setting provided in the template, select Edit template. 若要添加其他自定义项,请选择“编辑参数”。If you want to add more customizations, select Edit parameters.

      加载模板部署

    4. 输入 VM 的自定义值,接受条款和条件,然后选择“购买”。 Enter the custom values for the VM, accept the Terms and Conditions and select Purchase.

      提交模板部署

    替换现有磁盘Replace existing disks

    作为还原选项之一,你可以使用选定的还原点替换现有的 VM 磁盘。As one of the restore options, you can replace an existing VM disk with the selected restore point. 查看所有还原选项。Review all restore options.

    1. 在“还原配置”中,选择“替换现有项” 。In Restore configuration, select Replace existing.

    2. 在“还原类型”中,选择“替换磁盘”。 In Restore Type, select Replace disk/s. 这是用于替换现有 VM 磁盘的还原点。This is the restore point that will be used replace existing VM disks.

    3. 在“暂存位置”中,指定在还原过程中应将当前托管磁盘的快照保存到的位置。In Staging Location, specify where snapshots of the current managed disks should be saved during the restore process. 了解详细信息Learn more.

      还原配置向导“替换现有”

    跨区域还原Cross Region Restore

    作为还原选项之一,跨区域还原 (CRR) 允许你在某个次要区域(Azure 配对区域)中还原 Azure VM。As one of the restore options, Cross Region Restore (CRR) allows you to restore Azure VMs in a secondary region, which is an Azure paired region.

    要开始使用此功能,请阅读“开始之前”部分To begin using the feature, read the Before You Begin section.

    若要查看是否启用了 CRR,请按照配置跨区域还原中的说明进行操作。To see if CRR is enabled, follow the instructions in Configure Cross Region Restore.

    查看次要区域中的备份项View backup items in secondary region

    如果启用了 CRR,则可以查看次要区域中的备份项。If CRR is enabled, you can view the backup items in the secondary region.

    1. 在门户中,转到“恢复服务保管库” > “备份项”。 From the portal, go to Recovery Services vault > Backup items.
    2. 选择“次要区域”以查看次要区域中的项。Select Secondary Region to view the items in the secondary region.

    备注

    只有支持 CRR 功能的备份管理类型才会显示在列表中。Only Backup Management Types supporting the CRR feature will be shown in the list. 目前,只允许将次要区域数据还原到次要区域。Currently, only support for restoring secondary region data to a secondary region is allowed.

    Azure 托管 VM(包括加密的 Azure VM)支持用于 Azure VM 的 CRR。CRR for Azure VMs is supported for Azure Managed VMs (including encrypted Azure VMs).

    次要区域中的虚拟机

    选择“次要区域”

    在次要区域中进行还原Restore in secondary region

    次要区域还原用户体验将类似于主要区域还原用户体验。The secondary region restore user experience will be similar to the primary region restore user experience. 在“还原配置”窗格中配置详细信息以配置还原时,系统会提示你仅提供次要区域参数。When configuring details in the Restore Configuration pane to configure your restore, you'll be prompted to provide only secondary region parameters.

    目前,从主要区域到次要区域的 RPO 最多为 12 个小时,即使读取访问异地冗余存储 (GRS) 复制为 15 分钟。Currently, secondary region RPO is up to 12 hours from the primary region, even though read-access geo-redundant storage (RA-GRS) replication is 15 minutes.

    选择要还原的 VM

    选择还原点

    还原配置

    “正在触发还原”通知

    备注

    • 在触发还原后并处于数据传输阶段时,无法取消还原作业。After the restore is triggered and in the data transfer phase, the restore job can't be cancelled.
    • “跨区域还原”功能会将启用了 CMK(客户管理的密钥)的 Azure VM(这些虚拟机未在启用了 CMK 的恢复服务保管库中备份)还原为次要区域中未启用 CMK 的 VM。The Cross Region Restore feature restores CMK (customer-managed keys) enabled Azure VMs, which aren't backed-up in a CMK enabled Recovery Services vault, as non-CMK enabled VMs in the secondary region.
    • 在次要区域中进行恢复所需的 Azure 角色与在主要区域中所需的角色相同。The Azure roles needed to restore in the secondary region are the same as those in the primary region.

    监视次要区域还原作业Monitoring secondary region restore jobs

    1. 在门户中,转到“恢复服务保管库” > “备份作业” From the portal, go to Recovery Services vault > Backup Jobs

    2. 选择“次要区域”以查看次要区域中的项。Select Secondary Region to view the items in the secondary region.

      筛选的备份作业

    将非托管的 VM 和磁盘还原为托管项Restoring unmanaged VMs and disks as managed

    在还原过程中,系统会提供一个选项来将非托管磁盘还原为托管磁盘You're provided with an option to restore unmanaged disks as managed disks during restore. 默认情况下,非托管的 VM/磁盘会还原为非托管的 VM/磁盘。By default, the unmanaged VMs / disks are restored as unmanaged VMs / disks. 但如果选择还原为托管的 VM/磁盘,现在可以执行此操作。However, if you choose to restore as managed VMs / disks, it's now possible to do so. 这些还原不会从快照阶段触发,而只会从保管库阶段触发。These restores aren't triggered from the snapshot phase but only from the vault phase. 此功能不适用于加密的非托管 VM。This feature isn't available for unmanaged encrypted VMs.

    还原为托管磁盘

    采用特殊配置还原 VMRestore VMs with special configurations

    在许多常见情况下,可能需要还原 VM。There are many common scenarios in which you might need to restore VMs.

    方案Scenario 指南Guidance
    通过混合使用权益还原 VMRestore VMs using Hybrid Use Benefit 如果 Windows VM 使用混合使用权益 (HUB) 许可,请还原磁盘,并使用提供的模板(将“许可证类型”设置为“Windows_Server”)或 PowerShell 创建新的 VM。 If a Windows VM uses Hybrid Use Benefit (HUB) licensing, restore the disks, and create a new VM using the provided template (with License Type set to Windows_Server), or PowerShell. 也可以在创建 VM 后应用此设置。This setting can also be applied after creating the VM.
    在发生 Azure 数据中心灾难期间还原 VMRestore VMs during an Azure datacenter disaster 如果保管库使用 GRS 并且 VM 的主数据中心出现故障,Azure 备份支持将已备份的 VM 还原到配对的数据中心。If the vault uses GRS and the primary datacenter for the VM goes down, Azure Backup supports restoring backed-up VMs to the paired datacenter. 在配对的数据中心选择一个存储帐户,然后像平时一样进行还原。You select a storage account in the paired datacenter, and restore as normal. Azure 备份使用配对区域中的计算服务来创建已还原的 VM。Azure Backup uses the compute service in the paired region to create the restored VM. 详细了解数据中心复原能力。Learn more about datacenter resiliency.

    如果保管库使用 GRS,则你可以选择新功能跨区域还原If the vault uses GRS, you can choose the new feature, Cross Region Restore. 这使你可以在完全或部分中断的情况下还原到次要区域,甚至在根本没有中断的情况下进行还原。This lets you restore to a second region in either full or partial outage scenarios, or even if there's no outage at all.
    裸机还原Bare-metal restore Azure VM 与本地虚拟机监控程序之间的主要差别是 Azure 中不提供 VM 控制台。The major difference between Azure VMs and on-premises hypervisors is that there's no VM console available in Azure. 某些方案(如使用裸机恢复 (BMR) 类型备份进行恢复)需要控制台。A console is required for certain scenarios, such as recovering by using a bare-metal recovery (BMR)-type backup. 但是,通过保管库进行 VM 还原完全取代了 BMR。However, VM restore from the vault is a full replacement for BMR.
    还原采用特殊网络配置的 VMRestore VMs with special network configurations 特殊网络配置包括使用内部或外部负载均衡、使用多个 NIC 或多个保留 IP 地址的 VM。Special network configurations include VMs using internal or external load balancing, using multiple NICS, or multiple reserved IP addresses. 可使用还原磁盘选项还原这些 VM。You restore these VMs by using the restore disk option. 此选项会将 VHD 复制到指定的存储帐户,然后,你可以根据配置,使用内部外部负载均衡器、多个 NIC多个保留 IP 地址创建 VM。This option makes a copy of the VHDs into the specified storage account, and you can then create a VM with an internal or external load balancer, multiple NICS, or multiple reserved IP addresses, in accordance with your configuration.
    NIC/子网上的网络安全组 (NSG)Network Security Group (NSG) on NIC/Subnet Azure VM 备份支持在 VNet、子网和 NIC 级别备份和还原 NSG 信息。Azure VM backup supports Backup and Restore of NSG information at vnet, subnet, and NIC level.
    还原任何可用性集中的 VMRestore VM in any availability set 从门户还原 VM 时,没有选择可用性集的选项。When restoring a VM from the portal, there's no option to choose an availability set. 还原的 VM 没有可用性集。A restored VM doesn't have an availability set. 如果使用了还原磁盘选项,则使用提供的模板或 PowerShell 从磁盘创建 VM 时,可以指定可用性集If you use the restore disk option, then you can specify an availability set when you create a VM from the disk using the provided template or PowerShell.
    还原特殊 VM,例如 SQL VMRestore special VMs such as SQL VMs 如果要使用 Azure VM 备份来备份 SQL VM,然后使用“还原 VM”选项或在还原磁盘后创建 VM,则必须向 SQL 提供程序注册新创建的 VM,如此处所述。If you're backing up a SQL VM using Azure VM backup and then use the restore VM option or create a VM after restoring disks, then the newly created VM must be registered with the SQL provider as mentioned here. 这会将还原的 VM 转换为 SQL VM。This will convert the restored VM into a SQL VM.

    还原域控制器 VMRestore domain controller VMs

    方案Scenario 指南Guidance
    还原单个域中的单个域控制器 VMRestore a single domain controller VM in a single domain 像还原其他任何 VM 一样还原该 VM。Restore the VM like any other VM. 请注意:Note that:

    从 Active Directory 的角度来看,Azure VM 与任何其他 VM 类似。From an Active Directory perspective, the Azure VM is like any other VM.

    还可使用目录服务还原模式 (DSRM),因此所有 Active Directory 恢复方案都是可行的。Directory Services Restore Mode (DSRM) is also available, so all Active Directory recovery scenarios are viable. 详细了解虚拟化域控制器的备份和还原注意事项。Learn more about backup and restore considerations for virtualized domain controllers.
    还原单个域中的多个域控制器 VMRestore multiple domain controller VMs in a single domain 如果可以通过网络访问同一个域中的其他域控制器,则可以像还原任何 VM 一样还原域控制器。If other domain controllers in the same domain can be reached over the network, the domain controller can be restored like any VM. 对于域中剩余的最后一个域控制器,或者在隔离的网络中执行恢复,请使用林恢复If it's the last remaining domain controller in the domain, or a recovery in an isolated network is performed, use a forest recovery.
    在多个域配置中还原单个域控制器 VMRestore a single domain controller VM in a multiple domain configuration 使用 PowerShell 还原磁盘并创建 VMRestore the disks and create a VM by using PowerShell
    还原一个林中的多个域Restore multiple domains in one forest 建议使用林恢复We recommend a forest recovery.

    有关详细信息,请参阅备份和还原 Active Directory 域控制器For more information, see Back up and restore Active Directory domain controllers.

    跟踪还原操作Track the restore operation

    触发还原操作后,备份服务会创建一个作业用于跟踪。After you trigger the restore operation, the backup service creates a job for tracking. Azure 备份在门户中显示有关作业的通知。Azure Backup displays notifications about the job in the portal. 如果未显示通知,请选择“通知”符号,然后选择“活动日志中的更多事件”来查看还原过程状态。 If they aren't visible, select the Notifications symbol, and then select More events in the activity log to see the Restore Process Status.

    已触发还原

    按如下所述跟踪还原:Track restore as follows:

    1. 若要查看针对作业的操作,请选择通知超链接。To view operations for the job, select the notifications hyperlink. 或在保管库中选择“备份作业”,然后选择相关的 VM。Alternatively, in the vault, select Backup jobs, and then select the relevant VM.

      保管库中的 VM 列表

    2. 若要监视还原进度,请选择状态为“正在进行”的任何还原作业。To monitor restore progress, select any restore job with a status of In-progress. 此时会出现进度栏,其中显示了有关还原进度的信息:This displays the progress bar, which displays information about the restore progress:

      • 还原估计所需时间:最初提供完成还原操作所需的时间。Estimated time of restore: Initially provides the time taken to complete the restore operation. 随着操作的不断进行,该时间会不断减少,还原操作完成后,将显示为 0。As the operation progresses, the time taken reduces and reaches zero when the restore operation finishes.
      • 还原百分比Percentage of restore. 显示还原操作的完成百分比。Shows the percentage of restore operation that's done.
      • 传输的字节数:如果通过创建新的 VM 进行还原,此字段将显示已传输的字节数,以及有待传输的字节总数。Number of bytes transferred: If you're restoring by creating a new VM, it shows the bytes that were transferred against the total number of bytes to be transferred.

    还原后的步骤Post-restore steps

    还原 VM 之后,还需要注意一些事项:There are a few things to note after restoring a VM:

    • 将安装备份配置期间存在的扩展,但不会启用这些扩展。Extensions present during the backup configuration are installed, but not enabled. 如果出现问题,请重新安装这些扩展。If you see an issue, reinstall the extensions.

    • 如果备份的 VM 使用了静态 IP 地址,则还原的 VM 将使用动态 IP 地址,以避免冲突。If the backed-up VM had a static IP address, the restored VM will have a dynamic IP address to avoid conflict. 将静态 IP 地址添加到还原的 VMYou can add a static IP address to the restored VM.

    • 还原的 VM 没有可用性集。A restored VM doesn't have an availability set. 如果使用了还原磁盘选项,则使用提供的模板或 PowerShell 从磁盘创建 VM 时,可以指定可用性集If you use the restore disk option, then you can specify an availability set when you create a VM from the disk using the provided template or PowerShell.

    • 如果使用基于 cloud-init 的 Linux 分发版(例如 Ubuntu),出于安全原因,还原后将阻止密码。If you use a cloud-init-based Linux distribution, such as Ubuntu, for security reasons the password is blocked after the restore. 请在还原的 VM 上使用 VMAccess 扩展 重置密码Use the VMAccess extension on the restored VM to reset the password. 我们建议在这些分发版中使用 SSH 密钥,这样,在还原后就无需重置密码。We recommend using SSH keys on these distributions, so you don't need to reset the password after the restore.

    • 如果在还原后因 VM 与域控制器的关系遭到破坏而无法访问 VM,请执行以下步骤来启动 VM:If you're unable to access a VM once restored because the VM has a broken relationship with the domain controller, then follow the steps below to bring up the VM:

      • 将 OS 磁盘作为数据磁盘附加到恢复的 VM。Attach OS disk as a data disk to a recovered VM.
      • 如果发现 Azure 代理无响应,请按此链接的要求手动安装 VM 代理。Manually install VM agent if Azure Agent is found to be unresponsive by following this link.
      • 在 VM 上启用串行控制台访问,以便通过命令行访问 VMEnable Serial Console access on VM to allow command-line access to VM
        bcdedit /store <drive letter>:\boot\bcd /enum
        bcdedit /store <VOLUME LETTER WHERE THE BCD FOLDER IS>:\boot\bcd /set {bootmgr} displaybootmenu yes
        bcdedit /store <VOLUME LETTER WHERE THE BCD FOLDER IS>:\boot\bcd /set {bootmgr} timeout 5
        bcdedit /store <VOLUME LETTER WHERE THE BCD FOLDER IS>:\boot\bcd /set {bootmgr} bootems yes
        bcdedit /store <VOLUME LETTER WHERE THE BCD FOLDER IS>:\boot\bcd /ems {<<BOOT LOADER IDENTIFIER>>} ON
        bcdedit /store <VOLUME LETTER WHERE THE BCD FOLDER IS>:\boot\bcd /emssettings EMSPORT:1 EMSBAUDRATE:115200
      
      • 重新生成 VM 后,请通过 Azure 门户重置本地管理员帐户和密码When the VM is rebuilt use Azure portal to reset local administrator account and password

      • 使用串行控制台访问和 CMD,使 VM 从域中脱离Use Serial console access and CMD to disjoin VM from domain

        cmd /c "netdom remove <<MachineName>> /domain:<<DomainName>> /userD:<<DomainAdminhere>> /passwordD:<<PasswordHere>> /reboot:10 /Force"
        
    • VM 脱离并重启后,即可使用本地管理员凭据成功地通过 RDP 连接到 VM,并将 VM 成功地重新加入域。Once the VM is disjoined and restarted, you'll be able to successfully RDP to the VM with local admin credentials and rejoin VM back to domain successfully.

    备份已还原的 VMBacking up restored VMs

    • 如果将 VM 还原到了与最初备份 VM 时所在的资源组同名的资源组,则还原之后,会继续备份该 VM。If you restored a VM to the same resource group with the same name as the originally backed-up VM, backup continues on the VM after restore.
    • 如果将 VM 还原到了其他资源组或者为还原的 VM 指定了其他名称,则需要为还原的 VM 设置备份。If you restored the VM to a different resource group or you specified a different name for the restored VM, you need to set up backup for the restored VM.

    后续步骤Next steps

    • 如果在还原过程中遇到难题,请查看常见问题和错误。If you experience difficulties during the restore process, review common issues and errors.
    • 还原 VM 后,请了解如何管理虚拟机After the VM is restored, learn about managing virtual machines