I'm having some issues with the AWS Instance Scheduler. I have followed the setup guides provided by AWS and believe to have followed them correctly. However, the schedules are not working and the log files state:
WARNING : Skipping instance EC2:i-******* in region eu-west-2 for account *******, schedule name "uk-office-hours" is unknown
My "period" configuration is set to start the instances at 08:00 and stop the instances at 18:00 Monday to Friday:
{
"begintime": {"S": "08:00"},
"description": {"S": "Office Hours UK"},
"endtime": {"S": "18:00"},
"name": {"S": "uk-office-hours"},
"type": {"S": "period"},
"weekdays": {"SS": ["mon-fri"]}
}
Here is the "schedule" configuration:
{
"description": {"S": "Office hours in UK"},
"name": {"S": "uk-office-hours"},
"periods": {"SS": ["uk-office-hours"]},
"timezone": {"S": "Europe/London"},
"type": {"S": "schedule"}
}
I have tried playing around with the "config" and tag names, the scheduler does seem to be running at the required intervals but cannot find the schedule. I have tried playing around with the "period" and the "schedule" configuration names but still no joy.
I have also created "schedules" and "periods" using the scheduler-cli but I am receiving the same responses. I can query all schedules using the CLI and listed within the response but when retrieving the schedule by name then it cannot be found.
# scheduler-cli describe-schedule-usage --stack InstanceScheduler --region eu-west-2 --name uk-office-hours
Not found: schedule uk-office-hours does not exist
Am I missing something? Any help is highly appreciated.
In my opinion, we can use CloudWatchLog to check the config
CloudWatch > CloudWatch Logs > Log Groups > (your schedule logs)
At the first time, I got the same message from Scheduler-ec2-xxxx "Not found: schedule xxxx does not exist" also I couldn't see my custom schedule and period on the InstanceScheduler DEBUG part. CloudWatchEventHandler showed ERROR about time and timezone format, and after fixed it, those things were displayed on InstanceScheduler DEBUG part, and working fine with EC2 and RDS.
I think I might have found a solution, the "schedule" didn't like the single "period" so I created a start and start period....
schedstart
{
"begintime": {
"S": "08:00"
},
"endtime": {
"S": "23:59"
},
"name": {
"S": "schedstart"
},
"type": {
"S": "period"
},
"weekdays": {
"SS": [
"mon-fri"
]
}
}
schedstop
{
"begintime": {
"S": "00:00"
},
"endtime": {
"S": "18:00"
},
"name": {
"S": "schedstop"
},
"type": {
"S": "period"
},
"weekdays": {
"SS": [
"mon-fri"
]
}
}
schedstop
{
"description": {
"S": "Office hours in UK"
},
"name": {
"S": "uk-office-hours"
},
"periods": {
"SS": [
"schedstart",
"schedstop"
]
},
"timezone": {
"S": "Europe/London"
},
"type": {
"S": "schedule"
}
}
Please let me know if you have a better solution!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With