删除具有所有关联资源的VM [英] Delete VM with all associated resources

查看:99
本文介绍了删除具有所有关联资源的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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