如何删除 Azure Stack Hub 上具有依赖项的 VM(虚拟计算机)How to delete a VM (virtual machine) with dependencies on Azure Stack Hub

本文介绍了在 Azure Stack Hub 中删除 VM 及其依赖项的步骤。In this article you can find the steps to remove a VM and its dependencies in Azure Stack Hub.

如果从 Azure Stack Hub 中删除了 VM,相关的组件依赖项(即数据磁盘、虚拟网络接口和诊断容器)仍会保留在资源组中。If you remove a VM from Azure Stack Hub, the component dependencies, that is data disks, virtual network interfaces, and diagnostic containers, will remain in the resource group. 这些项不会随 OS 光盘一起自动删除。These items won't be automatically deleted along with your OS disc.

“删除 VM”概述Delete a VM overview

创建新 VM 时,通常会创建一个新资源组,并在该资源组中放入所有依赖项。When you create a new VM you typically create a new resource group and put all the dependencies in that resource group. 如果想删除 VM 及其所有依赖项,可以删除整个资源组。When you want to delete the VM and all its dependencies you can delete the resource group. Azure 资源管理器将处理依赖项以成功删除它们。The Azure Resource Manager will handle the dependencies to successfully delete them. 有时无法通过删除资源组来删除 VM。There are times when you cannot delete the resource group to remove the VM. 例如,VM 可能包含某些资源,这些资源不是 VM 的依赖项,但你希望保留。For example, the VM may contain resources that are not dependencies of the VM that you would like to keep.

删除带依赖项的 VMDelete a VM with dependencies

如果无法删除资源组,要么依赖项不在同一资源组中,要么存在其他资源,请按照以下步骤操作:In the case where you cannot delete the resource group, either the dependencies are not in the same resource group, or there are other resources, follow the steps below:

  1. 打开 Azure Stack 用户门户。Open the Azure Stack user portal.

  2. 选择“虚拟机”。Select Virtual machines. 查找虚拟机,然后选择计算机以打开虚拟机边栏选项卡。Find your virtual machine, and then select your machine to open the Virtual machine blade.
    删除带依赖项的 VMDelete VM with dependencies

  3. 记下包含 VM 和 VM 依赖项的资源组。Make a note of the resource group that contains the VM and VM dependencies.

  4. 选择“网络”并记下网络接口。Select Networking and make note of the networking interface.

  5. 选择“磁盘”并记下 OS 磁盘和数据磁盘。Select Disks and make note of the OS disk and data disks.

  6. 返回到“虚拟机”边栏选项卡,并选择“删除” 。Return to the Virtual machine blade, and select Delete.

  7. 键入 yes 以确认删除,然后选择“删除”。Type yes to confirm the delete and select Delete.

  8. 选择“资源组”,然后选择资源组。Select Resource groups and then select the resource group.

  9. 通过手动选择依赖项然后选择“删除”来删除依赖项。Delete the dependencies by manually selecting them and then select Delete.

    1. 键入 yes 以确认删除,然后选择“删除”。Type yes to confirm the delete and select Delete.
    2. 等待资源完全删除。Wait for the resource to be completely deleted.
    3. 然后,你可以删除下一个依赖项。You can then delete the next dependency.

后续步骤Next steps

Azure Stack Hub VM 功能Azure Stack Hub VM features