Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Azure: Delete disk attached to non-existent VM

Just found out I was taking up - and paying for - a lot of storage due to abandoned disks from long ago deleted VMs. I manged to delete most of them, but now I'm stuck with a set that cannot be deleted as they remain attached to VMs nowhere to be found.

Any ideas how to get rid of these disks, PowerShell tricks maybe?

like image 969
flensted Avatar asked Feb 01 '13 19:02

flensted


People also ask

When removing an Azure virtual machine what happens to attached data Disks?

The disk stays in storage but is no longer attached to a virtual machine.

How do I remove a disk from a virtual machine?

Select a virtual machine in the Virtual Machine Library window and click Settings. In the Settings window, click the hard disk to remove from the virtual machine. Under Advanced options, click Remove Hard Disk. In the confirmation window, select the option for removing the hard disk.

How do I detach an Azure VM disk?

On the VM Overview page, select Disks under Settings in the left navigation. On the Disks page, under Data disks, select the data disk you want to detach. On the data disk's page, select Detach, and then select OK.


3 Answers

If I am understanding correct, Once you delete a Virtual Machine, it delete the service but keep a copy of the VHD image under Disks. So please go to the Disks tab under virtual Machine and try to delete it.

If that is not the case, please add a screenshot with error message from where your trying to delete VM.

like image 157
AbhishekAnand Avatar answered Oct 10 '22 02:10

AbhishekAnand


The only way to do this that I can see is through PowerShell. I ran into the same problem and here's how I fixed it. I installed the Azure PowerShell extensions and configured my subscription and then my storage account. Once I did that I then ran this command

get-azuredisk | Remove-AzureDisk

Get-azuredisk will grab all disks In my case I needed all of them removed. If you need to do individual then you need to get the name of the disk and then run remove-azuredisk with the name switch and specify the disk name to remove it. That fixed it for me. Hope this helps someone in the future.

like image 30
Mike Avatar answered Oct 10 '22 00:10

Mike


In the "new" Azure portal. Select Storage Accounts, then click on the storage account" where your none used VHD's are located, Click Blobs under Services, Click vhds under Essentials, search for unwanted vhd and click delete.

like image 33
MightyMeatBoots Avatar answered Oct 10 '22 01:10

MightyMeatBoots