Task 07: Configure Time Synchronization (NTP)
The automated OS configuration run covers this task in the Time step (NTP peers equal networking.ntp_servers). Use the manual steps below when you can't use the run, or to understand or troubleshoot what it does. See how the run works.
DOCUMENT CATEGORY: Runbook
SCOPE: Time synchronization
PURPOSE: Configure w32tm with the NTP server frominfrastructure.ymlso all cluster nodes synchronize to the same authoritative time source — required for Kerberos, Active Directory, and Arc registration
MASTER REFERENCE: Phase 03: OS Configuration
Status: Active Estimated Time: 5 minutes per node / 10 minutes orchestrated (all nodes)
Overview
All Azure Local nodes must synchronize time from the same NTP source before AD domain join and Arc
registration. Kerberos authentication fails when clock skew exceeds five minutes. This task
configures the Windows Time service (w32tm) on each node, restarts the service, forces an
immediate resync, and validates the resulting stratum.
What the steps do:
- Configure w32tm with the NTP servers from
networking.ntp_servers - Restart the Windows Time service
- Force an immediate resync (
w32tm /resync /force) - Verify the resulting sync status and stratum — warn if stratum 16 (unsynchronized)
Prerequisites
| Requirement | Description | Source |
|---|---|---|
| Task 06 complete | DNS client verified and functional | Task 06: Verify DNS |
| NTP server address | FQDN or IP of the authoritative NTP server | infrastructure.yml: networking.ntp_servers |
| Local admin rights | Required to restart Windows Time service | Node credentials |
Configuration Reference
infrastructure.yml path | Script variable | Example |
|---|---|---|
networking.ntp_servers | $NTPServer (Direct tab), the NTP peers of the Time step | 192.0.2.4 |
nodes[].management.ip_address | The address the OS configuration connects to | 192.0.2.11 |
nodes[].name | The node | iic-azl-n01 |
networking.ntp_servers is a YAML list. The script on the Direct tab uses the primary (first) entry.
The Time step of the OS configuration sets all entries as the NTP peers of each node.
From Install the Azure Local operating system: configure a valid time server on each machine, and validate that the machine is not using the local CMOS clock as a time source (w32tm /query /status). The command Learn gives is:
w32tm /config /manualpeerlist:"ntpserver.contoso.com,0x8" /syncfromflags:manual /update
The 0x8 flag tells Windows Time Service to send NTP requests as a client. Learn's command does not include /reliable:YES, which would mark every node as a reliable time source, so the commands on this page and the OS configuration do not set it. Learn gives the single-peer form only; for several peers the OS configuration puts ,0x8 on each peer in the space-separated list (standard w32tm syntax). "Once the machine is domain joined, it synchronizes its time from the PDC emulator." If you domain join the nodes before deployment (supported from 2604; see Task 03: Manual OS installation), the node follows the domain hierarchy once joined; the manual peer still matters while the node is in a workgroup.
Execution Options
- Direct Script (On Node)
- Orchestrated Script
Run on each node individually — via RDP, console, or KVM.
The commands below are an example to run by hand. The earlier toolkit script Set-NTPConfiguration.ps1 is removed; the OS configuration does this task in its Time step.
Set $NTPServer to the first entry from networking.ntp_servers in infrastructure.yml.
# -- Edit before running -------------------------------------------------
$NTPServer = "REPLACE_WITH_NTP_SERVER" # networking.ntp_servers
# ------------------------------------------------------------------------
if ($NTPServer -match "^REPLACE_") { Write-Host "[ERROR] Set NTPServer before running" -ForegroundColor Red; exit 1 }
w32tm /config /manualpeerlist:"$NTPServer,0x8" /syncfromflags:manual /update
Restart-Service w32time -Force
w32tm /resync /force
w32tm /query /status
# Learn: the node must not use the local CMOS clock as its source
if ((w32tm /query /status | Out-String) -match 'Local CMOS Clock') { Write-Host "[WARN] Source is still the local CMOS clock" -ForegroundColor Yellow }
PowerShell
No script in this task folder. The folder
scripts/deploy/04-cluster-deployment/phase-03-os-configuration/task-07-configure-time-synchronization-ntpholds only a placeholder. A placeholder printsNOT IMPLEMENTED, changes nothing and exits with code 3. The earlierSet-NTPConfiguration.ps1is removed. The OS configuration does this task in its Time step.
Script
| Script | What it does |
|---|---|
scripts/deploy/04-cluster-deployment/phase-03-os-configuration/Invoke-AzureLocalOsConfiguration.ps1 | The one entry point of the OS configuration. It runs Set-AzureLocalNodeConfiguration.ps1 for each node: it reads the node, changes only what differs from infrastructure.yml, and reports. -Step limits the run to one step. |
The nodes' local administrator comes from identity.local_admin of infrastructure.yml (the password is a secret reference), or from -Credential. The script never prompts. Run settings go in a JSON file given with -SettingsFile.
Run
# Plan (the default): read every node and list what would change
./Invoke-AzureLocalOsConfiguration.ps1 -InfrastructureFile ./infrastructure.yml -Step Time
# Apply
./Invoke-AzureLocalOsConfiguration.ps1 -InfrastructureFile ./infrastructure.yml -Step Time -Mode Apply
See how the run works.
Validation Checklist
- NTP server configured on all nodes (
w32tm /query /configshows correct peer) - Windows Time service running (
Get-Service w32time | Select Status) - Stratum below 16 on all nodes (
w32tm /query /status) - Source is not
Local CMOS Clock(Learn requirement) - Clock skew within 5 minutes on all nodes (Kerberos requirement)
Values from infrastructure.yml
The values for this task come from infrastructure.yml (schema 5). Every key, with its type, default and example, is in the variables reference.
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| The example stops at once | $NTPServer still holds REPLACE_WITH_NTP_SERVER | Set it to the first entry of networking.ntp_servers |
| Stratum 16 after resync | NTP server unreachable or DNS not resolving | Verify NTP server IP; confirm Task 06 (DNS) passed; check firewall rules |
w32tm /resync exits non-zero | Time service not yet fully started | Wait 10 seconds and re-run w32tm /resync /force manually |
| OS configuration: the node is Blocked in the plan | networking.ntp_servers is missing | Add the list to infrastructure.yml, then run the plan again |
| OS configuration: node unreachable | WinRM not enabled or firewall blocking | Verify WinRM configured (Task 01); check firewall allows port 5985/5986 |
| Time keeps drifting back | VM host overriding guest time | Disable Hyper-V Time Synchronization integration service if applicable |
Alternatives
The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.
Navigation
| ← Task 06: Verify DNS | ↑ Phase 03: OS Configuration | Task 08: Enable ICMP → |
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0 | 2026-01-31 | Azure Local Cloud | Initial document |
| 2.0 | 2026-03-04 | Azure Local Cloud | Full rewrite to standards — complete frontmatter, bare-node 2-tab structure (Direct, Orchestrated), Standalone tab removed, YAML key corrected to networking.ntp_servers list, full embedded scripts with Assert-ConfigValues hard-fail, Get-YamlList and Get-ClusterNodes helpers |
| 2.1 | 2026-11-08 | Azure Local Cloud | Aligned to Azure Local 2610 (Learn "Install the OS"): w32tm uses ,0x8 on each peer, /reliable:YES removed, CMOS clock check added, domain-joined PDC emulator note |