How to delete a replicated disk when original disk on the VM has been deleted

Abhinav Hegde 10 Reputation points
2023-10-19T03:19:51.22+00:00

I have created a VM with site recovery enabled on azure. I delete the disk via the API on the original VM. The replication stops working after this because the disk has been removed on the original VM. However, I tried using the API https://learn.microsoft.com/en-us/rest/api/site-recovery/replication-protected-items/remove-disks?tabs=HTTP to remove the replicated disk. Upon making the API request received a 202 response status code along with a url to poll for status in response header. However, upon polling the url, got to know that the remove disk operation had failed. Please let me know ways to delete the replicated disk via API

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,246 questions
Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
644 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Abhinav Hegde 10 Reputation points
    2023-10-19T07:36:04.3866667+00:00

    It is a managed disk, but it is locked by azure site recovery. hence i am unable to delete the disk with the help of above API.

    thanks for your answer

    1 person found this answer helpful.
    0 comments No comments

  2. Sedat SALMAN 13,180 Reputation points
    2023-10-19T05:36:56.7933333+00:00

    first, check the disk type maybe it is managed or unmanaged

    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/azure-iaas-vm-disks-managed-unmanaged

    if it is managed, you can use the following to delete managed disk

    https://learn.microsoft.com/en-us/rest/api/compute/disks/delete?tabs=HTTP

    0 comments No comments