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?
The disk stays in storage but is no longer attached to 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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With