Tuesday, 9 September 2014

Hyper-V VM: Set Up PDCe NTP Time Server plus other DC's time service

When we are running a greenfield deployment, a migration, or a domain reconfiguration one of the key configurations to get right is the Domain Time setup.

We've had situations where anomalies in the time setup have brought down clusters (node's time was out of whack).

In Hyper-V Management disable time integration for the DC(s).

On the primary DC (PDCe) VM that will be the time authority for the domain we run the following steps (please copy and paste into NotePad to clean up):

w32tm /config /syncfromflags:manual "/manualpeerlist:0.ca.pool.ntp.org,0x1 1.ca.pool.ntp.org,0x1 2.ca.pool.ntp.org,0x1 3.ca.pool.ntp.org,0x1" /reliable:yes
w32tm /config /update
net stop w32time && net start w32time
w32tm /resync /force
w32tm /query /source

If you hit ENTER after the last line above and copy from the line underneath to the beginning of the first line and paste into an elevated CMD all of the steps will run automagically. Note that the NTP.ORG servers are Canadian localized. There are servers for most regions in the world.

On every other DC in the domain we run the following steps in an elevated CMD:
w32tm /config /syncfromflags:domhier /reliable:no /update
net stop w32time && net start w32time
w32tm /resync /force
w32tm /query /source

Note that the above step(s) may need to be run a couple of times to get the settings to seat.

Once the above setup has been completed the domain's time should remain on time. If there are any issues with time, that is it starts to slip or jumps ahead, check in Hyper-V Management to see if the IS setting for Time Sync has not somehow become enabled again.

If it has run the above steps again to reseat the settings.

NOTE: For SQL or high load VMs that tend to skew time, we've seen situations where the VM's time skews before our eyes, then set up a BATCH file with the following in it:
w32tm /resync /force

Set it to run in the VM's Task Scheduler every five minutes. If time still gets too far out of whack then decrease the time increment until the VM keeps its time as much as possible.

Philip Elder
Microsoft Cluster MVP
Co-Author: SBS 2008 Blueprint Book
Chef de partie in the SMBKitchen ASP Project
Find out more at
Third Tier: Enterprise Solutions for Small Business


Sharon said...

Would you then have the Hyper-V server (Host) sync from the DC?

Philip Elder Cluster MVP said...


In a single server setting the time on the host would be left to the default polling for time from time.windows.com.

If the host's time became a problem we would set it to poll ntp.org.

We leave standalone hosts in workgroup so no need to point to the DC in my experience.