删除 Site Recovery 服务保管库Delete a Site Recovery Services vault

本文介绍如何删除 Site Recovery 的恢复服务保管库。This article describes how to delete a Recovery Services vault for Site Recovery. 若要删除用于 Azure 备份的保管库,请参阅删除 Azure 备份保管库To delete a vault used in Azure Backup, see Delete a Backup vault in Azure.

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

开始之前Before you start

必须先删除已注册的服务器以及保管库中的项,然后才能删除保管库。Before you can delete a vault you must remove registered servers, and items in the vault. 需要删除的内容取决于所部署的复制方案。What you need to remove depends on the replication scenarios you've deployed.

删除保管库-Azure VM 到 AzureDelete a vault-Azure VM to Azure

  1. 按照这些说明操作,删除所有受保护的 VM。Follow these instructions to delete all protected VMs.
  2. 然后,删除保管库。Then, delete the vault.

删除保管库-VMware VM 到 AzureDelete a vault-VMware VM to Azure

  1. 按照这些说明操作,删除所有受保护的 VM。Follow these instructions to delete all protected VMs.
  2. 按照这些步骤操作,删除所有复制策略。Follow these steps to delete all replication policies.
  3. 使用这些步骤删除对 vCenter 的引用。Delete references to vCenter using these steps.
  4. 按照这些说明操作,停止使用配置服务器。Follow these instructions to decommission a configuration server.
  5. 然后,删除保管库。Then, delete the vault.

删除保管库-Hyper-V VM(使用 VMM)到 AzureDelete a vault-Hyper-V VM (with VMM) to Azure

  1. 按照这些步骤操作,删除由 System Center VMM 管理的 Hyper-V VM。Follow these steps to delete Hyper-V VMs managed by System Center VMM.
  2. 取消关联并删除所有复制策略。Disassociate and delete all replication policies. 在保管库中执行此操作 > “Site Recovery 基础结构” > “对于 System Center VMM” > “复制策略”。Do this in your vault > Site Recovery Infrastructure > For System Center VMM > Replication Policies.
  3. 按照这些步骤操作,取消注册已连接的 VMM 服务器。Follow these steps to unregister a connected VMM server.
  4. 然后,删除保管库。Then, delete the vault.

删除保管库-Hyper-V VM 到 AzureDelete a vault-Hyper-V VM to Azure

  1. 按照这些步骤操作,删除所有受保护的 VM。Follow these steps to delete all protected VMs.
  2. 取消关联并删除所有复制策略。Disassociate and delete all replication policies. 在保管库中执行此操作 >“Site Recovery 基础结构” > “对于 Hyper-V 站点” > “复制策略”。Do this in your vault > Site Recovery Infrastructure > For Hyper-V Sites > Replication Policies.
  3. 按照这些说明操作,取消注册 Hyper-V 主机。Follow these instructions to unregister a Hyper-V host.
  4. 删除 Hyper-V 站点。Delete the Hyper-V site.
  5. 然后,删除保管库。Then, delete the vault.

使用 PowerShell 强制删除保管库Use PowerShell to force delete the vault

重要

若要测试产品,并对数据丢失并不在意,请使用强制删除方法,快速删除保管库及其所有依赖项。If you're testing the product and aren't concerned about data loss, use the force delete method to rapidly remove the vault and all its dependencies. PowerShell 命令将删除保管库的所有内容,这一步无法撤消 。The PowerShell command deletes all the contents of the vault and is not reversible.

若要删除 Site Recovery 保管库(即使有受保护的项,也不例外),请运行以下命令:To delete the Site Recovery vault even if there are protected items, use these commands:

Connect-AzAccount -Environment AzureChinaCloud

Select-AzSubscription -SubscriptionName "XXXXX"

$vault = Get-AzRecoveryServicesVault -Name "vaultname"

Remove-AzRecoveryServicesVault -Vault $vault

详细了解 Get-AzRecoveryServicesVaultRemove-AzRecoveryServicesVaultLearn more about Get-AzRecoveryServicesVault, and Remove-AzRecoveryServicesVault.