- Newest
- Most votes
- Most comments
-
Timezone Configuration: The output from
scheduler-cli describe-schedulesshows that you have multiple schedules with different timezones. The "scale-up-down" schedule is set to UTC, while "seattle-office-hours" is set to Pacific. Ensure that the schedule you're using for your instance has the correct timezone. -
Instance Tags: The tags you've listed for your instance (i-03f564b2f1721f297) don't include a "Schedule" tag. This is crucial for the Instance Scheduler to work. You need to add a tag with the key "Schedule" and the value of your schedule name (e.g., "mon-fri-7-9").
-
Region Issues: The error you encountered when trying to create a period suggests you're using an incorrect region format. AWS regions don't include availability zones (like eu-central-1b). Use just "eu-central-1" as the region.
-
Instance Stopping Issue: The fact that your instance can't be stopped manually and restarts on its own suggests it might be part of an Auto Scaling group or managed by Elastic Beanstalk. This could interfere with the Instance Scheduler's ability to stop the instance.
-
CloudWatch Logs: If you're not seeing any stop actions in the CloudWatch Logs for the scheduler Lambda, it might indicate that the scheduler isn't attempting to stop the instance at all, possibly due to the missing Schedule tag.
Recommendations:
-
Add the correct Schedule tag to your instance:
aws ec2 create-tags --resources i-03f564b2f1721f297 --tags Key=Schedule,Value=mon-fri-7-9 --region eu-central-1 -
Verify your schedule configuration:
scheduler-cli describe-schedules --stack ec2FlaskInstanceScheduler --region eu-central-1 -
Check if your instance is part of an Auto Scaling group or Elastic Beanstalk environment. If so, you may need to adjust your approach to scheduling.
-
Review the Instance Scheduler's IAM roles and policies to ensure it has the necessary permissions to stop your instance.
-
Check the CloudWatch Logs for the Instance Scheduler Lambda function to see if there are any error messages or indications of why it's not stopping the instance.
If these steps don't resolve the issue, you may need to involve AWS support to investigate further, especially regarding the instance that can't be stopped manually.
Sources
Scheduled Start and Stop of EC2 Instance: Start Works, but Stop Does Not | AWS re:Post
Troubleshooting - Instance Scheduler on AWS
Sample schedules - Instance Scheduler on AWS
Relevant content
asked 2 years ago
asked 3 years ago
