locked
Unable to delete VHD, “There is currently a lease on the blob…” RRS feed

  • Question

  • Hello Azure Community,

    There is a new blog post from the Windows Azure Technical Support Team.
    Unable to delete VHD, “There is currently a lease on the blob…”

    Scenario:

    After deleting a Windows Azure Virtual Machine you try to delete the blobs for the associated VHDs and receive the message below:

    "There is currently a lease on the blob and no lease ID was specified in the request."

    Root Cause:

    When you delete a Virtual Machine on the Management Portal, the "Disk" resource used to mount the Virtual Machines VHD is kept.

    The "Disk" resource is responsible for mounting the blob for the VHD file, so it can be attached to virtual machines as an OS Disk or Data Disk. It will continue to hold a lease on the blob for as long as it exists.

    Resolution:

    You need to delete the "Disk" resource to break the lease on the blob.

    All Disks resources are found on the Management Portal under: Virtual Machines -> Disks

    To delete the Disk resource follow the steps below:

    1. On the Azure Management Portal, navigate to Virtual Machines -> Disks
    2. Select the Disk you want to delete.
    3. Confirm there is no Virtual Machine listed on the "Attached to" column
      1. Disks are detached from a deleted VM asynchronously, it may take a few minutes after the VM is deleted for this field to clear up.
    4. Click "Delete" and choose if you want to "Retain the associated VHD" or "Delete the associated VHD"
      1. If you choose to "Retain the associated VHD" the lease will be removed but the blog containing the VHD will be kept in your Storage Account. You may choose this option if you plan to delete the VHD directly from your storage account VHDs container, create a new Disk pointing to the existing VHD, download to your on-premises environment or just leave it there for future use.

    References:

    How to Attach a Data Disk to a Virtual Machine
    How to Detach a Data Disk from a Virtual Machine

    Hope it helps.

    Flavio Muratore
    Sr. Support Escalation Engineer
    Windows Azure Technical Support


    Flavio Muratore Sr. Support Escalation Engineer Windows Azure Technical Support



    Tuesday, February 5, 2013 11:37 PM

All replies

  • Dear Flavio Muratore,

    Thank you for posting here!


    Monday, February 11, 2013 8:37 AM
  • Update:

    Scenario: Unable to delete the disk because it shows attached to a Virtual Machine that was already deleted.

    Solution1: Wait some time. Disks are unlink from the Virtual Machines assynchronously. Normaly it takes less than 5 minutes, we recommend waiting 2 hours at the most.

    Solution 2: If taking longer than 2 hours, report the problem on the forum. Microsoft support will have to manually clear this for you.

    Root Cause: the root cause of this problem has already been resolved, but the solution will not resolve the problems of already affected VM deletions. We do not expect new events to happen.


    Flavio Muratore Sr. Support Escalation Engineer Windows Azure Technical Support

    Tuesday, February 19, 2013 4:04 AM