LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 06-22-2011, 12:00 AM   #1
JNat
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Rep: Reputation: Disabled
Unhappy Can't set date; manually, ntp or otherwise


Hey all,

Having an odd problem I can't seem to get sorted.

I've got ntp running, but unfortunately, I started it up before executing ntpdate to do the initial synchronizing of the OS clock to the "correct" remote server time. My VM had drifted badly over the months, so the offset when I run ntpq -p is currently -101 seconds, and continues to increase. I tried stopping ntpd, and running ntpdate again, however the sync was not successful; the offset persists.

I also tried to set the system date manually using the date command, however, it does not seem to work...when I run something like date --set="06/21/2011 1:00:00", it outputs that date, however when I execute "date" again, the date has not been changed. I'm logged in as root so that's not the issue.

I'm kind of at a loss at this point, do I need to uninstall ntp and reinstall or something? Thanks for any help.
 
Old 06-22-2011, 01:41 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, welcome to LQ!

What's the host OS, what's the guest OS, what's the virtualisation
platform, and what hardware is this running on?


Cheers,
Tink
 
Old 06-22-2011, 11:47 AM   #3
JNat
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hey Tink,

All I know right now is the guest OS, it's CentOS 5.5. I'm on a hosted VPS and I've not needed to know the other information thus far. I've got a request in to find out the other information. I'll post back here as soon as I find out.
 
Old 06-22-2011, 12:57 PM   #4
JNat
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
OK more info from the VPS provider:

"The platform the VPS is on is running XenServer 5.6 with a 64-bit AMD CPU."

Still not sure about the host OS.
 
Old 06-22-2011, 01:02 PM   #5
JNat
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Here's what it looks like when I do ntpq -p...you can see the offset (second to last column) is 106 seconds:


remote refid st t when poll reach delay offset jitter
==============================================================================
+bindcat.fhsu.ed 128.138.140.44 2 u 6 64 377 72.918 -106493 22.501
+kallisti.us 198.82.1.203 3 u 19 64 377 100.123 -106476 24.267
*private.ssl119. .CDMA. 1 u - 64 377 88.069 -106470 23.025
LOCAL(0) .LOCL. 10 l 30 64 377 0.000 0.000 0.001
 
Old 06-22-2011, 01:17 PM   #6
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

what you can try to do is:
Code:
service ntpd stop
ntpdate pool.ntp.org  # wait till it sync's
#check time/date
date
#start ntpd again
service ntpd restart
ntpdate pool.ntp.org - you can use your nearest ntp server (list NTPPoolServers or here www.pool.ntp.org/en/ )

More about ntp_synchronize here.

Hopefully you will have time synced, but if your VPS gets time from host, then you're out of luck.

Last edited by lithos; 06-22-2011 at 01:20 PM.
 
Old 06-22-2011, 01:22 PM   #7
JNat
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hey Lithos,

Yeah, I already tried that a bunch of times. I think that the problem must be that the VPS gets its time from the host as you say. I'm working with the host now so hopefully they can help me resolve the issue. I'll post back when I find out for sure.
 
Old 06-23-2011, 11:36 AM   #8
JNat
LQ Newbie
 
Registered: Jun 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Solved

OK, I finally got it sorted out. I am on a VPS using Xen VMs. By default, the guest VMs will sync to the host machine's system time, so the guest VM is not able to alter its system time. Through much googling I found that this is controlled by a flag on the guest VM as described here:

http://support.citrix.com/article/CTX116376

Once I changed the flag value, I was able to run ntpdate successfully and now my system time is syncing properly.
 
Old 06-23-2011, 12:14 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Sweet ... thanks for coming back and posting the solution.
I'll move the post to Virtualisation, as it's really a problem
caused by the environment.


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Date and NTP devUnix Linux - Server 5 04-06-2011 01:50 PM
date / ntp problem sp149 Red Hat 3 02-07-2008 11:23 AM
ntp does not work.. date and time cannot be changed.. basis1980 Linux - Software 10 02-06-2008 08:09 AM
Do I have to manually keep repositories up to date? Rotwang Red Hat 1 01-24-2008 01:32 PM
ntp port blocked - how to set date automatically unkie888 Linux - General 4 11-06-2007 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration