Support EC2 Spot Instances
If a spot instance is tagged with a schedule, an entire batch of instances, even non-spot, will not stop per their schedule.
This is the error logged in CloudTrail: The instance '[InstanceID]' is a spot instance and may not be stopped." userAgent: InstanceScheduler-aws-scheduler-main-2.2.2.0
The requestParameters in the logged event seem to contain all the other instances that are impacted in the batch.
Per module, ec2_service.py, default STOP_BATCH_SIZE is 50. From the behavior I'm seeing, if a spot instance is present in a batch, all the instances in a batch will not be stopped by the Scheduler.
A possible workaround may be to set STOP_BATCH_SIZE to 1 if an environment has spot instances. Ideally, a spot instance with a schedule would not impact multiple instances that are batched up by Scheduler.
Spot instances are not officially supported by the Scheduler in the current release.
Sure, Scheduler doesn't need to support spot instances. But, if a spot instance is tagged with a schedule, Scheduler is then broken. With an autotagging policy, this can easily happen. So something to think about with a future release possibly?
I may test the workaround of a STOP_BATCH_SIZE of one to limit impact to non-spot batches. The performance impact may be minimal with a small number of instances. I'll post the results if I proceed.
Thank you
Setting the batch size is an option if you expect to incidentally tag unsupported spot instances. However this will increase the number of API calls with the risk of being throttled. As we have customers that schedule large number EC2 Instances setting the batch size to 1 will seriously increase the risk of throttling.
On 7 Mar 2019, at 23:16, wallabyies <[email protected]mailto:[email protected]> wrote:
Sure, Scheduler doesn't need to support spot instances. But, if a spot instance is tagged with a schedule, Scheduler is then broken. With an autotagging policy, this can easily happen. So something to think about with future release possibly?
I may test the workaround of a STOP_BATCH_SIZE of one to limit impact to non-spot batches. The performance impact may be minimal with a small number of instances. I'll post the results if I proceed.
Thank you
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/awslabs/aws-instance-scheduler/issues/76#issuecomment-470718570, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACBiexlgnPvvQjujcTAOx9RYCn4uJnlVks5vUY_MgaJpZM4bkJFR.
Please up-vote if you want this feature. Do not submit a new feature request.