Skip to content

VM Scheduler

The VM scheduler manages the Pexip Infinity VMs by starting them during service hours and deallocating them outside service hours. This reduces Azure compute costs while keeping the Verify-by-Video service available during operating hours.

The active production scheduler is the Azure Function App func-pexip-vm-scheduler-prod. The older GitHub Actions VM scheduling workflows are deprecated and should remain disabled unless the Function App scheduler is intentionally rolled back.

EnvironmentManagement NodeConference Node
Testvm-node-mgmt-testvm-node-conf-test
Productionvm-node-mgmt-corevm-node-conf-core

Production scheduling targets:

  • vm-node-mgmt-core in RG-NODE-MANAGEMENT
  • vm-node-conf-core in RG-NODE-CONFERENCE

The production scheduler uses the Azure Functions NCRONTAB expression:

0 5,25,35,55 * * * *

This runs at :05, :25, :35, and :55 every hour. Service hours are read from the IAS /video/v2/service_hours endpoint and evaluated with the scheduler’s pre/post service-hours buffer.

For example, if service hours are 07:00-17:00 America/Vancouver and the scheduler uses a 1-hour buffer, the target VM-on window is 06:00-18:00 Pacific. Because the timer runs at fixed minutes, the practical start and stop actions usually occur on the first scheduler run after the boundary, such as 06:05 and 18:05.

During maintenance windows, disable only the timer function so the Function App does not automatically start or deallocate VMs. This keeps the HTTP manual trigger available for one-off operations.

Terminal window
az functionapp config appsettings set \
--resource-group rg-application \
--name func-pexip-vm-scheduler-prod \
--settings AzureWebJobs.timer_scheduler.Disabled=true

Confirm the app setting:

Terminal window
az functionapp config appsettings list \
--resource-group rg-application \
--name func-pexip-vm-scheduler-prod \
--query "[?name=='AzureWebJobs.timer_scheduler.Disabled']"

If the Function App should be fully stopped, use the Azure Portal or az functionapp stop, but note that this also disables manual HTTP operations.

Re-enable the timer function after the maintenance window:

Terminal window
az functionapp config appsettings set \
--resource-group rg-application \
--name func-pexip-vm-scheduler-prod \
--settings AzureWebJobs.timer_scheduler.Disabled=false

Confirm that timer_scheduler appears in the function list:

Terminal window
az functionapp function list \
--resource-group rg-application \
--name func-pexip-vm-scheduler-prod \
--query "[].name" \
-o table

The Function App exposes a manual HTTP trigger for controlled one-off actions. Use this during maintenance if the VMs need to remain on outside service hours.

Supported actions:

ActionEffect
scale_upStarts the configured VMs without running the longer post-start workflow
scale_downDeallocates the configured VMs
post_startRuns the downstream post-start workflow separately

Manual operations require the Function App key and should be run only by authorized operators.

The old workflow files still exist in the repository for history:

WorkflowPrevious EnvironmentStatus
vm-start-stop-test.ymlTestDeprecated
vm-start-stop-prod.ymlProductionDeprecated

Do not re-enable these workflows unless the scheduler Function App has been intentionally disabled as part of a rollback.

If a test Function App such as pexip-vm-scheduler-test-func exists in Azure, confirm whether it is still required for test VM scheduling. It should either be documented as the active test scheduler or decommissioned if it was only used for validation.