A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
Hello liliheit
Thank you for reaching out Q/A. To safely identify the origin and usage of your storage disks, please follow the standard Q/A steps. These steps cover basic checks
To complement the Q/A steps, you can also perform the following actions to get a more comprehensive view:
- List all disks across the subscription:
az resource list --resource-type "Microsoft.Compute/disks" --query "[].{Name:name, ResourceGroup:resourceGroup, ManagedBy:properties.managedBy, Location:location}" -o table
2.Check disk attachment to virtual machines
az disk list --resource-group <resource-group-name> --query "[].{Name:name, ResourceGroup:resourceGroup, ManagedBy:managedBy}" -o table
Azure PowerShell:
Get-AzDisk | Select-Object Name, ResourceGroupName, ManagedBy
The ManagedBy field indicates the VM the disk is attached to.
2.Inspect last VM attachment / ownership
For disks that are unattached, you can still check metadata for historical context:
az disk show --name <disk-name> --resource-group <rg-name> --query "{Name:name, LastOwnershipUpdate:properties.timeCreated, ManagedBy:managedBy}" -o table
Hope this helps! Please let me know if you have any queries in comments.