locked
Cant delete detached blob. RRS feed

  • Question

  • Hi, I created a data 1023GB Disk (awhile ago), attached it to my virtual machine, I have finished using it so now trying to delete it. I have detached it from the VM but when I go into the VHDS container and try to delete that blob it gives the error:

    Failed to delete blob 'vhds/xxx.vhd'. Error: There was an error processing your request. Try again in a few moments.

    Have tried quite a few times, have re-attached/detached and re-tried, all without success.

    That blob is still showing as

    Lease status
    Lease state

    Wednesday, May 17, 2017 4:05 AM

Answers

  • Hi Wayne,

    I worked it out at least for me. Its really quirky, but I was able to delete the VHDs from the Classic Azure Portal.

    https://manage.windowsazure.com

    * Virtual Machines

    * Disks

    * sort by Attached To and you should find your detached disks there and you can just highlight and delete with the button at the bottom.

    Why this works when you cannot delete it from the new Azure portal is beyond me. But I've confirmed in the new portal and the disks are now gone from the storage blob and my VM and disks I want to keep are still there.

    Hope it works for you as well.

    • Marked as answer by Wayne_Jansen Wednesday, May 24, 2017 4:06 AM
    Monday, May 22, 2017 9:21 AM

All replies

  • Refer the below article to troubleshoot errors when you delete Azure storage accounts, containers, VHDs or data disks.

    https://docs.microsoft.com/en-us/azure/storage/storage-resource-manager-cannot-delete-storage-account-container-vhd


    • Edited by vikranth s Thursday, May 18, 2017 3:34 AM
    • Proposed as answer by vikranth s Friday, May 19, 2017 7:46 AM
    Thursday, May 18, 2017 3:33 AM
  • Thanks Vikranth

    I have followed the steps in the link and detached the disk (I dont want to delete the VM, its still in use), but the disk still has a lease on it.

    How do I remove the lease on a disk when it is detached?

    Sunday, May 21, 2017 10:17 PM
  • Wayne, you should unmark Vikranths proposed answer for hopefully a better and quicker response. 

    I got the same issue as you and unable to solve it. I detached 6 disks 3-4 days ago and they are still showing Lease Status Locked. I am not in a position to delete the VM and it still has two VHDs in the same blob that I need to keep but I don't want to pay for these completely redundant disks that I've detached. 

    I'll keep searching for a solution and I'll post here if I find something, I hope you will do the same. 

    Monday, May 22, 2017 8:44 AM
  • even after detaching the disk, if lease status is showing as "locked" then the disk is somehow not released and that's why it is not getting deleted.

    take a look at this PowerShell module which breaks the lease of the given blob.. if lease is broken then you may attempt to delete the disk:

    https://gallery.technet.microsoft.com/How-to-break-the-locked-d01ba283


    cheers..uc
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.

    Monday, May 22, 2017 9:00 AM
  • Hi Wayne,

    I worked it out at least for me. Its really quirky, but I was able to delete the VHDs from the Classic Azure Portal.

    https://manage.windowsazure.com

    * Virtual Machines

    * Disks

    * sort by Attached To and you should find your detached disks there and you can just highlight and delete with the button at the bottom.

    Why this works when you cannot delete it from the new Azure portal is beyond me. But I've confirmed in the new portal and the disks are now gone from the storage blob and my VM and disks I want to keep are still there.

    Hope it works for you as well.

    • Marked as answer by Wayne_Jansen Wednesday, May 24, 2017 4:06 AM
    Monday, May 22, 2017 9:21 AM
  • Thank you, that worked for me.

    I deleted it in the classic portal, this just set it as unlocked and available in the new portal but I could then delete it from there as well (might just of been a delay on the updating though).

    Wednesday, May 24, 2017 4:09 AM