Reputation: 529
Newbie user playing with Azure Linux VMs, and finding that deleting the VM (a necessary step to stop the billing meter) leaves storage remnants that are hard to identify and distinguish from blobs I want to keep (supporting VM images and data disks, for instance).
So I really have two questions:
1) What's the right sequence of steps (from the Azure CLI, preferrably) to remove a VM and it's associated OS disk from storage?
2) Has anyone built a mapping tool can unravel the dependencies among VM images, data disks, OS disks, and storage blobs?
And obviously, it would be nice if I could also resolve those pesky "lease errors" I see when I try to delete what I think is an unused blob.
Many thanks.
Upvotes: 2
Views: 314
Reputation: 13077
You can use the Azure Service Management REST API to find the media associated with VMs that you create. First call List Hosted Services to find all of your VMs (and other Azure service types you may have created). Then call Get Hosted Service Properties for the service you're interested in with the embed-detail
parameter set to true
. The response will include details on the OS disk and data disk, if any, being used by the VM, including the disk name, media link, source image name, and OS.
The Azure Server Management REST API has many other capabilities that you could use to build a pretty full featured VM management tool. However, it is in Beta like the rest of the Azure VM program, so be prepare for some surprises.
Upvotes: 2