VMware Cloud Community
REALM
Contributor
Contributor
Jump to solution

Help setting date/time in ESX... keeps resetting

I have 3 ESX 3.0.2 Udpate 1 servers, all with different date/times. I think it may be related to a VM time issue I'm having.

I've tried using the "date -s 05/13/08"

and "date -s 10:13"

to change it which works, but then when I restart I notice it says, "Synchornizing hardware clock with system time" and when it comes back from the restart the date and time is back to something incorrect.

What commands do I need to use to change it permanently? Thank you.

Reply
0 Kudos
1 Solution

Accepted Solutions
kjb007
Immortal
Immortal
Jump to solution

Your BIOS time is probably off. After you set the time, run 'hwclock --systohc' to force the correct time. Otherwise, when you reboot, check your BIOS and make sure the time is corrected before it starts.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB

View solution in original post

Reply
0 Kudos
9 Replies
jhanekom
Virtuoso
Virtuoso
Jump to solution

You can force writing the current system time to the hardware clock by running "hwclock --systohc".

Additionally, may I strongly suggest you set up NTP on your ESX servers, as described in http://kb.vmware.com/kb/1339.

Finally, for an advanced discussion on timekeeping inside of VMs (and some of this really is bedtime reading), you can reference this very detailed, very technical whitepaper: http://www.vmware.com/pdf/vmware_timekeeping.pdf)

Reply
0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

I second setting up NTP for you hosts - having them all on the same time will help prevent some common issues and errors involved with inconsistent time on your hosts, VMs and with Virtual Cenetr

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
REALM
Contributor
Contributor
Jump to solution

My service console is on a private LAN, so I couldn't impelement NTP without putting an NTP server on that private network, correct?

Reply
0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

That is correct - unless you are able to route out to a public NTP source -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

Do you have a firewall you can use as your NTP source?

Reply
0 Kudos
jhanekom
Virtuoso
Virtuoso
Jump to solution

Correct, or synchronise with a switch/router on your isolated network - these almost always have NTP daemons and, since the networking guys often have to correlate logs accross many devices, they usually make sure NTP is set up on them to synchronise with a public source through another interface.

If you still have no other source, synchronise amongst your ESX hosts (if you have multiple.) That way, at least you'll have consistent time between them to help you when correlating events in logs.

Reply
0 Kudos
REALM
Contributor
Contributor
Jump to solution

How can I synchronize between them without another NTP server?

Reply
0 Kudos
jhanekom
Virtuoso
Virtuoso
Jump to solution

The Linux NTP daemon running on the SC is, in addition to being an NTP client, also a fully-fledged NTP server. If you just point them at each other, they should synchronise.

You may need to adjust the settings in ntpd.conf so that one server is seen as authoritative. On the system you want to act as source, add the following line to the ntpd.conf file:

fudge 127.127.1.0 stratum 0

Please take note that this will prevent the server from synchronising with other sources, and will synchronise only with the local system clock.

(It's also generally a good practice to add "fudge 127.127.1.0 stratum 10" to the other servers, however they will default to stratum 5 if not explicitly configured.)

kjb007
Immortal
Immortal
Jump to solution

Your BIOS time is probably off. After you set the time, run 'hwclock --systohc' to force the correct time. Otherwise, when you reboot, check your BIOS and make sure the time is corrected before it starts.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
Reply
0 Kudos