locked
Guest OS clocks drift - Hyper-V Server RRS feed

  • Question

  • I'm running Hyper-V Server on a Dell T605 server with a quad-core AMD Opteron 2376 CPU. The CPU's power management facilities are disabled in the BIOS.

    I have a Windows 2000 Server SP4 guest VM. The Windows Time service in the guest is disabled, and I'm using the Hyper-V Integration Services to sync the clock.

    However, I notice that the clock in the guest drifts slowly backwards relative to the host's clock. Over a period of time it will be several seconds behind.

    This is very disappointing as the application that I intend to run on this VM require clocks with sub-second accuracy.

    Any suggestions would be appreciated, thanks.
    Wednesday, April 1, 2009 11:43 AM

Answers

  • When I have had applications that are very time sensative I have had to turn off the clock syncing with the hypervisor and rely on my network time server or Active Directly time syncing.

    I have seen the same issue on VMware and others.

    And, every now and then there are applications that use the time stamps and totally garbage out of the time between a client and server component is not totally 'right'.

    Brian Ehlert (hopefully you have found this useful)
    • Marked as answer by Mervyn Zhang Thursday, April 2, 2009 5:42 AM
    Wednesday, April 1, 2009 4:02 PM
  • I hadn't realised there was a free version of Xen, or I probably would have tried it! Though actually I don't know whether I could install it on this machine as I'd presumably need drivers for the raid unit.

    I will certainly move on to Hyper-V R2 when it's out of beta.

    In the meantime though I seem to have got it working a whole lot better. Here's what I did:

    1. I disabled the clock sync in the integration services.

    2. I re-enabled the Windows Time service in the guest OS and set its Period registry setting to 288 - that should make it resync with the PDC-emulator domain controller every 5 minutes.

    Now the clock in the guest VM is within about a quarter of a second of the machine that I'm running Hyper-V manager on, which is acceptable for my current purposes.

    So I'll leave it at that for the moment. Thanks for your time and suggestions!
    • Marked as answer by Mervyn Zhang Thursday, April 2, 2009 5:41 AM
    Wednesday, April 1, 2009 5:53 PM

All replies

  • We've had strange timing issues on both AMD Hyper-V hosts and VMs. Adding '/usepmtimer' to the boot.ini resolved the issues.

    Wednesday, April 1, 2009 3:40 PM
  • Nice try, but I forgot to mention that I'd already set that in the guest boot.ini, and it doesn't seem to make any difference.

    I hope I'm not going to regret buying a server with an AMD processor. Generally speaking I stick with Intel, but the deal on this one was excellent so I was persuaded... (And it is certified for Hyper-V so I thought I'd be ok)

    Wednesday, April 1, 2009 3:49 PM
  • How long does it take for the clock to be unacceptably out of sync? Would a simple script executing the "net time" command not be an acceptable workaround for this problem?
    Wednesday, April 1, 2009 3:51 PM
  • That's an interesting suggestion that may well help.

    It takes about an hour or so to get 5 seconds behind, after which the integration service resyncs it. So ideally I'd want to fire off the command every 5 minutes or so. I'd probably actually use a w32tm -s <hostserver> command rather than net time.

    However this is very much a kludge, and I hope that someone can throw a bit more light on the actual problem.
    Wednesday, April 1, 2009 4:01 PM
  • When I have had applications that are very time sensative I have had to turn off the clock syncing with the hypervisor and rely on my network time server or Active Directly time syncing.

    I have seen the same issue on VMware and others.

    And, every now and then there are applications that use the time stamps and totally garbage out of the time between a client and server component is not totally 'right'.

    Brian Ehlert (hopefully you have found this useful)
    • Marked as answer by Mervyn Zhang Thursday, April 2, 2009 5:42 AM
    Wednesday, April 1, 2009 4:02 PM
  • That is a lot of clock drift! I just did a check on some of my VMs - been running for about 3 weeks and the clocks are well within 1 second of the host. We are running quad 8354 in our hosts. Could this be specific to the 2xxx AMD processors? I'm concerned now - we're about to deploy a new cluster with 2384 processors, and also need accurate timing.
    Wednesday, April 1, 2009 4:09 PM
  • Brian

    Normal AD syncing doesn't help here, because it doesn't happen frequently enough. I could try setting the 'period' registry setting for the Windows Time service to 288 to try and force it to sync every 5 minutes as an alternative to using a script as previously suggested.

    I've been running this application on a Virtual Box VM for some months, and that keeps perfect time (on an Intel platform). Trouble is, VirtualBox is a bit lacking in some areas (for example you have to start the VMs manually).

    I've also run it on VMWare - that appeared to keep good time, except that every so often it would flick the clock forward by 20 minutes for a fraction of a second and then back again, which was completely disastrous for my application!
    Wednesday, April 1, 2009 4:15 PM
  • Give XenServer a shot (you have tried everyone else).

    The latest update (with the free licensing) just released.

    (I am actually kind of curious now)

    I don't know if there are any improvements in Hyper-V R2 that might be targeted toward this symptom.  But when R2 comes you might want to give that a try as well.

    Interesting that this appears related to AMD procs.  They have been good, reliable, workhorse processors for years.
    I wonder if it has something to do with the processor scheduling in the hypervisor....

    Brian Ehlert (hopefully you have found this useful)
    Wednesday, April 1, 2009 4:55 PM
  • I hadn't realised there was a free version of Xen, or I probably would have tried it! Though actually I don't know whether I could install it on this machine as I'd presumably need drivers for the raid unit.

    I will certainly move on to Hyper-V R2 when it's out of beta.

    In the meantime though I seem to have got it working a whole lot better. Here's what I did:

    1. I disabled the clock sync in the integration services.

    2. I re-enabled the Windows Time service in the guest OS and set its Period registry setting to 288 - that should make it resync with the PDC-emulator domain controller every 5 minutes.

    Now the clock in the guest VM is within about a quarter of a second of the machine that I'm running Hyper-V manager on, which is acceptable for my current purposes.

    So I'll leave it at that for the moment. Thanks for your time and suggestions!
    • Marked as answer by Mervyn Zhang Thursday, April 2, 2009 5:41 AM
    Wednesday, April 1, 2009 5:53 PM
  • As a side note, XenServer has really good storage support - but yes, drivers get you in the end.

    Still, an interesting academic study.

    Brian Ehlert (hopefully you have found this useful)
    Wednesday, April 1, 2009 5:57 PM