-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintenance window's "NextExecutionTime" is updated as soon as execution begins, causing instances to be shut down at the next scheduler interval #101
Comments
Hi George - Again, sorry for the delay on this :) Let me get a test environment set up so I can run through this scenario specifically, and then update this issue with findings. |
Hi George, have you had a chance to test this? |
@georgematthew , I tried to reproduce the issue. I was only able to reproduce if I had error in setting up Here is a working example of a schedule
The
The instance scheduler first tests if the instance has a maintenance window (here, I was wondering if you can confirm that you have used both |
This issue should now be resolved. Please let us know if this is not the case. |
@tapughose And the scheduler kept your instance running for the duration of the maintenance window? This issue is still occurring for me in v1.3. I'm seeing the same behavior that I describe above. Here is my schedule:
and the period:
and I've pasted the scheduler logs below, where you can see that the scheduler successfully detects the maintenance window and starts the instance at 18:20. When the scheduler runs again at 18:25, it leaves the instance in the running state. When the scheduler runs at 18:30, which is the start of the 2hr maintenance window, it shuts the instance down while the maintenance window is still
Is there a check that is done to see if the |
@georgematthew, yes.. the scheduler kept my instance running for the duration of the maintenance window. I will make a |
@tapughose I tried blowing away the scheduler stack and redeploying with the newest version, no luck. I experienced the same behavior that I describe above. @georgebearden I don't yet consider this issue resolved. The instance scheduler is not keeping instances running for the duration of the maintenance window when configured with the schedule/period I have posted above. I would consider this issue resolved if someone is able to point to an error in the configuration I have posted above or an update is released that resolves the issue with the provided configuration. Please let me know if I can provide any additional debugging information. Thank you. |
I can confirm I am seeing the exact same behavior as @georgematthew. |
I am also experiencing the same problem with the scheduler immediately turning off an instance after it has been start for a maintenance window. |
This issue has been fixed in the release 1.3.1. Please deploy the latest template to get the updated code. |
Hi, Thanks, |
After working around #99 and #100, I am still unable to use the SSM maintenance window functionality. I've attempted to outline the behavior I am seeing below. Please let me know if I can elaborate on anything.
The instances that are configured with a schedule that references a maintenance window are started at least 10 minutes before the maintenance window based on the schedule/period created from the maintenance window's
NextExecutionTime
. The running period is 2 hours in duration, as expected. This matches the maintenance window duration.The SSM maintenance window tasks begin. By this time the instances are running and recognized by SSM. I am executing Run Command tasks to run the
AWS-UpdateSSMAgent
andAWS-RunPatchBaseline
documents.At the next scheduler interval (10 minutes later, for example), the instances are stopped because the scheduler has created a new schedule/period based on the maintenance window's updated
NextExecutionTime
. It appears that the previously created period/schedule is overwritten and the scheduler believes that the desired state is "stopped". In my case, theNextExecutionTime
is one week in the future, as the maintenance window is scheduled once per week. This causes the pending Run Command tasks to fail and tasks that have yet to start to reportNoInstancesInTag
.The expected behavior is that the scheduler would keep the instances running for the duration of the maintenance window.
Is this a bug in the scheduler's maintenance window functionality or am I failing to understand something about how this solution is intended to be used?
The text was updated successfully, but these errors were encountered: