Virtual Machine Scale Set Instance Status Change Events

Savides, Paul 1 Reputation point
2021-08-05T21:06:21.1+00:00

I am currently developing a system that needs to have some decently accurate idea of the current state of a virtual machine scale set. I currently have it implemented by just polling the azure management apis. However, a bit concerned with the rate limits on the compute services particularly. So, need to set the poll intervals quite infrequently.

So, is there any ability to subscribe to Azure Virtual Machine status change events?

E.g., when an instance changes from status Running >> Deleting or when an instance goes from Running >> Updating is there some easy way to subscribe to events for that?

I have seen auto scale notifications and there are some resource group level events in the event grid that seem to sort of allow that functionality. However, based upon some testing, the auto scale events really only cover a small avenue for state changes. Specifically if an image version is updated you receive no information. Resource events in event grid could cover the gaps but the delay on the event grid events for VMSS changes seems to be something like 1-2 minutes so its not very useful for what i'm looking to develop.

Overall, is there a best solution here that i'm missing? An easy way to subscribe to all state change events for instances in a VM scale set? Or, are the auto scale events / polling the azure management apis approach the best options out there?

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
355 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 21,506 Reputation points MVP
    2021-08-06T10:18:21.94+00:00

    Hi,
    Have you looked at autoscale logs and metrics if they will fit your needs? You can send them to Log Analytics, Storage account or Event Hub depending on the integration you are looking for.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments