Virtual Machine disks are attached to a machine that no longer exists



    Continuation of the above issue..

    I've deleted a machine via power shell but the disks are still associated with the old machine.  I also see a disk there that belongs to a machine that was deleted a couple of weeks ago through the management console.  Is there any way to resolve the associations? 

    I'd like to delete the one disk that belongs to the older server but I need to retain a couple of disks that pertain to the server mentioned in the above referenced thread where I was trying to resolve an unknown state by deleting and recreating the machine through power shell.

    Tuesday, July 17, 2012 9:00 PM


All replies

  • I also experienced this issue yesterday, and was hoping it might rectify itself overnight.  I also deleted a VM, but the two disks (one OS, one Data) are still showing as attached to the non-existent VM.  Can't delete the disk, or the blob, and I see no way in the portal of clearing this phantom attachment...
    Tuesday, July 17, 2012 10:38 PM
  • I found the command to use to remove these disks using the Windows Azure Powershell cmdlets:

    Remove-AzureDisk -DiskName <string> -DeleteVHD


    OperationDescription       OperationId                OperationStatus
    --------------------       -----------                ---------------
    Remove-AzureDisk           xxxxxxxx-xxxx-xxxx-xxxx... Succeeded

    It took a bit of fiddling around with management certificates to get the Get-AzureDisk cmdlet working, but once that is done this removed both the disks from the portal, and the associated VHD files from blob storage.

    Here are the steps I used:

     C:\PS>$subID = <Subscription ID>
     C:\PS>$thumbprint = <Certificate Thumbprint>
     C:\PS>$myCert = Get-Item cert:\\CurrentUser\My\$thumbprint
     C:\PS>Set-AzureSubscription -SubscriptionName "MySub" -SubscriptionId $subID -Certificate $myCert

    Then Get-AzureDisk works and you can proceed with removing the disk(s).

    Wednesday, July 18, 2012 12:22 AM
  • -- It took a bit of fiddling around with management certificates to get the Get-AzureDisk cmdlet working

    Michael Washam has an excellent post on how to use the new PowerShell cmdlets.

    Wednesday, July 18, 2012 7:03 AM
  • Thanks Simon, that allowed me to remove the disks I no longer want but now I have to figure out how to remove the associations to the disks I need to recreate my server they told me to delete and recreate.

    Wednesday, July 18, 2012 12:59 PM
  • Unfortunately that didn't work for me. The Remove-AzureDisk basically gives me the same error message that the Portal gave me:

    Remove-AzureDisk : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 400. Service Manage
    ment Error Code: BadRequest. Message: A disk with name SP2013LabADB01-SP2013LabADB01-0-201306181050230924 is currently
    in use by virtual machine SP2013LabADB01 running within hosted service SP2013LabADB01, deployment SP2013LabADB01.. Oper

    This close to calling Microsoft support...

    Thursday, August 01, 2013 11:20 AM
  • Same here, "disk with name XYZ is currently in use".
    Thursday, November 21, 2013 5:57 PM
  • I've got the exact same problem. All my machines were stuck in "Starting" status, so I basically deleted them after a few hours and started to recreate my environment by creating new disks and new VMs. Interestingly, my old disks are still attached to the now non-existant VMs and can't be deleted.
    Friday, November 22, 2013 6:40 AM
  • Same for me. Any solutions found so far?
    Friday, November 22, 2013 3:23 PM
  • Same for me. Any solutions found so far?

    Same problem... any answer from microsoft support ?


    • Proposed as answer by Kaysoft Thursday, December 05, 2013 12:31 AM
    • Unproposed as answer by Kaysoft Thursday, December 05, 2013 12:31 AM
    Wednesday, December 04, 2013 3:20 PM
  • APG_AS, were you successful in removing associations to disks?  I have the same problem.  Any help is appreciated.
    Thursday, December 05, 2013 12:42 AM
  • Same issue here.  VM deleted, associated cloud service deleted.  I even managed to delete the VHDs by breaking the lease.  But the disks are still attached to the non-existent vm, and no amount of fiddling in the mgmt console or PowerShell will remove them.

    I copied the VHDs and made a new VM and disks, using the same DNS name.  This was created fine and the VM and disks deleted fine, without any phantom deleted VM.

    I contacted Microsoft support who wouldn't help me (give me tech support) unless I paid for support.  I'm not going to pay for support, when it's clearly a bug.

    If anyone else discovers a viable solution, I'd love to hear it.

    Friday, December 06, 2013 8:42 PM
  • I'have same problem. I do not want to delete the disk, but only the association.

    there is a solution?

    ........ after 30 minutes

    all right. I just had to wait half an hour. The association is removed automatically.


    Wednesday, January 14, 2015 11:08 AM