删除具有所有关联资源的VM

编程入门 行业动态 更新时间:2024-10-24 16:25:59
本文介绍了删除具有所有关联资源的VM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

删除虚拟机时,我希望虚拟机的相关资源也被删除(网络接口,公共IP等)

When I delete a VM I would expect its related resources to be deleted too (Network interface, public IP etc.)

之后手动删除单个资源很麻烦.删除资源组会删除所有内容,但是如果我不想删除该资源组中的其他VM,这不是一个选择.

Manually deleting the individual resources afterwards is cumbersome. Deleting the resource group would delete everything but this isnt an option if I have other VM's in the resource group I do not want to delete.

对此有更好的解决方案吗?

Is there a better solution for this?

推荐答案

与VM关联的资源在删除VM时不会自动删除,主要是这样,您可以-如果需要,请使用它们,例如,如果要删除VM,但要使用相同的VHD等重新创建VM,这可能会很烦人. 知道您要删除VM和关联的资源.除了手动删除所有内容外,您实际上只有2个选项

Resource associated with the VM do not get deleted automatically when you delete the VM, primarily this is so you can re-use them if required, for example if you are deleting a VM but want to re-create it with the same VHD etc. This can be annoying if you know you want to delete the VM and associated resources. Other than manually deleting everything you really only have 2 options

1.删除资源组-这有助于在这里将资源组的范围缩小到尽可能小

1. Delete the resource group - it helps here to scope your resource groups as small as possible to help make this possible

2.编写脚本以为您删除虚拟机和资源,一个很好的例子是

2. Script something to delete teh VM and resources for you, a good example is here

有一个用户语音项目对此问题开放,因此您可能需要对此进行投票.

There is a uservoice item open for this issue so you may want to vote on that.

更多推荐

删除具有所有关联资源的VM

本文发布于:2023-10-28 08:33:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536109.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:资源   VM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!