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

使用 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 makes it very easy to back up data. 但是,单独处理公司中的每个数据库或虚拟机非常麻烦。However, individually working 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 is 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 门户Log in to the Azure portal

登录到 Azure 门户Log 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 cannot 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-hand menu, select All services and in the services list, type Recovery Services. 键入时,系统将筛选出资源列表。As you type, the list of resources filters. 看见列表中的恢复服务保管库时,请将其选中以打开“恢复服务保管库”菜单。When you see Recovery Services vaults in the list, select it to open the Recovery Services vaults menu.

    打开“恢复服务保管库”菜单

  2. 在“恢复服务保管库”菜单中,单击“添加”,打开恢复服务保管库菜单 。In the Recovery Services vaults menu, click Add to open the Recovery Services vault menu.

    打开保管库菜单

  3. 在“恢复服务保管库”菜单中,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 could 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 West Europe.
    • 单击“创建”,创建恢复服务保管库 。Click Create to create your Recovery Services vault.

恢复服务保管库必须与受保护的虚拟机处于相同位置。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 West Europe because that is where myVM (the virtual machine created with the quickstart) was created.

创建恢复服务保管库可能需要数分钟。It can take several minutes for the Recovery Services vault to be created. 可以在门户右上区域监视状态通知。Monitor the status notifications in the upper right-hand area of the portal. 创建保管库后,它会显示在“恢复服务保管库”的列表中。Once your vault is created, it appears in the list of Recovery Services vaults.

创建恢复服务保管库时,保管库默认具有异地冗余存储。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 are 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, click 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 click 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 New.

    选择工作负荷

  5. 对于“备份策略”菜单中的“策略名称”,请键入“财务” 。In the Backup policy menu, 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.

    • 单击“确定”以创建备份策略。 Click OK to create the backup policy.

      选择工作负荷

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

  6. 在“选择虚拟机”对话框中选择“myVM”,然后单击“确定”,将备份策略部署到虚拟机 。In the Select virtual machines dialog select myVM and click OK to deploy the backup policy to the virtual machines.

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

    选择工作负荷

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

初始备份Initial backup

已启用恢复服务保管库备份,但尚未创建初始备份。You have enabled backup for the Recovery Services vaults, but an initial backup has not been created. 根据灾难恢复最佳做法,应该触发首次备份,让数据受到保护。It is 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, click 3 under Backup Items, to open the Backup Items menu.

    “设置”图标

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

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

    “设置”图标

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

    已触发备份作业

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

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

    上下文菜单

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

  5. 在“立即备份”菜单中,输入恢复点保留的最后日期,然后单击“备份” 。On the Backup Now menu, enter the last day to retain the recovery point, and click Backup.

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

    部署通知会告知你备份作业已触发,并且可以在“备份作业”页面上监视作业的进度。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, do not clean up the resources created in this tutorial. 如果不打算继续,请在 Azure 门户中执行以下步骤来删除此教程创建的所有资源。If you do not 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, click 3 under Backup Items, to open the Backup Items menu.

    “设置”图标

  2. 在“备份项”菜单上,单击“Azure 虚拟机”,打开与保管库关联的虚拟机列表 。On the Backup Items menu, click 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, click 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 checkmark appears), Stop backup button is enabled. 单击“停止备份”,停用策略并删除还原点 。Click Stop Backup to stop the policy and delete the restore points.

    单击“停止备份”以删除保管库

  8. 在“myRecoveryServicesVault”菜单中,单击“删除” 。In the myRecoveryServicesVault menu, click Delete.

    单击“停止备份”以删除保管库

    删除此保管库后,将返回恢复服务保管库列表。Once the vault is deleted, you 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.