none
Cannot Remove Disk. VM Is Already Deleted, Service Is Already Deleted, VHD Is Already Deleted. What To Do?

    Question

  • Hi There, 

    I am a little stuck. I managed to find myself in a situation where I have a disk that cannot be deleted.

    1. VM has been deleted
    2. Service has been deleted
    3. VHD has been deleted

    I have confirmed that all of these are deleted from Powershell.

    I have a disk though that does not want to delete/remove. 

    Get-AzureDisk

    PS C:\temp> Get-AzureDisk
    VERBOSE: 2:57:26 p.m. - Begin Operation: Get-AzureDisk
    VERBOSE: 2:57:26 p.m. - Completed Operation: Get-AzureDisk
    
    
    AffinityGroup        :
    AttachedTo           : RoleName: BRYANT
                           DeploymentName: BRYANT
                           HostedServiceName: ts-bryant
    IsCorrupted          : False
    Label                :
    Location             : West US
    DiskSizeInGB         : 250
    MediaLink            : https://xx.blob.core.windows.net/vhds/BRYANT-BRYANT-0929-1.vhd
    DiskName             : BRYANT-BRYANT-0-201309290329590354
    SourceImageName      :
    OS                   :
    OperationDescription : Get-AzureDisk
    OperationId          : 0f04debb-44b1-4df5-a595-372e697b9b8d
    OperationStatus      : Succeeded

    Remove-AzureDisk

    PS C:\temp> Remove-AzureDisk -DiskName BRYANT-BRYANT-0-201309290329590354
    VERBOSE: 3:00:06 p.m. - Begin Operation: Remove-AzureDisk
    Remove-AzureDisk : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 400. Service
    Management Error Code: BadRequest. Message: A disk with name BRYANT-BRYANT-0-201309290329590354 is currently in use by
    virtual machine BRYANT running within hosted service ts-bryant, deployment BRYANT.. Operation Tracking ID:
    355d7d90ce414dad8f228af801d63d91."
    At line:1 char:1
    + Remove-AzureDisk -DiskName BRYANT-BRYANT-0-201309290329590354
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Remove-AzureDisk], ServiceManagementClientException
        + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.RemoveAzureDiskCommand

    Get-AzureVM

    PS C:\temp> Get-AzureVM
    
    ServiceName                             Name                                    Status
    -----------                             ----                                    ------
    ts-hooker                               HOOKER                                  StoppedDeallocated
    ts-mueller                              MUELLER                                 StoppedDeallocated

    Remove-AzureVM

    PS C:\temp> Remove-AzureVM
    
    cmdlet Remove-AzureVM at command pipeline position 1
    Supply values for the following parameters:
    (Type !? for Help.)
    Name: BRYANT
    ServiceName: ts-bryant
    VERBOSE: 3:05:12 p.m. - Begin Operation: Get Deployment
    PS C:\temp>

    Any ideas on what I can do to remove the disk? Have run out of ideas!

    Thanks

    • Edited by Jiriteach Monday, September 30, 2013 2:42 AM
    Monday, September 30, 2013 2:06 AM

Answers

  • Managed to resolve this issue thanks to the awesome team at Microsoft. The disk had to be disassociated from the VM on the backend and then I was able to run Remove-AzureDisk as per normal.

    Thanks

    • Marked as answer by Jiriteach Monday, September 30, 2013 5:52 AM
    Monday, September 30, 2013 5:52 AM

All replies

  • Managed to resolve this issue thanks to the awesome team at Microsoft. The disk had to be disassociated from the VM on the backend and then I was able to run Remove-AzureDisk as per normal.

    Thanks

    • Marked as answer by Jiriteach Monday, September 30, 2013 5:52 AM
    Monday, September 30, 2013 5:52 AM
  • Thanks for your sharing, It is common issue, hope it didn't happened
    Monday, September 30, 2013 6:09 AM
  • Who did you contact in MS to resolve this? I have the same problem with 3 disks and 2 VMs

    Thanks

    Paul

    Tuesday, December 03, 2013 6:59 AM