2012년 10월 4일 목요일

How to resolve time drift of Windows HVM on Xen

I have two windows HVMs(Hardware Assisted VM). Both are running into VMs on a host which is installed Xen 4.0 and CentOS 6.2.

Whenever I log into those servers, I find that times are faster than host's and these time gaps are getting bigger.

Usually, commercial Hypervisors such as XenServer, VMware and Hyper-V keep time synchronization between the host and the guest through installing a program called "guest tool".

However, In the case, they not provided any tool in Xen (not XenServer)
When I was stuck in the same situation on Linux,  I resolved time drift in the case of Linux Operating system by setting NTP. 
So, It would recommend that NTP is best solutions for Windows HVM, too.

"For Windows guests, time is initially driven from the control domain clock. However, XenServer also stores for each Windows VM a time offset. This represents the difference between the control domain time and the guest, and is persisted for each VM. We recommend running a reliable NTP service in the control domain to set a global time accurately across all VMs in the host, and not one NTP service in each individual Windows VM."
This is a hint from the online document.

To enable NTP on Windows, it is able to change it by configuring the Windows Time Service. Time service is registered as Windows Service automatically and it is also provide the way of changing in command prompt.   

By running command prompt, At first, Check current time source of the computer.

C:\>w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 1 (primary reference - syncd by radio clock)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0000000s
Root Dispersion: 10.0000000s
ReferenceId: 0x4C4F434C (source name:  "LOCL")
Last Successful Sync Time: 10/4/2012 4:13:13 AM
Source: Free-running System Clock
Poll Interval: 6 (64s)

Then, It adds a ntp server to the list. 
C:\>w32tm /config /manualpeerlist:kr.pool.ntp.org /syncfromflags:manual /reliable:yes /update
The command completed successfully.

Verify it.

C:\>w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 3 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0370178s
Root Dispersion: 0.8297591s
ReferenceId: 0xD3278804 (source IP:  211.39.136.4)
Last Successful Sync Time: 10/4/2012 11:02:09 AM
Source: kr.pool.ntp.org
Poll Interval: 7 (128s)

Loot at a member server of the active directory, you don't have to change it again. Any member servers of the AD, they are synchronizing the time with AD.   
C:\>w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 4 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0682526s
Root Dispersion: 7.8910279s
ReferenceId: 0xC0A814A8 (source IP:  192.168.20.168) <= IP address of AD
Last Successful Sync Time: 
10/4/2012  11:06:54 AM
Source: ad
Poll Interval: 10 (1024s)

If you can't see the same time with AD, you can restart the "Windows Time Service" in services panel.


댓글 없음:

댓글 쓰기