28.12.2014 Views

Timekeeping in VMware Virtual Machines

Timekeeping in VMware Virtual Machines

Timekeeping in VMware Virtual Machines

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Timekeep<strong>in</strong>g</strong> <strong>in</strong> <strong>VMware</strong> <strong>Virtual</strong> Mach<strong>in</strong>es<br />

/sb<strong>in</strong>/hwclock program to set the CMOS clock directly. Alternatively, as most L<strong>in</strong>ux<br />

distributions are configured to copy the system time <strong>in</strong>to the CMOS TOD clock dur<strong>in</strong>g system<br />

shutdown, you can simply set the system time and shut down the guest system before<br />

restart<strong>in</strong>g it aga<strong>in</strong>.<br />

Guest Clock Synchronization With Non-<strong>VMware</strong> Software<br />

If you must run non-<strong>VMware</strong> clock synchronization software (such as the W<strong>in</strong>dows time service<br />

W32Time) <strong>in</strong> a virtual mach<strong>in</strong>e, the built-<strong>in</strong> clock catchup that the virtual mach<strong>in</strong>e performs can<br />

confuse the non-<strong>VMware</strong> clock synchronization software. This confusion may cause time <strong>in</strong> the<br />

guest to get ahead of real time and generally may cause the clock synchronization software to<br />

have difficulty <strong>in</strong> track<strong>in</strong>g real time closely. Also, if <strong>VMware</strong> Tools time synchronization is enabled,<br />

both <strong>VMware</strong> Tools and the non-<strong>VMware</strong> clock synchronization software you are runn<strong>in</strong>g will try<br />

to correct the clock without knowledge of each other, caus<strong>in</strong>g similar problems.<br />

Some customers have a requirement to use a virtual mach<strong>in</strong>e as a primary doma<strong>in</strong> controller for<br />

a W<strong>in</strong>dows network. The primary doma<strong>in</strong> controller must run W32Time as a time server, to<br />

provide time to secondary doma<strong>in</strong> controllers and other hosts on the network. However, the<br />

doma<strong>in</strong> controller does not need to use W32Time's client functionality to receive time from<br />

another source and synchronize the virtual mach<strong>in</strong>e's own clock. So, you can use <strong>VMware</strong> Tools<br />

to synchronize the virtual mach<strong>in</strong>e's clock while still runn<strong>in</strong>g W32Time <strong>in</strong> a server-only mode.<br />

For <strong>in</strong>structions on sett<strong>in</strong>g up W32Time this way, refer to Microsoft documentation on the<br />

W<strong>in</strong>dows Time Service; specifically, the NoSync registry option.<br />

If this approach is not applicable to your situation and you must synchronize a virtual mach<strong>in</strong>e's<br />

clock us<strong>in</strong>g W32Time or other non-<strong>VMware</strong> software, you can take the follow<strong>in</strong>g actions to<br />

m<strong>in</strong>imize problems:<br />

1. Completely disable <strong>VMware</strong> Tools time synchronization, as described <strong>in</strong> Keep<strong>in</strong>g a<br />

Fictitious Time In a Guest System on page 15.<br />

2. In addition, if you still observe the virtual mach<strong>in</strong>e gett<strong>in</strong>g ahead of real time, you can try<br />

limit<strong>in</strong>g the built-<strong>in</strong> clock catchup. Normally, the built-<strong>in</strong> catchup is active whenever the<br />

guest is between 50 milliseconds and 60 seconds beh<strong>in</strong>d real time, and the guest clock<br />

attempts to run 200% faster than normal speed while catch<strong>in</strong>g up. You can modify this<br />

behavior by sett<strong>in</strong>g the follow<strong>in</strong>g options <strong>in</strong> the virtual mach<strong>in</strong>e's .vmx configuration file.<br />

timeTracker.catchupPercentage = 200<br />

timeTracker.catchupIfBeh<strong>in</strong>dByUsec = 50<br />

timeTracker.giveupIfBeh<strong>in</strong>dByUsec = 60000000<br />

Note: The option sett<strong>in</strong>gs shown <strong>in</strong> the example are the default values. Reduc<strong>in</strong>g the<br />

giveupIfBeh<strong>in</strong>dByUsec option value may help <strong>in</strong> limit<strong>in</strong>g the built-<strong>in</strong> catchup operation.<br />

Sett<strong>in</strong>g this option to a lower value makes the catchup give up more quickly if the virtual<br />

mach<strong>in</strong>e gets significantly beh<strong>in</strong>d real time, thereby lett<strong>in</strong>g the non-<strong>VMware</strong> clock<br />

synchronization software you are runn<strong>in</strong>g take care of synchroniz<strong>in</strong>g the clock. It is probably not<br />

a good idea to completely disable the built-<strong>in</strong> catchup, however, s<strong>in</strong>ce the virtual mach<strong>in</strong>e may<br />

then lose time faster than your operat<strong>in</strong>g system or application software expects to be possible<br />

<strong>in</strong> a real mach<strong>in</strong>e.<br />

16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!