Tuesday, 30 July 2013

Error: Date not updated on Xen Linux Machine

I was trying to set date and time on  paravirtualized xen VM machine with OS centos 5.5 but server was not taking time update and it was showing old date and time. It was also giving following errors when setting time with date command and ntp server.

[root@app04 ~]# date -s "Tue Jul 30 13:32:44 IST 2013"

date: cannot set date: Operation not permitted
Tue Jul 30 13:32:44 IST 2013

[root@app04 ~]# hwclock

Cannot access the Hardware Clock via any known method.
Use the --debug option to see the details of our search for an access method.

Solution:

I checked independent_wallclock kernel parameter in VM machine which was off (value=0). Due to which machine was not taking update of time. So we set it to value 1.

[root@app04 ~]# cat /proc/sys/xen/independent_wallclock
0

[root@app04 ~]# echo 1 > /proc/sys/xen/independent_wallclock

[root@app04 ~]# cat /proc/sys/xen/independent_wallclock
1

Now restarted ntp service and system date was updated.

[root@app04 ~]# service ntpd restart
Shutting down ntpd:                                        [  OK  ]
ntpd: Synchronizing with time server:                      [  OK  ]
Starting ntpd:                                             [  OK  ]

[root@app04 ~]# date

Tue Jul 30 13:40:13 IST 2013

2 comments:

  1. Ka baat Kaa baaat kaaaa baaaat

    ReplyDelete
  2. ye un sab logo ke mooh par tamacha jo bolte hain data centre wale kaam nahi karte ....

    hum sir ki respect koi aise thodi karte hain..

    ReplyDelete