none
cannot delete a VHD file

    Question

  • Hello,

    I'm trying to delete some unused VHD files, which I believe make my storage account reach the spending limit. Unfortunately, I cannot manage to do that. Here is what I tried:

    1. Delete the file using CloudXplorer

    -> I get an error "Could not delete 'xxxyyyy.vhd'. There is currently a lease on the blob and no lease ID was specified on the request"

    I triple checked that no Disk was associated to this file (both using PowerShell commands and the UI).

    2. I tried the 'BreakLease.ps1' script referenced here:

    http://social.msdn.microsoft.com/Forums/en-US/WAVirtualMachinesforWindows/thread/7381ea0e-0443-4b33-aa12-ba39df003409

    -> I get an error: The blob is still registered as an OS image with name ''.  Please delete the OS image first.

    Any idea how I can cleanup these files ?

    Best regards,

    Bruno

    Tuesday, August 28, 2012 4:27 PM

Answers

  • Ok, I think I know why I cannot delete the files.

    These 2 disks are OS Disks of IMAGES (and no Virtual Machines) I created a month ago. This is why they did not appear in "Virtual Machines -> Disks". I will delete these images, which i don't use anymore.

    Regards,

    Bruno

    • Marked as answer by brunoiw Friday, August 31, 2012 2:17 PM
    Friday, August 31, 2012 2:17 PM

All replies

  • Hello Brunoiw,

    As you have already use BreakLease.ps1 which did not delete your VHD, it is possible that your VHD is still listed in Virtual Image -> disks. Would you please check it?

    So when you delete the VM, the VM configuration is deleted however the OS disk is still left. OS and Data disks are listed in Virtual Image -> disks and if a OS disk which is not associated with any VM or a Data disk which is not attached to any OS disk, such disks are orphan disk as they are not attached to any VM or disk. You can delete the disk directly from portal. After that you can go ahead and delete the disk directly at your Azure Blob Storage.

    Would u please give another try and see if that helps you or you still have problem?

    Regards,


    Avkash Chauhan | Microsoft

    Wednesday, August 29, 2012 3:23 AM
  • Hi Avkash,

    I just checked: the 2 VHD files I want to delete are not listed in "Virtual Image -> disks". I have 2 Disks listed there, and 4 VHD files in CloudXplorer.

    If you give me an email address, I can send you the result of powershell commands and screenshot of CloudXplorer.

    Regards,

    Bruno

    Wednesday, August 29, 2012 4:31 PM
  • Ok, I think I know why I cannot delete the files.

    These 2 disks are OS Disks of IMAGES (and no Virtual Machines) I created a month ago. This is why they did not appear in "Virtual Machines -> Disks". I will delete these images, which i don't use anymore.

    Regards,

    Bruno

    • Marked as answer by brunoiw Friday, August 31, 2012 2:17 PM
    Friday, August 31, 2012 2:17 PM