Managing Instance Termination - Leveraging Amazon EC2 Spot Instances at Scale

Managing Instance Termination

Spot offers three features to help you better track and control when Spot Instances run and terminate (or stop/hibernate).

  • Termination notices – If you need to save state, upload final log files, or remove Spot Instances from Elastic Load Balancing before interruption, you can use termination notices, which are issued two minutes prior to interruption. To learn more about managing interruptions, see Spot Instance Interruptions.

  • Persistent requests – You can opt to set your request to remain open so that a new instance will be launched in its place when the instance is interrupted. You can also have your Amazon EBS-backed instance stopped upon interruption and restarted when Spot has capacity at your preferred price. To learn more about persistent and one-time requests, see Spot Instance Request States.

  • Block durations – If you need to execute workloads continuously for 1–6 hours, you can also specify a duration requirement when requesting Spot Instances. To learn more about block durations for Spot Instances, see Specifying a Duration for Your Spot Instances.