Reputation: 3832
I'm trying to delete recovery vault but it has some old data generated by MARS agents on non-existent machines. There is no UI option to delete those.
I tried Powershell below but it fails with Get-AzureRmRecoveryServicesBackupItem : BackupManagementType is not expected for WorkloadType: AzureVM
Not sure what am I doing wrong
PS Azure:\> Get-AzureRmRecoveryServicesBackupContainer -ContainerType Windows -Status Registered -BackupManagementType MARS
Name ContainerType BackupManagementType
---- ------------- --------------------
tencapsql01. Windows MARS
tencapweb1. Windows MARS
Azure:\converted to MS-AZR-0003P sub
PS Azure:\> $containers = Get-AzureRmRecoveryServicesBackupContainer -ContainerType Windows -Status Registered -BackupManagementType MARS
Azure:\converted to MS-AZR-0003P sub
PS Azure:\> Get-AzureRmRecoveryServicesBackupItem -Container $containers[0] -WorkloadType AzureVM
Get-AzureRmRecoveryServicesBackupItem : BackupManagementType is not expected for WorkloadType: AzureVM
At line:1 char:1
+ Get-AzureRmRecoveryServicesBackupItem -Container $containers[0] -Work ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzureRmRecoveryServicesBackupItem], ArgumentException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.GetAzureRmRecoveryServicesBackupItem
Upvotes: 4
Views: 5569
Reputation: 113
To delete a MARS generated (Azure Backup agent) recovery point in a Recovery Services, vault you can perform the following in the Azure Web Portal UI:
For a more detailed description of the steps above, see: https://learn.microsoft.com/en-us/azure/backup/backup-azure-delete-vault#removing-azure-backup-agent-recovery-points
Upvotes: 0
Reputation: 95
Deleting the backup related to MARS agent is a two step process in Azure Portal.
Let me know if this helps. I can look further if you need Powershell options as well.
Upvotes: 5
Reputation: 1
Before you could delete the RS vault, Ensure all backup job are stopped and There are no items under Backup Management Servere(BMS)/ Protected Servers. If you have any items left there, delete the BMS/Protected Servers associated and then you will be able to delete RS vault. I have tried it. It works for sure! All the Best!
Upvotes: 0
Reputation: 491
Deleting backup data does not remove the retention points you may have kept so, not having any items being actively backed up but still have some GRS data is possible to have.
If you want to force delete regardless of contents, try - The PowerShell cmdlet to delete a recovery vault is “Remove-AzureRmRecoveryServicesVault -Vault ”. To get the vault object using Get-AzureRmRecoveryServicesVault.
Caution: Using the “Remove-AzureRmRecoveryServicesVault” cmdlet will delete the vault irrespective of the contents of the vault. So if there are replicating machines or backed up machines etc. in the vault, these will be lost.
Additionally if there were on-premises assets that were registered to the vault, these would need to be manually cleaned up because clean up cannot be triggered from the vault once it has been deleted.
Upvotes: 0