使用 Azure 门户备份多个虚拟机Use Azure portal to back up multiple virtual machines

在 Azure 中备份数据时,数据存储在名为恢复服务保管库的 Azure 资源中。When you back up data in Azure, you store that data in an Azure resource called a Recovery Services vault. 恢复服务保管库资源位于大多数 Azure 服务的“设置”菜单中。The Recovery Services vault resource is available from the Settings menu of most Azure services. 在大多数 Azure 服务的“设置”菜单中集成恢复服务保管库的好处在于可轻松备份数据。The benefit of having the Recovery Services vault integrated into the Settings menu of most Azure services is the ease of backing up data. 但是,单独处理公司中的每个数据库或虚拟机非常麻烦。However, working individually with each database or virtual machine in your business is tedious. 如果希望将所有虚拟机的数据备份到一个部门或一个位置,应该怎么办?What if you want to back up the data for all virtual machines in one department, or in one location? 通过创建备份策略和将此策略应用到目标虚拟机,可轻松备份多个虚拟机。It's easy to back up multiple virtual machines by creating a backup policy and applying that policy to the desired virtual machines. 本教程介绍了如何完成以下操作:This tutorial explains how to:

  • 创建恢复服务保管库Create a Recovery Services vault
  • 定义备份策略Define a backup policy
  • 应用备份策略以保护多个虚拟机Apply the backup policy to protect multiple virtual machines
  • 对保护的虚拟机触发按需备份作业Trigger an on-demand backup job for the protected virtual machines

登录到 Azure 门户Sign in to the Azure portal

登录 Azure 门户Sign in to the Azure portal.

创建恢复服务保管库Create a Recovery Services vault

恢复服务保管库包含备份数据和应用于受保护虚拟机的备份策略。The Recovery Services vault contains the backup data, and the backup policy applied to the protected virtual machines. 备份虚拟机是在本地完成的过程。Backing up virtual machines is a local process. 无法将某个位置的虚拟机备份到另一个位置的恢复服务保管库。You can't back up a virtual machine from one location to a Recovery Services vault in another location. 因此,每个包含要备份的虚拟机的 Azure 位置中必须至少存在一个恢复服务保管库。So, for each Azure location that has virtual machines to be backed up, at least one Recovery Services vault must exist in that location.

  1. 在左侧菜单中,选择“所有服务”。On the left menu, select All services.

    选择“所有服务”

  2. 在“所有服务”对话框中,输入“恢复服务” 。In the All services dialog box, enter Recovery Services. 资源列表根据输入进行筛选。The list of resources filters according to your input. 在资源列表中,选择“恢复服务保管库”。In the list of resources, select Recovery Services vaults.

    输入并选择“恢复服务保管库”

    此时会显示订阅中的恢复服务保管库列表。The list of Recovery Services vaults in the subscription appears.

  3. 在“恢复服务保管库”仪表板上,选择“添加” 。On the Recovery Services vaults dashboard, select Add.

    添加恢复服务保管库

  4. 在“恢复服务保管库”菜单中,In the Recovery Services vault menu,

    • 在“名称”中键入“myRecoveryServicesVault”。Type myRecoveryServicesVault in Name.
    • 当前订阅 ID 显示在“订阅”中。The current subscription ID appears in Subscription. 如有其他订阅,可为新保管库选择另一订阅。If you have additional subscriptions, you can choose another subscription for the new vault.
    • 对于“资源组”,请选择“使用现有”,然后选择“myResourceGroup” 。For Resource group, select Use existing and choose myResourceGroup. 如果没有“myResourceGroup”,请选择“新建”,然后键入“myResourceGroup”。If myResourceGroup doesn't exist, select Create new and type myResourceGroup.
    • 从“位置”下拉菜单中选择“中国北部”。From the Location drop-down menu, choose China North.

    恢复服务保管库值

    恢复服务保管库必须与受保护的虚拟机处于相同位置。A Recovery Services vault must be in the same location as the virtual machines being protected. 如果多个区域中有虚拟机,请在每个区域中创建恢复服务保管库。If you have virtual machines in multiple regions, create a Recovery Services vault in each region. 本教程在中国北部创建恢复服务保管库的原因在于,中国北部是创建 myVM(通过快速入门创建的虚拟机)的位置 。This tutorial creates a Recovery Services vault in China North because that's where myVM (the virtual machine created with the quickstart) was created.

  5. 准备好创建恢复服务保管库后,选择“创建”。When you're ready to create the Recovery Services vault, select Create.

    创建恢复服务保管库

  6. 创建恢复服务保管库可能需要一段时间。It can take a while to create the Recovery Services vault. 可在门户右上角“通知”区域监视状态通知。Monitor the status notifications in the Notifications area at the upper-right corner of the portal. 创建保管库后,它会显示在“恢复服务保管库”的列表中。After your vault is created, it's visible in the list of Recovery Services vaults. 如果未看到创建的保管库,请选择“刷新”。If you don't see your vault, select Refresh.

    刷新备份保管库列表

