Gregory Suvalian
Gregory Suvalian

Reputation: 3832

How do i delete MARS generated backup items in Recovery Vault

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

enter image description here

Upvotes: 4

Views: 5569

Answers (4)

sramsay
sramsay

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:

  1. In the vault dashboard menu, scroll down to the Manage section, and click Backup Infrastructure.
  2. In the sub-menu, click Protected Servers to view the list of protected server types, including Azure Backup agent.
  3. In the Protected Servers list, click Azure Backup Agent.
  4. In the list of servers, click one to open its menu.
  5. On the selected server's dashboard menu, click Delete.

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

Abhijeet Singh
Abhijeet Singh

Reputation: 95

Deleting the backup related to MARS agent is a two step process in Azure Portal.

  • In step one, you need to go to Recovery Service vault -> Backup items -> Select Backup Items (Azure Backup Agent) -> Select your backed up machine. Now, you won't see the usual delete or stop backup options here like you see while deleting an Azure Virtual Machine. Instead, you need to select the "Computer name" option on this screen and that will give you an option to delete. Follow the usual prompt to delete. Note that I saw two unusual things here while deleting. One, there was a dot at the end of my backed up machine name and I had to make sure to use the dot when Azure asks me to input the name of item to be deleted before deleting the item. Second was hitting delete didn't give any success or failure message. I believe this might be because my backed up machine was shut down or disconnected (I do have not access to it right now).
  • In step two, you need to go to Recovery Service Vault -> Backup Infrastructure -> PROTECTED SERVERS -> Protected Servers (Azure Backup Agent) -> Select your backed up machine. This should give you another delete option on the resulting screen and that completes the deletion process.

Let me know if this helps. I can look further if you need Powershell options as well.

Upvotes: 5

user9571602
user9571602

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

Vikranth S
Vikranth S

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

Related Questions