Stop only schedule (with manual start) not working
See original GitHub issueHi, I’m trying to implement a “stop only” schedule for my instances. The goal is to stop all instances at 10pm every day and leave them in stopped state until someone starts them manually (and stop them again automatically at 10pm). I naively created a single period and schedule for that:
scheduler-cli create-period --stack scheduler-stack --name stop-22 --endtime 22:00
scheduler-cli create-schedule --stack scheduler-stack --name stop-22 --periods stop-22
The first time the scheduler runs, it stops the instances at 22h00 as expected. So far, so good. The problem is: if I restart the instance manually, it never gets stopped again by the scheduler. After investigation, this is because the scheduler saves the “stopped” state in DynamoDB state table.
Thus, if I start the instance and remove the key in DynamoDB, then the scheduler stops the instance. But I don’t want to have to explicitely remove the DynamoDB key each time I restart my instance…
Thus the question is: can the current implemention of the scheduler allow doing this: stop only and without touching the DynamoDB ?
I guess that if I ask the scheduler to start the instance just before stopping it, this will work but ideally I would want to avoid to start the instances just for the stop to be working.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13
Top GitHub Comments
Unlike #77, I don’t want to use the
override-status
. This would stop all tagged instances at next interval check. I just want (if possible) to have a schedule that makes sure tagged instances are stopped at a given time. Theoverride-status
cannot help for that.@madhavvishnubhatta i faced the same problem, schedule with option
enforced
solves it, you can update this option withtrue
value manually in DynamoDB item, or create schedule with this option like thisscheduler-cli create-schedule --stack InstanceScheduler --name QuickSchedule --periods QuickPeriod --enforced
you can read about this option in docs in sectionSchedule definitions
.