Linux – Why is the time messed up on the Ubuntu Server VPS

linuxtimetimezoneUbuntuvirtualization

A month back loads of services on my VPS stopped working. After messing about for an hour or so i worked out that the time had frozen. I gather it was some sort of virtualization bug and a reboot soon fixed it.

However, today I was trying to run my S3 backup and SSL failed due to the time being wrong. on checking the time i get:

Current default timezone: 'Europe/London'
Local time is now: Sat Jul 11 22:03:02 BST 2009.
Universal Time is now: Sat Jul 11 21:03:02 UTC 2009.

tim@vps:~$ sudo ntpdate ntp.ubuntu.com
11 Jul 22:03:30 ntpdate[3901]: step time server 91.189.94.4 offset -14404.833448 sec

Now im in the UK now and its clearly only just gone 18:03.

I've tried setting the date manually:

sudo date +%T -s "18:03:30"

and when i read it back, it hasnt changed

What have i messed up?

EDIT:

I've run:

tim@vps:/var/log$ sudo hwclock --utc
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
tim@vps:/var/log$ sudo hwclock --localtime
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.
tim@vps:/var/log$ sudo hwclock --show
Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.

EDIT AGAIN:

I've had it rebooted and its still the same.

also:

tim@vps:~$ sudo hwclock --debug --show
hwclock from util-linux-ng 2.13.1
hwclock: Open of /dev/rtc failed, errno=2: No such file or directory.
No usable clock interface found.
Cannot access the Hardware Clock via any known method.

Best Answer

Update: I know nothing of xen. But there are a lot of pages out there that discuss your situation.

Here is something I found:

By default, XenVMs have their clocks synchronized to the XenEnterprise Server that hosts them and will ignore requests to adjust the time made by an ntp daemon if one is running. If you want a XenVM to have an independent clock, log on to its Text Console and issue the command

echo 1 > /proc/sys/xen/independent_wallclock

then run an NTP daemon.

To revert to the default, issue the command

echo 0 > /proc/sys/xen/independent_wallclock

Before update: It is probably a virtualization issue. What kind of virtualization software are you using? And what is the time settings on the host?