如何使用 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 Resource Manager 將會處理相依性,以成功刪除這些相依性。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. 選取 [ 磁片 ],並記下作業系統磁片和資料磁片。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