Delete a Site Recovery Services vault

This article describes how to delete a Recovery Services vault for Site Recovery. To delete a vault used in Azure Backup, see Delete a Backup vault in Azure.

Note

This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. For 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.

Delete a vault-Azure VM to Azure

  1. Follow these instructions to delete all protected VMs.
  2. Then, delete the vault.

Delete a vault-VMware VM to Azure

  1. Follow these instructions to delete all protected VMs.
  2. Follow these steps to delete all replication policies.
  3. Delete references to vCenter using these steps.
  4. Follow these instructions to decommission a configuration server.
  5. Then, delete the vault.

Delete a vault-Hyper-V VM (with VMM) to Azure

  1. Follow these steps to delete Hyper-V VMs managed by System Center VMM.
  2. Disassociate and delete all replication policies. Do this in your vault > Site Recovery Infrastructure > For System Center VMM > Replication Policies.
  3. Follow these steps to unregister a connected VMM server.
  4. Then, delete the vault.

Delete a vault-Hyper-V VM to Azure

  1. Follow these steps to delete all protected VMs.
  2. Disassociate and delete all replication policies. Do this in your vault > Site Recovery Infrastructure > For Hyper-V Sites > Replication Policies.
  3. Follow these instructions to unregister a Hyper-V host.
  4. Delete the Hyper-V site.
  5. Then, delete the vault.

Use PowerShell to force delete the vault

Important

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. The PowerShell command deletes all the contents of the vault and is not reversible.

To delete the Site Recovery vault even if there are protected items, use these commands:

Connect-AzAccount

Select-AzSubscription -SubscriptionName "XXXXX"

$vault = Get-AzRecoveryServicesVault -Name "vaultname"

Remove-AzRecoveryServicesVault -Vault $vault

Learn more about Get-AzRecoveryServicesVault, and Remove-AzRecoveryServicesVault.