Linux ntp time Offset on Xen VM incorrect

Discussion in 'General Server' started by gcawood, Feb 13, 2012.

  1. gcawood

    gcawood Administrator Staff Member

    Messages:
    49
    Likes Received:
    15
    Trophy Points:
    0
    I noticed that one of our VM's clocks wasn't being updated correctly on Linux CentOS VM that we are running on a XenServer. I did a number of things to confirm that NTP was updating, but for whatever reason, the clock still came up with a high offset (18+ seconds). After a lot of searching I found that by default, the VM's clocks are synchronized to the HOST clock running on the control domain, and cannot be independently changed. This was surprising to me because NTP was still configured and appeared able to synchronize the clocks.

    This makes sense from a CPU saving standpoint, as only one server really needs to be running the NTP service, so long as all VM's can update their clocks off of it. If you want to override this setting, just add the following line to your /etc/sysctl.conf file


    Code:
    # Allow the VM to update it's own clock, and do not use the DOM host clock.
    xen.independent_wallclock=1
    

    and then restart networking

    Good luck!
    Greg
    Rob likes this.

Share This Page