I wasn't happy with existing solutions for clean shutdown of Azure Spot VMs so I put together this tiny service application that does basically what all those scripts do, but with way less resources and without continuously launching scripting engines.
It's nothing groudbreaking really. It detects that eviction is pending, usually 30s in advance, so it gives 10s notice and then initiates shutdown, properly noting the reason to Event Log.
It's open source and just a handful of lines of code, but way lighter than executing heavy script every second.
I wasn't happy with existing solutions for clean shutdown of Azure Spot VMs so I put together this tiny service application that does basically what all those scripts do, but with way less resources and without continuously launching scripting engines.
It's nothing groudbreaking really. It detects that eviction is pending, usually 30s in advance, so it gives 10s notice and then initiates shutdown, properly noting the reason to Event Log.
It's open source and just a handful of lines of code, but way lighter than executing heavy script every second.