title: Windows Azure - Orphaned Disk. VHD and VM have already been removed
body: <p>In the Azure management console, under Virtual Machines > Disks, I see 2 disks that both say they are attached to virtual machines.  However, those virtual machines have already been deleted.  Additionally, the disk blob vhds have already been deleted.  So now I'm left with 2 ghost disks that cannot be removed.  I'm unsure what the impact of leaving these is, and I want to remove them.  When I try to remove them with remove-azuredisk, I get an error.  I'm aware of the BreakLease.ps1 script that people have referenced to break a lease on a VHD in order to delete the VHD, but in my case there is no VHD.  The BreakLease.ps1 script appears to accept only URI as parameter, but I do not have a URI since this is not a VHD/blob.  </p>
  
  <p>Does anyone have any ideas on how to get rid of these orphaned disk objects?</p>
  
  <p>Thanks!</p>
  
  <pre><code>PS C:\&gt; get-azuredisk | where-object {$_.diskname -like "*memb*"} | select diskname
  VERBOSE: 2:35:33 PM - Begin Operation: Get-AzureDisk
  VERBOSE: 2:35:34 PM - Completed Operation: Get-AzureDisk
  
  DiskName
  --------
  coco2008memb3-coco2008memb3-0-201307022204430928
  coco2008memb5-coco2008memb5-0-201307022204540471
  
  
  PS C:\&gt; get-azuredisk | where-object {$_.diskname -like "*memb*"} | remove-azuredisk
  VERBOSE: 2:35:56 PM - Begin Operation: Get-AzureDisk
  VERBOSE: 2:35:57 PM - Completed Operation: Get-AzureDisk
  VERBOSE: 2:35:57 PM - 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 coco2008memb3-coco2008memb3-0-201307022204430928 is
  currently in use by virtual machine coco2008memb3 running within hosted service coco2008memb3, deployment
  coco2008memb3.. Operation Tracking ID: 8a8ab4956d5948ec9c23ec047259d086."
  At line:1 char:61
  + get-azuredisk | where-object {$_.diskname -like "*memb*"} | remove-azuredisk
  +                                                             ~~~~~~~~~~~~~~~~
      + CategoryInfo          : CloseError: (:) [Remove-AzureDisk], ServiceManagementClientException
      + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.RemoveAzureDiskCommand
  
  VERBOSE: 2:35:58 PM - 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 coco2008memb5-coco2008memb5-0-201307022204540471 is
  currently in use by virtual machine coco2008memb5 running within hosted service coco2008memb5, deployment
  coco2008memb5.. Operation Tracking ID: 69471c6e365e4dbca7ab714dfaddbe98."
  At line:1 char:61
  + get-azuredisk | where-object {$_.diskname -like "*memb*"} | remove-azuredisk
  +                                                             ~~~~~~~~~~~~~~~~
      + CategoryInfo          : CloseError: (:) [Remove-AzureDisk], ServiceManagementClientException
      + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.RemoveAzureDiskCommand
  </code></pre>