Hi all,
recently found an issue where some of my VMs keep showing the wrong time...off by an hour. I've read many threads here about setting the date/time on ESX. I logged into ESX (3.0.1) and found that my clock is showing the same date, but a time of almost a 4 hour difference. I have another ESX 3.0.1 server in the same cluster that is also off by about 5 hours. I found out the time by typing in: hwclock --show[/i]
I saw on several posts that some people were talking about system time and others were talking about the hardware clock. Got a few ?'s:
1)What is the difference between them?
2)How would I go about (on ESX) making sure that BOTH are set to the same time?
3)If I run the date MMDDhhmmYYYY[/i] command, does that reset the "hardware clock", or is it just in ESX?
4)I have read the KB1339 article, but it doesn't say anything about rebooting...will I need to do this at all (as well as after the 'date' command)?
I assume that since it doesn't say it, I will not have to.
and finally:
5)I am just taking over my VI3 environment, so I don't really know the history. Is there a command I can type to see if we are doing a time sync on the ESX servers currently?
FYI, I don't know much in the way of LINUX/ESX commands...be gentle
Thanks all for your help!
1)What is the difference between them?
HW time is the time of the RTC chip.
System time is the time inside an OS (initialized from the HW time)
2)How would I go about (on ESX) making sure that BOTH are set to the same time?
set the system time (via NTP or the date command) and synchronize it to the HW time (hwclock --systohc)
3)If I run the date MMDDhhmmYYYY command, does that reset the "hardware clock", or is it just in ESX?
the date command modifies the system time
4)I have read the KB1339 article, but it doesn't say anything about rebooting...will I need to do this at all (as well as after the 'date' command)?
I assume that since it doesn't say it, I will not have to.
no use hwclock as mentioned above
5)I am just taking over my VI3 environment, so I don't really know the history. Is there a command I can type to see if we are doing a time sync on the ESX servers currently?
execute "history" in the shell
1)What is the difference between them?
HW time is the time of the RTC chip.
System time is the time inside an OS (initialized from the HW time)
2)How would I go about (on ESX) making sure that BOTH are set to the same time?
set the system time (via NTP or the date command) and synchronize it to the HW time (hwclock --systohc)
3)If I run the date MMDDhhmmYYYY command, does that reset the "hardware clock", or is it just in ESX?
the date command modifies the system time
4)I have read the KB1339 article, but it doesn't say anything about rebooting...will I need to do this at all (as well as after the 'date' command)?
I assume that since it doesn't say it, I will not have to.
no use hwclock as mentioned above
5)I am just taking over my VI3 environment, so I don't really know the history. Is there a command I can type to see if we are doing a time sync on the ESX servers currently?
execute "history" in the shell
Here's another kb article that talks about it....
Clock in a Linux guest runs more slowly or quickly than real time - http://kb.vmware.com/kb/1420
Also this talks about the difference between the hardware clock and system clock...
http://www.linuxselfhelp.com/quick/clock.html
And a good white paper...
Timekeeping in VMware virtual machines - http://www.vmware.com/pdf/vmware_timekeeping.pdf
Also here's the NTP setup instructions which will sync ESX with a NTP source...
How can I configure my ESX Server to automatically sync the time from a NTP source?
Login to service console
Edit /etc/ntp.conf with Nano or Vi
Add the below lines to the OUR TIMESERVERS section
o restrict default kod nomodify notrap
o server 0.pool.ntp.org
o server 1.pool.ntp.org
o server 2.pool.ntp.org
Save & exit
Edit /etc/ntp/step-tickers with Nano or Vi
Add the below lines
o 0.pool.ntp.org
o 1.pool.ntp.org
o 2.pool.ntp.org
o pool.ntp.org
Save & exit
Type esxcfg-firewall enableService ntpClient or use VI Client to enable under ConfigurationSecurity ProfileProperties
Type service ntpd restart may say failed for stop if not currently running
Type chkconfig level 345 ntpd on to enable NTP daemon to autostart
Type hwclock systohc to set hardware clock to system clock
Type ntpdate q 0.pool.ntp.org to see the offset between local and ntp clock
Thanks all, this is helpful info...