创建恢复服务保管库时,保管库默认具有异地冗余存储。When you create a Recovery Services vault, by default the vault has geo-redundant storage. 为提供数据弹性,异地冗余存储会多次跨两个 Azure 区域复制数据。To provide data resiliency, geo-redundant storage replicates the data multiple times across two Azure regions.

设置备份策略以保护 VMSet backup policy to protect VMs

创建恢复服务保管库后,下一步是为保管库配置数据类型和设置备份策略。After creating the Recovery Services vault, the next step is to configure the vault for the type of data, and to set the backup policy. 备份策略是有关恢复点创建频率和时间的计划。Backup policy is the schedule for how often and when recovery points are taken. 策略还包含恢复点的保留范围。Policy also includes the retention range for the recovery points. 本教程假设你的企业是一家涵盖酒店、体育馆、餐厅和租赁用地的综合体育中心,并且你要保护虚拟机上的数据。For this tutorial, let's assume your business is a sports complex with a hotel, stadium, and restaurants and concessions, and you're protecting the data on the virtual machines. 请按照以下步骤创建用于财务数据的备份策略。The following steps create a backup policy for the financial data.

  1. 在恢复服务保管库列表中,选择“myRecoveryServicesVault”以打开其仪表板。From the list of Recovery Services vaults, select myRecoveryServicesVault to open its dashboard.

    打开“方案”菜单

  2. 在保管库仪表板菜单中,选择“备份”以打开“备份”菜单。On the vault dashboard menu, select Backup to open the Backup menu.

  3. 在“备份目标”菜单的“工作负荷的运行位置”下拉菜单中选择“Azure”。On the Backup Goal menu, in the Where is your workload running drop-down menu, choose Azure. 从“要备份的内容”下拉列表中选择“虚拟机”,然后选择“备份”。From the What do you want to backup drop-down, choose Virtual machine, and select Backup.

    这些操作为此恢复服务保管库与虚拟机交互的准备操作。These actions prepare the Recovery Services vault for interacting with a virtual machine. 恢复服务保管库具有默认策略,该策略每天创建一个还原点,并将还原点保留 30 天。Recovery Services vaults have a default policy that creates a restore point each day, and retains the restore points for 30 days.

    备份目标

  4. 若要创建新策略,在“备份策略”菜单的“选择备份策略”下拉菜单中,选择“创建新策略”。To create a new policy, on the Backup policy menu, from the Choose backup policy drop-down menu, select Create a new policy.

    创建新策略

  5. 将打开“备份策略”窗格。The Backup policy pane will open. 填写以下详细信息:Fill out the following details:

    • 对于“策略名称”,键入“财务”。For Policy Name type Finance. 对备份策略输入以下更改:Enter the following changes for the Backup policy:

    • 对于“备份频率”,请将时区设置为“中部时间”。For Backup frequency set the timezone for Central Time. 由于此综合体育中心位于德克萨斯,其所有者希望时间为当地时间。Since the sports complex is in Texas, the owner wants the timing to be local. 将备份频率设置为每日凌晨 3:30。Leave the backup frequency set to Daily at 3:30AM.

    • 对于“每日备份点的保留期”,请将时间段设置为 90 天。For Retention of daily backup point, set the period to 90 days.

    • 对于“每周备份点的保留期”,请使用“星期一”还原点并将其保留 52 周。For Retention of weekly backup point, use the Monday restore point and retain it for 52 weeks.

    • 对于“每月备份点的保留期”,使用当月第一个星期日作为还原点,并将其保留 36 个月。For Retention of monthly backup point, use the restore point from First Sunday of the month, and retain it for 36 months.

    • 取消选中“每年备份点的保留期”选项。Deselect the Retention of yearly backup point option. 财务主管不希望数据保留期超过 36 个月。The leader of Finance doesn't want to keep data longer than 36 months.

    • 选择“确定”以创建备份策略。Select OK to create the backup policy.

      备份策略设置

      创建备份策略后,将策略与虚拟机关联。After creating the backup policy, associate the policy with the virtual machines.

  6. 在“虚拟机”下,选择“添加”。Under Virtual Machines, select Add.

    添加虚拟机

  7. 将打开“选择虚拟机”窗格。The Select virtual machines pane will open. 选择“myVM”,然后选择“确定”,将备份策略部署到虚拟机。Select myVM and select OK to deploy the backup policy to the virtual machines.

    随即显示位于同一位置且尚未与备份策略关联的所有虚拟机。All virtual machines that are in the same location, and aren't already associated with a backup policy, appear. 选择“myVMH1”和“myVMR1”,将其与“财务”策略关联 。myVMH1 and myVMR1 are selected to be associated with the Finance policy.

    选择要保护的 VM

  8. 选择虚拟机之后,选择“启用备份”。After the virtual machines have been chosen, select Enable Backup.

    部署完成后,会收到告知部署已成功完成的通知。When the deployment completes, you'll receive a notification that deployment successfully completed.

初始备份Initial backup

已启用恢复服务保管库备份,但尚未创建初始备份。You've enabled backup for the Recovery Services vaults, but an initial backup hasn't been created. 根据灾难恢复最佳做法,应该触发首次备份,让数据受到保护。It's a disaster recovery best practice to trigger the first backup, so that your data is protected.

