You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when this flag is set to FALSE instance should not be stopped the first time it is running outside of the period and the next day the instance should be stopped. but that is not happening.
The Log Always shows the below message: From three days I am seeing the same message as below.
2019-09-24 - 22:05:18.837 - DEBUG : [ Instance EC2:i-01f15732e599d50a4 (v428096-devops_lab-77j919u-BMS-EC2-Stdz-lab) ]
2019-09-24 - 22:05:18.837 - DEBUG : Current state is running, instance type is t2.micro, schedule is "CORP_-1800_newyork_daily_stopAll"
2019-09-24 - 22:05:18.837 - DEBUG : Time used to determine desired for instance is Tue Sep 24 18:05:06 2019
2019-09-24 - 22:05:18.838 - DEBUG : Checking conditions for period "CORP_-1800_daily_stopAll"
2019-09-24 - 22:05:18.838 - DEBUG : [running] Weekday "tue" in weekdays (mon-sun)
2019-09-24 - 22:05:18.838 - DEBUG : [stopped] Time 18:05:06 is outside 18:00:00-18:01:00, returned state is stopped
2019-09-24 - 22:05:18.838 - DEBUG : No running periods at this time found in schedule "CORP_-1800_newyork_daily_stopAll" for this time, desired state is stopped
2019-09-24 - 22:05:18.838 - DEBUG : Desired state for instance from schedule "CORP_-1800_newyork_daily_stopAll" is stopped, last desired state was unknown, actual state is running
2019-09-24 - 22:05:18.838 - DEBUG : New instance "EC2:i-01f15732e599d50a4 (v428096-devops_lab-77j919u-BMS-EC2-Stdz-lab)" will not be stopped until next scheduling period
The text was updated successfully, but these errors were encountered:
We are also seeing this problem (we had assumed it was when enforced is also false, but it may be a wider problem than that).
We need this to be working because we often have instances coming up out of hours and we don't want them to be terminated before their user data script has run - but the next 'out of hours' phase it is fine for them to go down. With this set to true, they get shut down before the user data script can complete.
In this file master/source/code/schedulers/instance_scheduler.py
When ever the schedules finds the new instance its simply skipping that instance and not setting the state of the instance to the state table. So, the instance is forever considered as a new instance and is never being stopped.
This can be fixed by setting the state for the instance at line No 300 in master/source/code/schedulers/instance_scheduler.py
add this line self._instance_states.set_instance_state(instance.id, InstanceSchedule.STATE_RUNNING)
Documentation states that
stop_new_instances : Choose whether to stop an instance the first time it is tagged if it is running outside of the running period
Refer : https://s3.amazonaws.com/solutions-reference/aws-instance-scheduler/latest/instance-scheduler.pdf
when this flag is set to FALSE instance should not be stopped the first time it is running outside of the period and the next day the instance should be stopped. but that is not happening.
The Log Always shows the below message: From three days I am seeing the same message as below.
2019-09-24 - 22:05:18.837 - DEBUG : [ Instance EC2:i-01f15732e599d50a4 (v428096-devops_lab-77j919u-BMS-EC2-Stdz-lab) ]
2019-09-24 - 22:05:18.837 - DEBUG : Current state is running, instance type is t2.micro, schedule is "CORP_-1800_newyork_daily_stopAll"
2019-09-24 - 22:05:18.837 - DEBUG : Time used to determine desired for instance is Tue Sep 24 18:05:06 2019
2019-09-24 - 22:05:18.838 - DEBUG : Checking conditions for period "CORP_-1800_daily_stopAll"
2019-09-24 - 22:05:18.838 - DEBUG : [running] Weekday "tue" in weekdays (mon-sun)
2019-09-24 - 22:05:18.838 - DEBUG : [stopped] Time 18:05:06 is outside 18:00:00-18:01:00, returned state is stopped
2019-09-24 - 22:05:18.838 - DEBUG : No running periods at this time found in schedule "CORP_-1800_newyork_daily_stopAll" for this time, desired state is stopped
2019-09-24 - 22:05:18.838 - DEBUG : Desired state for instance from schedule "CORP_-1800_newyork_daily_stopAll" is stopped, last desired state was unknown, actual state is running
2019-09-24 - 22:05:18.838 - DEBUG : New instance "EC2:i-01f15732e599d50a4 (v428096-devops_lab-77j919u-BMS-EC2-Stdz-lab)" will not be stopped until next scheduling period
The text was updated successfully, but these errors were encountered: