简体   繁体   English

我可以使用哪些挂钩来检测Azure IaaS的VM关闭事件?

[英]What hooks can I use to detect a VM Shutdown event with Azure IaaS?

I'm working on an automation tool whereby I need to trap events that are occurring within an Azure subscription. 我正在使用自动化工具,因此需要捕获Azure订阅中发生的事件。

Taking an Azure VM as an example - how can I trap a shutdown event for a single VM so that for example, a web service is called? 以Azure VM为例-如何捕获单个VM的关闭事件,例如,调用Web服务?

Azure Scheduled Events (in Preview at time of post) is your best bet. 最好的选择是Azure计划的事件 (在发布时为“预览”)。 This is built upon the Azure Instance Metadata Service (also in Preview at time of post) which surfaces historic and up-coming information from within the VM, allowing you to proactively react to events. 这是基于Azure实例元数据服务 (也在发布时在预览中)构建的,该服务从VM内部显示历史和即将出现的信息,从而使您可以主动响应事件。

To my knowledge, there's no way to monitor for events such as this from outside the VM, however this article provides some great code examples which could be run from within the VM that you could use to trigger an alert/action outside the VM if you needed to. 据我所知,有没有办法来监控像这样的活动从VM外面,但是这个文章提供了可以从虚拟机中运行一些伟大的代码示例,你可以用它来触发虚拟机,如果你外面警报/动作需要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM