删除 Azure 备份恢复服务保管库Delete an Azure Backup Recovery Services vault

本文介绍如何删除 Microsoft Azure 备份恢复服务 (MARS) 保管库。This article describes how to delete a Microsoft Azure Backup Recovery Services (MARS) vault. 其中分别说明了如何删除依赖项,以及如何删除保管库。It contains instructions for removing dependencies and then deleting a vault.

开始之前Before you start

无法删除具有依赖项(例如,与保管库关联的受保护服务器或备份管理服务器)的恢复服务保管库。You cannot delete a Recovery Services vault that has dependencies such as protected servers or backup management servers associated with the vault.

  • 无法删除包含备份数据的保管库(即,停止了保护,但保留了备份数据)。Vaults that contain backup data can't be deleted (even if you've stopped protection but retained the backup data).

  • 如果删除包含依赖项的保管库,将显示以下消息:If you delete a vault that contains dependencies, the following message appears:

    删除保管库出错。

  • 如果从门户中删除包含依赖项的本地受保护项,将显示警告消息:If you delete an on-premises protected item from a portal that contains dependencies, a warning message appears:

    删除受保护的服务器出错。

  • 如果备份项处于软删除状态,将显示以下警告消息,你将需要等到这些备份项被永久删除。If backup items are in soft deleted state below warning message appears and you will have to wait until they are permanently deleted. 有关详细信息,请参阅此文For more information, see this article.

    删除保管库出错。

若要删除保管库,请选择与设置相匹配的方案,然后执行建议的步骤:To delete the vault, choose the scenario that matches your setup and follow the recommended steps:

方案Scenario 删除依赖项以删除保管库的步骤Steps to remove dependencies to delete vault
我的本地文件和文件夹已备份到 Azure,并已使用 Azure 备份代理进行保护I have on-premises files and folders protected by using the Azure Backup agent, backing up to Azure 执行从 MARS 管理控制台删除备份项中的步骤Perform the steps in Delete backup items from the MARS management console
我的本地计算机已在 Azure 中使用 MABS(Microsoft Azure 备份服务器)或 DPM (System Center Data Protection Manager) 进行保护I have on-premises machines that are protected by using MABS (Microsoft Azure Backup Server) or DPM (System Center Data Protection Manager) to Azure 执行从 MABS 管理控制台删除备份项中的步骤Perform the steps in Delete backup items from the MABS management console
我在云中有受保护的项(例如 laaS 虚拟机或 Azure 文件共享)I have protected items in the cloud (for example, an laaS virtual machine or an Azure Files share) 执行删除云中的受保护项中的步骤Perform the steps in Delete protected items in the cloud
我在本地和云中都有受保护的项I have protected items both on premises and in the cloud 按顺序执行以下所有部分中的步骤:Perform the steps in all of the following sections, in the following order:
1.删除云中的受保护项1. Delete protected items in the cloud
2.从 MARS 管理控制台删除备份项2. Delete backup items from the MARS management console
3.从 MABS 管理控制台删除备份项3. Delete backup items from the MABS Management console
我在本地或云中没有任何受保护的项,但仍然收到保管库删除错误I don't have any protected items on-premises or cloud; however, I am still getting the Vault deletion error 执行使用 Azure 资源管理器删除恢复服务保管库中的步骤Perform the steps in Delete the Recovery Services vault by using Azure Resource Manager

删除云中的受保护项Delete protected items in the cloud

首先,请阅读 开始之前 部分,以了解依赖项和保管库删除过程。First, read the Before you start section to understand the dependencies and vault deletion process.

