opened
SnoWolfT
username_0
Need the notification of Eviction of spot VMSS on Portal. I make some research and find the similar concern as below. There is no answer or plan for this feature yet. It's appreciated if you can suggest whether we have any plan for the Eviction notification! Or do we have any feature and achieve that?

https://docs.microsoft.com/en-us/answers/questions/165844/terminate-event-notification-for-spot-instances.html

https://feedback.azure.com/forums/34192--general-feedback/suggestions/42055621-support-terminate-notification-for-spot-instances


In additional, there is one feature for the terminate notification for VMSS as below. But this isn’t suitable for the low-priority VMSS. 
https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-terminate-notification

I use the regular VMSS to have a try. After I click "Delete" of one instance, I can receive the scheduled event as below. 
====
tomzhu@aks-tompool-39923754-vmss00000D:~$ curl -H Metadata:true http://169.254.169.254/metadata/scheduledevents?api-version=2019-08-01
{"DocumentIncarnation":1,"Events":[{"EventId":"C37355DB-2C23-4195-90CA-1A712A85650C","EventStatus":"Scheduled","EventType":"**Terminate**","ResourceType":"VirtualMachine","Resources":["aks-tompool-39923754-vmss_13"],"NotBefore":"Tue, 09 Feb 2021 11:55:39 GMT","Description":"","EventSource":"Platform"}]}
====

If I enable the simulate eviction and query the schedule event within the instance of spot VMSS, I receive the event as below. 
https://docs.microsoft.com/en-us/rest/api/compute/virtualmachinescalesetvms/simulateeviction#code-try-0
====
tomzhu@test1t46400000A:~> curl -H Metadata:true http://169.254.169.254/metadata/scheduledevents?api-version=2019-08-01
{"DocumentIncarnation":1,"Events":[{"EventId":"CDDA70DC-537F-4151-8F2F-9FDB3EB961DB","EventStatus":"Scheduled","EventType":"**Preempt**","ResourceType":"VirtualMachine","Resources":["test1_10"],"NotBefore":"Tue, 09 Feb 2021 12:09:38 GMT","Description":"","EventSource":"Platform"}]}
====

We can see the EventType is "Preempt", not "Terminate". May I know when the real eviction happens, is the EventType "Preempt"? Can we use this to EventType for the notification of Eviction?


---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: a1bd5076-fe52-cfca-4173-dec861167812
* Version Independent ID: 0122fff1-79e0-446c-00a4-85248a21b6dc
* Content: [Create a scale set that uses Azure Spot VMs - Azure Virtual Machine Scale Sets](https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/use-spot)
* Content Source: [articles/virtual-machine-scale-sets/use-spot.md](https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/virtual-machine-scale-sets/use-spot.md)
* Service: **virtual-machine-scale-sets**
* Sub-service: **spot**
* GitHub Login: @username_2
* Microsoft Alias: **username_2**
Need the notification of Eviction of spot VMSS on Portal
issue
created
ChaitanyaNaykodi-MSFT
username_1
Hello @username_0, 
Thank you for your feedback! We will review and update as appropriate.
comment
created
cynthn
username_2
@JagVeerappan
comment
created
VikasPullagura-MSFT
username_3
@JagVeerappan 
Can you please check and add your comments on this request.
comment
created
cynthn
username_2
I've added some new information about simulating evictions here: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/spot-powershell#simulate-an-eviction. It includes what the response will look like and the `"EventType":"Preempt"` and not terminate.

If this content isn't helpful, or you have more questions, feel free to reopen the item or create a new one.

#please-close
comment
closed
PRMerger12
username_4
issue