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
557 stars 279 forks source link

RDS cluster schedule behaviour #588

Open trevorrea opened 5 days ago

trevorrea commented 5 days ago

Description

Hi,

Can you explain the behaviour of instance scheduler with the stopped schedule? The behaviour I am seeing is that the instance scheduler seems to be starting RDS clusters tagged with the stopped schedule at the start of the maintenance window. So if the maintenance window is 0.5 hours a week then clusters run for that length of time.

We have clusters that we wish to retain in a stopped state permanently and need to permanently schedule these in a stopped state.

In the previous 1.x version we set a schedule with a start time of 8am to 8.05am on a Sunday which enabled us to keep them in a powered off state and they were not automatically started for the duration of the maintenance window and this enabled us to get around the limitation where RDS clusters start after being stopped for 7 days.

This did not work in 3.x as when they were started for the maintenance window they were not powering off.

So we reverted to using the stopped schedule which is also not serving our needs.

To Reproduce

Turn RDS cluster off and set it to use stopped schedule

Expected behavior

I would expect the instance scheduler to not automatically start the RDS cluster for the maintenance window and to respect the schedule set ie. 8am to 8.05am on a Sunday.

Please complete the following information about the solution:

Screenshots

N/A

Additional context

I know this repository is not really for "support" but I've already openerd an AWS support ticket and they weren't able to assist

CrypticCabub commented 4 days ago

Hi @trevorrea,

Thanks for reporting this issue. The behavior is that enabled maintenance windows take highest priority over regular schedule behavior and so an active maintenance window will force-override the state of the instance to running even if the schedule is stopped. Once the window ends, control is returned to the schedule and the instance should be shut back down if the schedule state is still stopped.

Normally this would be controlled by a use-maintenance-windows flag on the schedule configuration, but this flag is not currently operable in 3.0.x which would be a regression from the 1.5.x release. I have added a bugfix for this flag to our backlog to be included in the next patch release.

As for the support issue, next time you can tell the support engineer to route it to the AWS Solutions team and we should be able to help assist with the more complex issues.

trevorrea commented 1 day ago

Thank you @CrypticCabub. I'll keep a eye out for the bugfix. Re: AWS support I opened the ticket under Service = Solutions and Category = Instance Scheduler on AWS (Linux) and it was routed to the EC2 Linux team then from there to the RDS team.

It's not an issue now but if you want to look into what happened with the routing of the ticket I can e-mail you the ticket number directly.