若要停止保护并删除备份数据,请执行以下操作:To stop protection and delete the backup data, perform the following steps:

  1. 在门户中依次转到“恢复服务保管库”、“备份项”。 From the portal, go to Recovery Services vault, and then go to Backup items. 然后,选择云中的受保护项(例如,Azure 虚拟机、Azure 存储 [Azure 文件服务] 或 Azure 虚拟机上的 SQL Server)。Then, choose the protected items in the cloud (for example, Azure Virtual Machines, Azure Storage [the Azure Files service], or SQL Server on Azure Virtual Machines).

    选择备份类型。

  2. 右键单击并选择备份项。Right-click to select the backup item. 根据该备份项是否受保护,菜单将显示“停止备份”窗格或“删除备份数据”窗格。 Depending on whether the backup item is protected or not, the menu displays either the Stop Backup pane or the Delete Backup Data pane.

    • 如果显示了“停止备份”窗格,请从下拉菜单中选择“删除备份数据”。 If the Stop Backup pane appears, select Delete Backup Data from the drop-down menu. 输入备份项的名称(此字段区分大小写),然后从下拉菜单中选择原因。Enter the name of the backup item (this field is case-sensitive), and then select a reason from the drop-down menu. 输入备注(如果有)。Enter your comments, if you have any. 然后选择“停止备份”。 Then, select Stop backup.

      “停止备份”窗格。

    • 如果显示了“删除备份数据”窗格,请输入备份项的名称(此字段区分大小写),然后从下拉菜单中选择原因。 If the Delete Backup Data pane appears, enter the name of the backup item (this field is case-sensitive), and then select a reason from the drop-down menu. 输入备注(如果有)。Enter your comments, if you have any. 然后选择“删除”。 Then, select Delete.

      “删除备份数据”窗格。

  3. 查看“通知”图标: “通知”图标。Check the Notification icon: The Notification icon. 完成该过程后,服务将显示以下消息:“正在停止 <备份项> 的备份并删除备份数据。 After the process finishes, the service displays the following message: Stopping backup and deleting backup data for " Backup Item ". 已成功完成该操作”。 Successfully completed the operation.

  4. 在“备份项”菜单中选择“刷新”,确保已删除该备份项。 Select Refresh on the Backup Items menu, to make sure the backup item was deleted.

    “删除备份项”页。

删除本地的受保护项Delete protected items on premises

首先,请阅读 开始之前 部分,以了解依赖项和保管库删除过程。First, read the Before you start section to understand the dependencies and vault deletion process.

  1. 在保管库仪表板菜单中,选择“备份基础结构” 。From the vault dashboard menu, select Backup Infrastructure.

  2. 根据本地方案选择以下选项之一:Depending on your on-premises scenario, choose the one of the following options:

    • 对于 MARS,请依次选择“受保护的服务器”、“Azure 备份代理”。 For MARS, select Protected Servers and then Azure Backup Agent. 然后选择要删除的服务器。Then, select the server that you want to delete.

      对于 MARS,请选择保管库打开其仪表板。

    • 对于 MABS 或 DPM,请选择“备份管理服务器”。 For MABS or DPM, select Backup Management Servers. 然后选择要删除的服务器。Then, select the server that you want to delete.

      对于 MABS,请选择保管库打开其仪表板。

  3. 此时会显示包含警告消息的“删除”窗格。 The Delete pane appears with a warning message.

    “删除”窗格。

    查看警告消息,以及许可复选框中的说明。Review the warning message and the instructions in the consent check box.

    备注

    • 如果受保护的服务器已与 Azure 服务同步,并且备份项存在,则许可复选框将显示相关备份项的数量,以及用于查看备份项的链接。If the protected server is synced with Azure services and backup items exist, the consent check box will display the number of dependent backup items and the link to view the backup items.
    • 如果受保护的服务器未与 Azure 服务同步,并且备份项存在,则许可复选框只会显示备份项的数量。If the protected server is not synced with Azure services and backup items exist, the consent check box will display only the number of backup items.
    • 如果没有任何备份项,则许可复选框将要求确认删除。If there are no backup items, the consent check box will ask for deletion.
  4. 选中许可复选框,然后选择“删除”。 Select the consent check box, and then select Delete.

  5. 查看“通知”图标删除备份数据Check the Notification icon delete backup data. 操作完成后,服务将显示以下消息:正在停止“备份项”的备份并删除备份数据。 After the operation finishes, the service displays the message: Stopping backup and deleting backup data for "Backup Item." 已成功完成该操作”。 Successfully completed the operation.

  6. 在“备份项”菜单中选择“刷新”,确保已删除该备份项。 Select Refresh on the Backup Items menu, to make sure the backup item is deleted.