运行按需备份作业:To run an on-demand backup job:

  1. 在保管库仪表板上,选择“备份项”下的“3”,打开“备份项”菜单 。On the vault dashboard, select 3 under Backup Items, to open the Backup Items menu.

    备份项

    “备份项”菜单随即打开。The Backup Items menu opens.

  2. 在“备份项”菜单上,选择“Azure 虚拟机”,打开与保管库关联的虚拟机列表 。On the Backup Items menu, select Azure Virtual Machine to open the list of virtual machines associated with the vault.

    虚拟机的列表

  3. “备份项”列表随即打开。The Backup Items list opens.

    已触发备份作业

  4. 在“备份项”列表中,选择省略号“...”以打开上下文菜单。On the Backup Items list, select the ellipses ... to open the Context menu.

  5. 在上下文菜单上,选择“立即备份”。On the Context menu, select Backup now.

    上下文菜单 - 选择“立即备份”

    “立即备份”菜单随即打开。The Backup Now menu opens.

  6. 在“立即备份”菜单中,输入恢复点保留的最后日期,然后选择“确定”。On the Backup Now menu, enter the last day to retain the recovery point, and select OK.

    设置保留立即备份恢复点的最后一天

    部署通知会告知你备份作业已触发,并且可以在“备份作业”页面上监视作业的进度。Deployment notifications let you know the backup job has been triggered, and that you can monitor the progress of the job on the Backup jobs page. 创建初始备份可能需要一些时间,具体取决于虚拟机的大小。Depending on the size of your virtual machine, creating the initial backup may take a while.

    初始备份作业完成后,可在“备份作业”菜单中查看其状态。When the initial backup job completes, you can see its status in the Backup job menu. 按需备份作业已为“myVM”创建初始还原点。The on-demand backup job created the initial restore point for myVM. 若要备份其他虚拟机,请对每个虚拟机重复上述操作。If you want to back up other virtual machines, repeat these steps for each virtual machine.

    “备份作业”磁贴

清理资源Clean up resources

如果计划继续使用后续教程,请勿清除在本教程中创建的资源。If you plan to continue on to work with subsequent tutorials, don't clean up the resources created in this tutorial. 如果不打算继续,请在 Azure 门户中执行以下步骤来删除此教程创建的所有资源。If you don't plan to continue, use the following steps to delete all resources created by this tutorial in the Azure portal.

  1. 在“myRecoveryServicesVault”仪表板上,选择“备份项”下的“3”,打开“备份项”菜单 。On the myRecoveryServicesVault dashboard, select 3 under Backup Items to open the Backup Items menu.

    打开“备份项”菜单

  2. 在“备份项”菜单上,选择“Azure 虚拟机”,打开与保管库关联的虚拟机列表 。On the Backup Items menu, select Azure Virtual Machine to open the list of virtual machines associated with the vault.

    虚拟机的列表

    “备份项”列表随即打开。The Backup Items list opens.

  3. 在“备份项”菜单中,选择省略号以打开上下文菜单。In the Backup Items menu, select the ellipsis to open the Context menu.

    在“备份项”菜单中,打开“上下文”菜单

  4. 在上下文菜单上,选择“停止备份”以打开“停止备份”菜单。On the context menu, select Stop backup to open Stop Backup menu.

    “停止备份”菜单

  5. 在“停止备份”菜单上,选择上部的下拉列表菜单,然后选择“删除备份数据” 。In the Stop Backup menu, select the upper drop-down menu and choose Delete Backup Data.

  6. 在“输入备份项名称”对话框中,键入“myVM”。In the Type the name of the Backup item dialog, type myVM.

  7. 验证备份项(显示勾号)后,“停止备份”按钮处于启用状态。Once the backup item is verified (a check mark appears), Stop backup button is enabled. 选择“停止备份”,停用策略并删除还原点。Select Stop Backup to stop the policy and delete the restore points.

    选择“停止备份”以删除保管库

    备注

    删除的项会以软删除状态保留 14 天。Deleted items are retained in the soft delete state for 14 days. 只有在该时间段过后,才能删除保管库。Only after that period can the vault be deleted. 有关详细信息,请参阅删除 Azure 备份恢复服务保管库For more information, see Delete an Azure Backup Recovery Services vault.

  8. 当保管库中没有其他项时,请选择“删除”。When there are no more items in the vault, select Delete.

    选择“删除”

    删除此保管库后,将返回恢复服务保管库列表。Once the vault is deleted, you'll return to the list of Recovery Services vaults.

后续步骤Next steps

本教程使用 Azure 门户执行了以下操作:In this tutorial, you used the Azure portal to:

  • 创建恢复服务保管库Create a Recovery Services vault
  • 设置保管库以保护虚拟机Set the vault to protect virtual machines
  • 创建自定义备份和保留策略Create a custom backup and retention policy
  • 分配策略以保护多个虚拟机Assign the policy to protect multiple virtual machines
  • 触发虚拟机的按需备份Trigger an on-demand back up for virtual machines

继续阅读下一教程,学习如何从磁盘还原 Azure 虚拟机。Continue to the next tutorial to restore an Azure virtual machine from disk.