How to Resolve the Difference Between Windows VM Time and the Standard Time When the VM Runs a JVM

Publication Date:  2015-03-10 Views:  294 Downloads:  0
Issue Description
In a desktop cloud environment, the time of a Windows VM keeps lags behind the standard time, about 5 second per minute averagely. After a period of time, users cannot log in to the VM.
Handling Process
This issue involves the time mechanism of XEN and has no solution currently. Take the following measures to prevent this issue:
1. Do not run JVMs for a long time in a Windows VM unless truly required.
2. Configure NTP synchronization for Windows VMs that require long-term operation of JVMs in a desktop cloud environment, set the synchronization cycle to be smaller than 1 hour, and ensure that the difference between the VM time and DDC time is smaller than 5 minutes.
3. If a Windows VM has had such an issue, restart it.
Root Cause
1. The VM time seriously deviates from the DDC time. As a result, the VM leaves the domain and cannot be logged in.

2. The VM runs a Java virtual machine (JVM) to obtain more precise clock resolution and frequently invokes SetTimerResolution. As a result, the time of the Windows VM lags behind the standard time.
To check if a VM runs a JVM, right-click the taskbar and choose Task Manager. In Windows Task Manager, click the Processes tab and check the Description column for each process. Figure 1 shows that the VM runs a JVM.

Figure 1 JVM

Currently, the most commonly used JVMs are server BMC remote consoles that are accessed through browsers.