此过程完成后,可以继续从管理控制台删除备份项:After this process finishes, you can delete the backup items from management console:

从 MARS 管理控制台删除备份项Delete backup items from the MARS management console

  1. 打开 MARS 管理控制台,转到“操作”窗格并选择“计划备份”。 Open the MARS management console, go to the Actions pane, and select Schedule Backup.

  2. 在“修改或停止计划的备份”页中选择“停止使用此备份计划并删除所有存储的备份”选项。 From the Modify or Stop a Scheduled Backup page, select Stop using this backup schedule and delete all the stored backups. 然后,选择“下一步” 。Then, select Next.

    修改或停止计划的备份。

  3. 在“停止计划的备份”页中选择“完成”。 From the Stop a Scheduled Backup page, select Finish.

    停止计划的备份。

  4. 系统会提示输入安全 PIN(个人标识号)。必须手动生成该 PIN。You are prompted to enter a security PIN (personal identification number), which you must generate manually. 为此,请先登录到 Azure 门户。To do this, first sign in to the Azure portal.

  5. 转到“恢复服务保管库” > “设置” > “属性”。Go to Recovery Services vault > Settings > Properties.

  6. 在“安全 PIN”下选择“生成” 。Under Security PIN, select Generate. 复制此 PIN。Copy this PIN. 该 PIN 的有效时间仅为五分钟。The PIN is valid for only five minutes.

  7. 在管理控制台中粘贴该 PIN,然后选择“确定”。 In the management console, paste the PIN, and then select OK.

    生成安全 PIN。

  8. “修改备份进度”页中会显示以下消息: “删除的备份数据会保留 14 天。 该时间过后,备份数据会被永久删除。”In the Modify Backup Progress page, the following message appears: Deleted backup data will be retained for 14 days. After that time, backup data will be permanently deleted.

    删除备份基础结构。

删除本地备份项后,遵循门户中的后续步骤。After you delete the on-premises backup items, follow the next steps from the portal.

从 MABS 管理控制台删除备份项Delete backup items from the MABS management console

可以使用两种方法从 MABS 管理控制台删除备份项。There are two methods you can use to delete backup items from the MABS management console.

方法 1Method 1

若要停止保护并删除备份数据,请执行以下步骤:To stop protection and delete backup data, do the following steps:

  1. 打开 DPM 管理员控制台,在导航栏中选择“保护” 。Open the DPM Administrator Console, and then select Protection on the navigation bar.

  2. 在显示窗格中,选择要删除的保护组成员。In the display pane, select the protection group member that you want to remove. 右键单击并选择“停止对组成员的保护”选项。 Right-click to select the Stop Protection of Group Members option.

  3. 在“停止保护”对话框中选择“删除受保护的数据”,并选中“删除在线存储”复选框。 From the Stop Protection dialog box, select Delete protected data, and then select the Delete storage online check box. 然后选择“停止保护”。 Then, select Stop Protection.

    在“停止保护”窗格中选择“删除受保护的数据”。

    受保护成员状态更改为“非活动副本可用”。 The protected member status changes to Inactive replica available.

  4. 右键单击停用保护组,然后选择“删除停用保护”。 Right-click the inactive protection group and select Remove inactive protection.

    删除非活动保护。

  5. 在“删除非活动保护”窗口中选中“删除在线存储”复选框,然后选择“确定”。 From the Delete Inactive Protection window, select the Delete online storage check box, and then select OK.

    删除在线存储。

