查找并删除未附加的 Azure 托管和非托管磁盘 - Azure 门户Find and delete unattached Azure managed and unmanaged disks - Azure portal

删除 Azure 中的虚拟机 (VM) 时,默认不删除附加到 VM 的任何磁盘。When you delete a virtual machine (VM) in Azure, by default, any disks that are attached to the VM aren't deleted. 这有助于防止意外删除 VM 而导致的数据丢失。This helps to prevent data loss due to the unintentional deletion of VMs. 删除 VM 后,可继续支付未附加的磁盘。After a VM is deleted, you will continue to pay for unattached disks. 本文演示了如何使用 Azure 门户查找并删除任何未附加的磁盘,以及如何减少不必要的成本。This article shows you how to find and delete any unattached disks using the Azure portal, and reduce unnecessary costs.

托管磁盘:查找并删除未附加的磁盘Managed disks: Find and delete unattached disks

如果有未附加的托管磁盘,并且不再需要这些磁盘上的数据,可以参照以下过程从 Azure 门户中查找这些磁盘:If you have unattached managed disks and no longer need the data on them, the following process explains how to find them from the Azure portal:

  1. 登录 Azure 门户Sign in to the Azure portal.

  2. 搜索并选择“磁盘”。Search for and select Disks .

    “磁盘”边栏选项卡上会显示所有磁盘的列表。On the Disks blade, you are presented with a list of all your disks. “所有者”列中含有“-”的任何磁盘都是未附加的磁盘 。Any disk that has " - " in the Owner column is an unattached disk.

    托管磁盘边栏选项卡的屏幕截图,如果磁盘的“所有者”列中包含“-”,表明它是一个未附加的磁盘。 Screenshot of the managed disks blade, if a disk has - in the Owner column, it is an unattached disk.

  3. 选择要删除的未附加磁盘,随即会打开磁盘的边栏选项卡。Select the unattached disk you'd like to delete, this opens the disk's blade.

  4. 在磁盘的边栏选项卡上,确认磁盘状态为未附加,然后选择“删除”。On the disk's blade, you can confirm the disk state is unattached, then select Delete .

    单个托管磁盘边栏选项卡的屏幕截图。如果磁盘未附加,此边栏选项卡中的磁盘状态会显示为“未附加”。如果不再需要保留该磁盘的数据,可以删除该磁盘

非托管磁盘:查找并删除未附加的磁盘Unmanaged disks: Find and delete unattached disks

非托管磁盘是指以页 blob 形式存储在 Azure 存储帐户中的 VHD 文件。Unmanaged disks are VHD files that are stored as page blobs in Azure storage accounts.

如果有未附加到 VM 的非托管磁盘,并且不再需要这些磁盘上的数据,要删除它们,可参照以下过程从 Azure 门户中执行相应操作:If you have unmanaged disks that aren't attached to a VM, no longer need the data on them, and would like to delete them, the following process explains how to do so from the Azure portal:

  1. 登录 Azure 门户Sign in to the Azure portal.

  2. 搜索并选择“磁盘(经典)”。Search for and select Disks (Classic) .

    之后会显示所有非托管磁盘的列表。You are presented with a list of all your unmanaged disks. 其“附加到”列中包含“-”的任何磁盘都是未附加的磁盘 。Any disk that has " - " in the Attached to column is an unattached disk.

    非托管磁盘边栏选项卡的屏幕截图。在此边栏选项卡中,“附加到”列中包含“-”的磁盘是未附加的磁盘。

  3. 选择要删除的未附加磁盘,随即会显示磁盘的边栏选项卡。Select the unattached disk you'd like to delete, this brings up the disk's blade.

  4. 在磁盘的边栏选项卡上,可以确认它是未附加的,因为“附加到”仍显示为“-” 。On the disk's blade, you can confirm it is unattached, since Attached to will still be - .

    单个非托管磁盘边栏选项卡的屏幕截图。如果它是未附加的,它的“附加到”的值为“-”。如果不再需要此磁盘数据,可以将其删除。

  5. 选择“删除”。Select Delete .

    单个非托管磁盘边栏选项卡的屏幕截图,其中突出显示了“删除”。

后续步骤Next steps

如果要自动查找和删除未附加的存储帐户,请参阅 CLIPowerShell 文章。If you'd like an automated way of finding and deleting unattached storage accounts, see our CLI or PowerShell articles.

有关详细信息,请参阅删除存储帐户使用 PowerShell 标识孤立磁盘For more information, see Delete a storage account and Identify Orphaned Disks Using PowerShell