We have a previous post on setting up the Windows Time service here:
To date we have had decent success on reigning in a heavily loaded VM’s tendency to skew its time.
What we have come with via a number of sites listed below and a lot of reading in online forums follows.
- Hyper-V Integration Services: Time Synchronization remains enabled.
- Yes, even on DCs.
- Registry edit to allow the VM to pick up its time from the Hyper-V host only while booting:
- reg add HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider /v Enabled /t reg_dword /d 0
- Copy and paste the above into Notepad to make sure there are no line breaks as it is all in one line.
- Edit the Windows Time registry settings to make the time service poll more frequently:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config
- "MaxAllowedPhaseOffset"=dword:00000001
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient
- Set the appropriate time server source:
- 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
- Note the quotes enclosing the time server names.
- w32tm /config /update
- net stop w32time && net start w32time
- w32tm /resync /force
- w32tm /query /source
Further Reading:
- MSDN Blogs: Ryan Sizemore: Configuring the Time Service: NtpServer and SpecialPollInterval
- Jaylee.org: Hyper-V, CPU Load and System Clock Drift
- Virtual PC Guy’s Blog: Time Synchronization in Hyper-V
- Yahoo Groups: SBS2K: SBS Time
- Great contributions by Chris Knight to this thread.
NOTE: This post may be updated at any time to reflect changes to the above methodology. Please keep in mind that this is a work in progress.
UPDATED 2012-03-06: Tweaked the registry settings as per comments below and the setting found in the MSDN article linked above.
Philip Elder
MPECS Inc.
Microsoft Small Business Specialists
Co-Author: SBS 2008 Blueprint Book
*Our original iMac was stolen (previous blog post). We now have a new MacBook Pro courtesy of Vlad Mazek, owner of OWN.
10 comments:
For clarification -- is this all being run on the virtual SBS?
Sean,
These are the steps we would take with SBS, Win2K8 R2, or any other server based OS running in Hyper-V.
We have had a lot of problems with server VMs keeping their time when they are running a fairly high load such as SBS or SQL.
Philip
I've run into that as well. But for clarification are you making this registry changes on the virtual machine (the SBS2008 or 11 or whatever virtual instance) or are these registry settings for the host?
(I assumed on the virtual machine but you know what they say about assumptions...)
Sean,
The modifications indicated are on the guest (VM) OSs.
Philip
Philip, another question for clarification...
Aside from running these processes on the VM to adjust time settings(in my case a VM of SBS2011), what are process are you recommending to run on the actual host server? The Hyper-V R2 host we setup is a standalone (not part of any domain) as is the recommended setup. Are you findings showing that the following should be run on the host server to have it use an external pool for proper time as well (from your linked article):
On SBS 2008 or the PDCe:
w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:manual /reliable:yes
w32tm /config /update
net stop w32time && net start w32time
w32tm /resync /rediscover
Thanks!! Keep up the great work that you do for the SBS community!!
Richard,
Set up the host to poll pool.ntp.org.
Then set up the PDCe to poll the host for time. Firewall exclusions may be required on the host.
Philip
Very helpful. However, my VMs are running Windows 2000 (part of the reason for virtualizing - to work on moving to a newer platform). Can you give the appropriate modifications for Win2K? Many of the w32tm commands given don't exist or have an equivalent. And it appears I have to restart the VM to get the changes applied, is this correct? Thanks.
Sam,
Got me there. I am sorry, but other than test installing Win2K into Hyper-V and troubleshooting some issues with Win2K in Hyper-V on behalf of some others, I do not know off hand what the command set is.
Please see Microsoft KB 216734: How to configure an authoritative time server in Windows 2000 for the way to configure things for an External Time Source. It looks like a bunch of registry edits.
Philip
Thank you very much for this write-up but I believe there is an error in the way the setting of the SpecialPollInterval for NTP is entered.
In Step 3 it is referenced as being as under HKLM\CurrentControlSet\services\W32Time\Config. Microsoft documents this proper place for this as belonging under ..TimeProviders\NtpClient (HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval) in KB816042.
If SpecialPollInterval is configured as outlined in Step 3 it does not appear to be used when the configuration is dumped with w32tm /query /configuration.
I also find myself questioning SpecialInterval value. It could just be me but I’m not finding that listed as a value by Microsoft. Can you point me to where this is documented?
Has anyone done a script of this, that includes the registry edits?
/kenw
Post a Comment