方法 2Method 2

打开 MABS 管理控制台。Open the MABS management console. 在“选择数据保护方法”下,清除“我需要在线保护”复选框。 Under Select data protection method, clear the I want online protection check box.

选择数据保护方法。

删除本地备份项后,遵循门户中的后续步骤。After you delete the on-premises backup items, follow the next steps from the portal.

删除恢复服务保管库Delete the Recovery Services vault

  1. 删除所有依赖项后,在保管库菜单中滚动到“概要”窗格。 When all dependencies have been removed, scroll to the Essentials pane in the vault menu.

  2. 确认是否未列出任何“备份项”、“备份管理服务器”或“复制的项”。Verify that there aren't any backup items, backup management servers, or replicated items listed. 如果项仍显示在保管库中,请参阅开始之前部分。If items still appear in the vault, refer to the Before you start section.

  3. 当保管库中没有其他任何项时,在保管库仪表板上选择“删除” 。When there are no more items in the vault, select Delete on the vault dashboard.

    在保管库仪表板上选择“删除”。

  4. 选择“是”确认要删除该保管库 。Select Yes to verify that you want to delete the vault. 随即会删除该保管库。The vault is deleted. 门户返回到“新建”服务菜单。 The portal returns to the New service menu.

使用 PowerShell 删除恢复服务保管库Delete the Recovery Services vault by using PowerShell

首先,请阅读 开始之前 部分,以了解依赖项和保管库删除过程。First, read the Before you start section to understand the dependencies and vault deletion process.

若要停止保护并删除备份数据:To stop protection and delete the backup data:

  • 如果在 Azure VM 备份中使用 SQL 并为 SQL 实例启用了自动保护,请先禁用自动保护。If you are using SQL in Azure VMs backup and enabled auto-protection for SQL instances, first disable the auto-protection.

        Disable-AzRecoveryServicesBackupAutoProtection
           [-InputItem] <ProtectableItemBase>
           [-BackupManagementType] <BackupManagementType>
           [-WorkloadType] <WorkloadType>
           [-PassThru]
           [-VaultId <String>]
           [-DefaultProfile <IAzureContextContainer>]
           [-WhatIf]
           [-Confirm]
           [<CommonParameters>]
    

    详细了解如何对 Azure 备份保护的项禁用保护Learn more on how to disable protection for an Azure Backup-protected item

  • 停止保护并删除云中所有受备份保护的项的数据(例如Stop protection and delete data for all backup-protected items in cloud (ex. laaS VM、Azure 文件共享等):laaS VM, Azure File Share etc.):

       Disable-AzRecoveryServicesBackupProtection
       [-Item] <ItemBase>
       [-RemoveRecoveryPoints]
       [-Force]
       [-VaultId <String>]
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
    

    详细了解如何对备份保护的项禁用保护。Learn more about disables protection for a Backup-protected item.

  • 对于使用 Azure 备份代理 (MARS) 备份到 Azure 的受保护本地文件和文件夹,请使用以下 PowerShell 命令从每个 MARS PowerShell 模块中删除备份的数据:For on-premises Files and Folders protected using Azure Backup Agent (MARS) backing up to Azure, use the following PowerShell command to delete the backed-up data from each MARS PowerShell module:

    Get-OBPolicy | Remove-OBPolicy -DeleteBackup -SecurityPIN <Security Pin>
    

    然后,将显示以下提示:Post which the following prompt would appear:

    Microsoft Azure 备份。确实要删除此备份策略吗?删除的备份数据会保留 14 天。之后,备份数据将永久删除。
    [Y] 是 [A] 全部为“是”[N] 否 [L] 全部为“否”[S] 暂停 [?] 帮助(默认选项为“Y”):
    Microsoft Azure Backup Are you sure you want to remove this backup policy? Deleted backup data will be retained for 14 days. After that time, backup data will be permanently deleted.
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

  • 对于使用 MABS(Microsoft Azure 备份服务器)或 DPM (System Center Data Protection Manager) 在 Azure 中进行保护的本地计算机,请使用以下命令删除 Azure 中的备份数据。For on-premises machines protected using MABS (Microsoft Azure Backup Server) or DPM to Azure (System Center Data Protection Manager), use the following command to delete the backed-up data in Azure.

    Get-OBPolicy | Remove-OBPolicy -DeleteBackup -SecurityPIN <Security Pin>
    

    然后,将显示以下提示:Post where the following prompt would appear:

    Microsoft Azure 备份 确实要删除此备份策略吗?Microsoft Azure Backup Are you sure you want to remove this backup policy? 删除的备份数据会保留 14 天。Deleted backup data will be retained for 14 days. 该时间过后,备份数据会被永久删除。After that time, backup data will be permanently deleted.
    [Y] 是 [A] 全部是 [N] 否 [L] 全部否 [S] 暂停  [?] 帮助 (默认值为 "Y"):*[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):*

