我在AWS Instance Scheduler上遇到一些问题。我遵循了AWS提供的设置指南,并相信正确地遵循了它们。但是,计划不起作用,日志文件状态为:
WARNING : Skipping instance EC2:i-******* in region eu-west-2 for account *******, schedule name "uk-office-hours" is unknown
我的“期间”配置设置为在08:00启动实例,在周一至周五18:00停止实例:
{
"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"]}
}
这里是“时间表”配置:
{
"description": {"S": "Office hours in UK"},
"name": {"S": "uk-office-hours"},
"periods": {"SS": ["uk-office-hours"]},
"timezone": {"S": "Europe/London"},
"type": {"S": "schedule"}
}
我已经尝试过使用“ config”和标记名,调度程序似乎确实以所需的间隔运行,但是找不到调度程序。我曾尝试使用“句点”和“时间表”配置名称,但仍然没有乐趣。
我还使用scheduler-cli创建了“ schedules”和“ periods”,但是我收到了相同的响应。我可以使用CLI查询所有计划,并且在响应中列出所有计划,但是按名称检索计划时,找不到它。
# scheduler-cli describe-schedule-usage --stack InstanceScheduler --region eu-west-2 --name uk-office-hours
Not found: schedule uk-office-hours does not exist
我想念什么吗?非常感谢您的帮助。
[我想我可能已经找到了解决方案,“时间表”不喜欢单个的“时期”,所以我创建了开始和开始时间段。...
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"
}
}
请让我知道您是否有更好的解决方案!