Reputation: 3020
I do not see that there is way to specify shutdownBehavior for spot instances. It only gives option to configure interruption behavior.
I would like to know, how to i terminate spot instance from within, once the task is done. is "shutdown -h now" is enough ?
Upvotes: 0
Views: 298
Reputation: 270224
Yes, a spot instance can self-terminate with sudo shutdown now -h
. (I just tried it, it worked!)
I notice that the Spot Request hangs around, with a status of instance-terminated-by-user, so you might want to delete it.
An alternative method would be for the instance to call describe-spot-instance-requests
to discover its spot request ID (sir-
) and then call cancel-spot-instance-requests
. That would also terminate the instance, and would also cancel the spot request.
Upvotes: 1