删除备份的数据后,取消注册所有本地容器和管理服务器。After deleting the backed-up data, un-register any on-premises containers and management servers.

  • 对于使用 Azure 备份代理 (MARS) 备份到 Azure 的受保护本地文件和文件夹:For on-premises Files and Folders protected using Azure Backup Agent (MARS) backing up to Azure:

    Unregister-AzRecoveryServicesBackupContainer
              [-Container] <ContainerBase>
              [-PassThru]
              [-VaultId <String>]
              [-DefaultProfile <IAzureContextContainer>]
              [-WhatIf]
              [-Confirm]
              [<CommonParameters>]
    

    详细了解如何从保管库中取消注册 Windows 服务器或其他容器。Learn more about un-registering a Windows Server or other container from the vault.

  • 对于使用 MABS(Microsoft Azure 备份服务器)或 DPM (System Center Data Protection Manager) 在 Azure 中进行保护的本地计算机:For on-premises machines protected using MABS (Microsoft Azure Backup Server) or DPM to Azure (System Center Data Protection Manage:

        Unregister-AzRecoveryServicesBackupManagementServer
          [-AzureRmBackupManagementServer] <BackupEngineBase>
          [-PassThru]
          [-VaultId <String>]
          [-DefaultProfile <IAzureContextContainer>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
    

    详细了解如何从保管库中取消注册备份管理容器。Learn more about un-registering a Backup management container from the vault.

永久删除备份的数据并取消注册所有容器后,继续删除保管库。After permanently deleting backed up data and un-registering all containers, proceed to delete the vault.

若要强制删除恢复服务保管库,请执行以下操作:To delete a Recovery Services vault:

    Remove-AzRecoveryServicesVault
   -Vault <ARSVault>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

详细了解如何删除恢复服务保管库。Learn more about deleting a recovery services vault.

使用 CLI 删除恢复服务保管库Delete the Recovery Services vault by using CLI

首先,请阅读 开始之前 部分,以了解依赖项和保管库删除过程。First, read the Before you start section to understand the dependencies and vault deletion process.

备注

目前,Azure 备份 CLI 仅支持管理 Azure VM 备份,因此,仅当保管库包含 Azure VM 备份时,以下命令才能删除保管库。Currently, Azure Backup CLI supports managing only Azure VM backups, so the following command to delete the vault works only if the vault contains Azure VM backups. 如果保管库包含非 Azure VM 类型的任何备份项,则无法使用 Azure 备份 CLI 删除该保管库。You cannot delete a vault using Azure Backup CLI, if the vault contains any backup item of type other than Azure VMs.

若要删除现有的恢复服务保管库,请执行以下命令:To delete existing Recovery services vault, perform the below:

  • 停止保护并删除备份数据To stop protection and delete the backup data

    az backup protection disable --container-name
                             --item-name
                             [--delete-backup-data {false, true}]
                             [--ids]
                             [--resource-group]
                             [--subscription]
                             [--vault-name]
                             [--yes]
    

    有关详细信息,请参阅 此文For more information, see this article.

  • 删除现有的恢复服务保管库:Delete an existing Recovery services vault:

    az backup vault delete [--force]
                       [--ids]
                       [--name]
                       [--resource-group]
                       [--subscription]
                       [--yes]
    

    有关详细信息,请参阅 此文For more information, refer to this article

使用 Azure 资源管理器删除恢复服务保管库Delete the Recovery Services vault by using Azure Resource Manager

仅当已删除所有依赖项后,仍然收到“保管库删除错误”时,才建议使用删除恢复服务保管库的选项。 This option to delete the Recovery Services vault is recommended only if all of the dependencies are removed and you're still getting the Vault deletion error. 请尝试以下任意或所有提示:Try any or all of the following tips:

  • 在“概要”窗格中的保管库菜单内,确认是否未列出任何备份项、备份管理服务器或复制的项。 From the Essentials pane in the vault menu, verify that there aren't any backup items, backup management servers, or replicated items listed. 如果存在备份项,请参阅开始之前部分。If there are backup items, refer the Before you start section.
  • 重试从门户删除保管库Try deleting the vault from the portal again.
  • 如果删除了所有依赖项,但仍收到“保管库删除错误”,请使用 ARMClient 工具执行以下步骤(注释后面的步骤)。 If all of the dependencies are removed and you're still getting the Vault deletion error, use the ARMClient tool to perform the following steps (after the note).
  1. 访问 chocolatey.org 下载并安装 Chocolatey。Go to chocolatey.org to download and install Chocolatey. 然后运行以下命令安装 ARMClient:Then, install ARMClient by running the following command:

    choco install armclient --source=https://chocolatey.org/api/v2/

  2. 登录到 Azure 帐户,然后运行以下命令:Sign in to your Azure account, and then run the following command:

    ARMClient.exe login [environment name]

  3. 在 Azure 门户中,收集所要删除的保管库的订阅 ID 和资源组名称。In the Azure portal, gather the subscription ID and resource group name for the vault you want to delete.

有关 ARMClient 命令的详细信息,请参阅 ARMClient READMEFor more information on the ARMClient command, refer to ARMClient README.

使用 Azure 资源管理器客户端删除恢复服务保管库Use the Azure Resource Manager client to delete a Recovery Services vault

  1. 使用订阅 ID、资源组名称和保管库名称运行以下命令。Run the following command by using your subscription ID, resource group name, and vault name. 如果没有任何依赖项,则运行以下命令时会删除保管库:If you don’t have any dependencies, the vault is deleted when you run the following command:

    ARMClient.exe delete /subscriptions/<subscriptionID>/resourceGroups/<resourcegroupname>/providers/Microsoft.RecoveryServices/vaults/<recovery services vault name>?api-version=2015-03-15
    
  2. 如果保管库不为空,将出现以下错误消息:“由于此保管库中存在现有资源,因此无法删除此保管库。” If the vault is not empty, you'll receive the following error message: Vault cannot be deleted as there are existing resources within this vault. 若要删除保管库中受保护的项或容器,请运行以下命令:To remove a protected item or container within a vault, run the following command:

    ARMClient.exe delete /subscriptions/<subscriptionID>/resourceGroups/<resourcegroupname>/providers/Microsoft.RecoveryServices/vaults/<recovery services vault name>/registeredIdentities/<container name>?api-version=2016-06-01
    
  3. 在 Azure 门户中,确保已删除该保管库。In the Azure portal, make sure that the vault is deleted.

后续步骤Next steps

了解恢复服务保管库Learn about Recovery Services vaults
了解如何监视和管理恢复服务保管库Learn about monitoring and managing Recovery Services vaults