Skip to main content

Configure Infrastructure Scheduling

This document aims to provide required information to understand how to use the infrastructure scheduling service provided by the TDF. Required vocabulary is available in the Glossary.


Introduction

Every Azure subscription provided by the TDF can be onboarded with the infrastructure scheduling service. This service aim to orchestrate automatic stop and start of Virtual machines located in your subscription. This service was designed to help TDF BL customer to reduce Azure costs and carbon footprint by stopping virtual machines when not used. From an Azure billing point of view, a month last 730 hours. If we can stop a virtual machine during non-business hours and during the weekend, we can reduce the billable time of our virtual machines. If we can even shutdown our virtual machines during the weekend, we can reduce the billable time up to 50% (if we consider a normal business day with 16 hours).

The infrastructure scheduling service provided by the TDF was designed to help you to organize proper shutdown and startup of workloads composed of multiple virtual machines only by configuring tags.


Onboarding your Azure subscription

By default, the Azure subscription provided by the TDF is not automatically onboarded for this service. The infrastructure scheduling service will be looking for a specific tag named "VMCostEfficiencyService". Accepted tag values are:

  • enable
  • disable

By configuring the VMCostEfficiencyService tag with "enable" value, your Azure subscription will be automatically processed by the infrastructure scheduling during the next hour.


Onboarding your virtual machines

By default, the Infrastructure scheduling service will process the virtual machines only if the required mandatory tags are presents. The service will be looking for the following tags:

  • VMCostOptimisation
  • WeekStartSchedulePeriod
  • StartSequence
  • WeekStopSchedulePeriod
  • StopSequence
  • WeekEndStop

Tag VMCostOptimisation

This is a mandatory tag. Infrastructure scheduling service will only process virtual machine having this tag configured with "enable" value. Virtual machine that do not have this tag or with a different value will not be processed. Configuring tag value with "disable" value, will exclude this specific virtual machine from the process.

Tag WeekStartSchedulePeriod

This is a mandatory tag required to configure the start period. Expected value is an hour such as 08am, 08pm. Note that time must be configured in UTC not local time.

Virtual machine having the same value for WeekStartSchedulePeriod and WeekStopSchedulePeriod will be excluded of the infrastructure scheduling service because a virtual machine can't start and stop at the same time.

Tag StartSequence

When an application is composed of multiple virtual machines, we must be able to organize a proper start sequence. This tag is used to link a virtual machine to a group. The infrastructure scheduling service will start all virtual machines sharing the same StartSequence value before processing the next sequence. By default, the expected value is 1. In a multi-layer application, backend services hosted on virtual machines would be configured with the lower start sequence and the front-end part of the application would be configured with a higher value.

Consider the following scenario, an application composed of two virtual machines as front-part of an application and a single virtual machine as back-end part of the same application. Table bellow document the infrastructure scheduling related tag configuration:

VM NameVMCostOptimisationWeekStartSchedulePeriodStartSequenceWeekStopSchedulePeriodStopSequenceWeekEndStop
Back1enable07am107pm2on
Front1enable07am207pm1on
Front2enable07am207pm1on

All virtual machines are configured for infrastructure scheduling and will start at 07am. Virtual machine named Back1 will start first (with the lowest start sequence value), then virtual machines named front1 & front2 will be started after, in the same group. Virtual machines configured with the same StartSequence tag value will be considered as a group and will be started at the same time.

At time of writing, the is no limitation on the sequence value. When processing the start sequence, process search for the highest values used by virtual machines in your subscription.

Tag WeekStopSchedulePeriod

This is a mandatory tag required to configure the stop period. Expected value is an hour such as 08am, 08pm. Note that time must be configured in UTC not local time.

Tag StopSequence

When an application is composed of multiple virtual machines, we must be able to organize a proper stop sequence. This tag is used to link a virtual machine to a group. The infrastructure scheduling service will stop all virtual machines sharing the same StopSequence value before processing the next sequence. By default, the expected value is 1. In a multi-layer application, backend services hosted on virtual machines would be configured with the higher stop sequence and the front-end part of the application would be configured with a lower value.

Consider the following scenario, an application composed of two virtual machines as front-part of an application and a single virtual machine as back-end part of the same application. Table bellow document the infrastructure scheduling related tag configuration:

VM NameVMCostOptimisationWeekStartSchedulePeriodStartSequenceWeekStopSchedulePeriodStopSequenceWeekEndStop
Back1enable07am107pm2on
Front1enable07am207pm1on
Front2enable07am207pm1on

All virtual machines will be stopped at 07pm. Virtual machines front1 & front2 will be stopped first in parallel (with the lowest stop sequence value and sharing the same value), then virtual machine named back1 will be stopped after. Virtual machines configured with the same StopSequence tag value will be considered as a group and will be stopped at the same time.

At time of writing, the is no limitation on the sequence value. When processing the stop sequence, process search for the highest values used by virtual machines in your subscription.

Tag WeekEndStop

This tag is designed to enable or disable the infrastructure scheduling service during the weekend. Two values are accepted: "on" and "off". Virtual machines configured with the with the WeekEndStop tag to "on" will be stopped Saturday & Sunday. Virtual machines will be stopped on Saturday 00AM and restarted on Monday 00am.


logs (To be available in 2022)

TDF BL consumers will be able to monitor service activity. Logs are stored in a shared Azure subscription, in a dedicated Storage Account, logs are organized per subscription and period. A new set of logs is generated each hour :

  • logvmmain
  • logvmstart
  • logvmstop

The logvmmain is the main log, describing the status of each virtual machine, the start/stop action that will be performed according to tags. If a virtual machine is not processing, the reason will be provided in this log. In illustration bellow we have one example on the logvmmain generated every hour. This log will provide you the following information:

  • hour of the start / stop operation
  • Number of virtual machines found in your Azure subscription
  • Number of virtual machines excluded from the infrastructure scheduling
  • Status of each virtual machine before start / stop operations
  • Status of each virtual machine after start / stop operations

Main log

The logvmstart log will focus only on the startup of targeted virtual machines. The logvmstop log will focus only on the shutdown of targeted virtual machines.


FAQ

How many sequence can I use to organize start & stop operations?

At time of writing, the is no limitation on the sequence value. When processing the start/stop sequence, process search for the highest values used by virtual machines in your subscription for the StartSequence & StopSequence tags values

How many virtual machines can be linked to a single sequence?

The is no limitation, on number of virtual machines to be processed by the infrastructure scheduling service.

Can I disable the infrastructure scheduling service ?

You can disable the infrastructure scheduling service at two level:

  • At subscription level by configuring the VMCostEfficiencyService tag with value disable
  • At virtual machine level by configuring the VMCostOptimisation tag with value disable

How can I check if Infra scheduling service is running on my Azure subscription

The Infra Scheduling service parse Azure TDF subscription with tags VMCostEfficiencyService configured to enable. If configured, a Service principal named tdp-prd-sp-infra-scheduling will be reading configuration of your virtual machines, searching for the required tags. A virtual machine will only be processed if a tag named VMCostOptimisation is configured with On value.