instance-scheduler-on-aws icon indicating copy to clipboard operation
instance-scheduler-on-aws copied to clipboard

Two periods defined in schedule, only one period is working

Open prandelicious opened this issue 4 years ago • 2 comments

I have the following periods defined:

{
   "Periods": [
      {
         "Begintime": "10:00",
         "Description": "period-1",
         "Endtime": "23:59",
         "Name": "period1",
         "Type": "period"
      }
   ]
}

{
   "Periods": [
      {
         "Begintime": "00:00",
         "Description": "period-2",
         "Endtime": "03:00",
         "Name": "period2",
         "Type": "period"
      }
   ]
}

and the schedule:

{
   "Schedules": [
      {
         "UseMaintenanceWindow": false,
         "StopNewInstances": true,
         "UseMetrics": false,
         "Timezone": "Asia/Manila",
         "Hibernate": false,
         "Enforced": false,
         "RetainRunning": false,
         "Description": "Test schedule, delete after use",
         "Periods": [
            "period1",
            "period2"
         ],
         "Name": "testing",
         "Type": "schedule"
      }
   ]
}

but when I simulate the usage, it gives me this:

{
   "Schedule": "testing",
   "Usage": {
      "2020-07-16": {
         "RunningPeriods": {
            "Period1": {
               "Begin": "07/16/20 03:00:00",
               "End": "07/16/20 23:59:00",
               "BillingHours": 21,
               "BillingSeconds": 75540
            }
         },
         "BillingSeconds": 75540,
         "BillingHours": 21
      },
      "2020-07-17": {
         "RunningPeriods": {
            "Period1": {
               "Begin": "07/17/20 03:00:00",
               "End": "07/17/20 23:59:00",
               "BillingHours": 21,
               "BillingSeconds": 75540
            }
         },
         "BillingSeconds": 75540,
         "BillingHours": 21
      },
      "2020-07-18": {
         "RunningPeriods": {
            "Period1": {
               "Begin": "07/18/20 03:00:00",
               "End": "07/18/20 23:59:00",
               "BillingHours": 21,
               "BillingSeconds": 75540
            }
         },
         "BillingSeconds": 75540,
         "BillingHours": 21
      },
      "2020-07-19": {
         "RunningPeriods": {
            "Period1": {
               "Begin": "07/19/20 03:00:00",
               "End": "07/19/20 23:59:00",
               "BillingHours": 21,
               "BillingSeconds": 75540
            }
         },
         "BillingSeconds": 75540,
         "BillingHours": 21
      },
      "2020-07-20": {
         "RunningPeriods": {
            "Period1": {
               "Begin": "07/20/20 03:00:00",
               "End": "07/20/20 23:59:00",
               "BillingHours": 21,
               "BillingSeconds": 75540
            }
         },
         "BillingSeconds": 75540,
         "BillingHours": 21
      }
   }
}

Only Period1 is recognized.

prandelicious avatar Jul 16 '20 08:07 prandelicious

Hi @prandelicious , I apologize for this issue. Can you please confirm whether actual scheduling of instance is working as expected. Also I will add this to our future release backlog as a bug fix for 'scheduler-cli describe-schedule-usage' command.

Thanks, Praveen

praveenis avatar Jul 17 '20 20:07 praveenis

when scheduling these adjacent periods are merged to avoid a stop in between the two periods

alex1969-prog avatar Aug 24 '20 21:08 alex1969-prog