Select options from your Manage Servers screen and look at 'Virtualization type' under Advanced. If it is set to 'Fully Virtualized' follow the HVM instructions below. If it is set to use a PV-GRUB or PyGRUB boot loader use the PV instructions.
To resolve this issue, you can change the clocksource on your system. First determine the current clocksource:
To find your current clocksource
cat /sys//devices/system/clocksource/clocksource0/current_clocksource tsc
We can see that our current clocksource is tsc.
To see available clocksources
cat /sys/devices/system/clocksource/clocksource0/available_clocksource jiffies pit tsc
We can see that we have jiffies, pit, and tsc available as clocksources.
To change your clocksource, append clocksource=jiffies to your grub.conf kernel line. The sample grub entry would look like this:
title CentOS (2.6.18-194.3.1.el5xen) root (hd0,0) kernel /vmlinuz-2.6.18-194.3.1.el5xen ro root=LABEL=/ console=xvc console=tty clocksource=jiffies initrd /initrd-2.6.18-194.3.1.el5xen.img
You can now reboot and then
cat /sys/devices/system/clocksource/clocksource0/current_clocksource jiffies
And it shows us jiffies. If it doesn't, then the kernel clocksource line is not correct.
Test and see if drift continues. Depending on your kernel and system pit or jiffies typically resolves any clock drift.
If your server date is incorrect or doesn't "stick" -- ie, you issue the date command and the date resets, do the following as root:
echo 1 > /proc/sys/xen/independent_wallclock
You can then set the date again. Wait a few moments and confirm the date is correct.
In order to ensure the setting sticks on boot, you should also issue a:
echo "xen.independent_wallclock = 1" >> /etc/sysctl.conf
If you are using a "Cloud Kernel" (Set under options) of your dashboard, you can change your clocksource by modifying the clocksource= line under boot paramaters. If you are facing a clock drift issue, try changing the clocksource= to xen, or a different clocksource if xen is set. Note, once you have made this change you must do a full shutdown of your instance, wait for its state to change to down and then do a start.
Add notsc divider=10 to your kernel config
Example:
# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-164.6.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 hda=noprobe hdb=noprobe notsc divider=10 initrd /initrd-2.6.18-164.6.1.el5.img title CentOS (2.6.18-164.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-164.el5.img
Add divider=10 clocksource=acpi_pm to your kernel config
Example:# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-164.6.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 hda=noprobe hdb=noprobe notsc divider=10 clocksource=acpi_pm initrd /initrd-2.6.18-164.6.1.el5.img title CentOS (2.6.18-164.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-164.el5.img
Edit your /etc/ntp.conf as follows
# grub.conf generated by anaconda tinker panic 0 restrict 127.0.0.1 restrict default kod nomodify notrap server 0.vmware.pool.ntp.org server 1.vmware.pool.ntp.org server 2.vmware.pool.ntp.org driftfile /var/lib/ntp/drift ############## ### It is also important NOT to use the local clock as a time source, often referred to as the Undisciplined Local Clock. NTP has a tendency to fall back to this in preference to the remote servers when there is a large amount of time drift. If you see these two options, comment them as below: #server 127.127.1.0 #fudge 127.127.1.0 stratum 10 ##############Once you have changed the kernel clocksource you need to reboot your machine.
“@hostvirtual = awesome service - highly recommended for all your virtualisation needs.”