aws-solutions / instance-scheduler-on-aws

A cross-account and cross-region solution that allows customers to automatically start and stop EC2 and RDS Instances
https://aws.amazon.com/solutions/implementations/instance-scheduler-on-aws/
Apache License 2.0
541 stars 264 forks source link

Instances dont start or stop #480

Closed mike23101994 closed 11 months ago

mike23101994 commented 1 year ago

HI Team,

We are currently using AWS Instance Scheduler for scheduling our instances.We have used CloudFormation template to create all the infrastructure. The issue which we are facing is:- We have a partition key name "schedule" in the DynamoDB and the sort key for that partition key is "GlobalOfficeHoursSchedule", so all the ec2 and rds instances have the tag Schedule= GlobalOfficeHoursSchedule..it is stopping the instances.. But now when we have added another partition key "schedule" with the sort key as "DevOpsOfficeHoursSchedule", it is not starting or stopping the instances with the tag Schedule= DevOpsOfficeHoursSchedule . I have raised an AWS Support ticket..they have suggested to delete the rds and ec2 instance information from the state table. On doing that it worked to stop the instances..but it didnt start the instances later.

CrypticCabub commented 1 year ago

Hi Mike, could you share the configuration of DecOpsOfficeHoursSchedule (both the schedule and periods)?

It's possible that a misconfiguration of the schedule could be causing it to not be loaded by the scheduler. If I remember correctly, there should be an error in the orchestrator logs pertaining to the invalid configuration.

Clearing the state table will have the effect of resetting Instance Scheduler's knowledge of historical instance state data which primarily used for ensuring instance_scheduler does not override manual customer action when it is not supposed to (such as for the retain running flag and schedules with enforce = false).

CrypticCabub commented 11 months ago

Closing because stale, please re-open if you are able to provide any more detail