Can anyone point me to the steps needed to configure NTP client on ESX 3.x to sync with an internal NTP server ?
thanks
ntp configuration
nano /etc/ntp.conf \[add time servers]
nano /etc/ntp/step-tickers \[add time servers]
esxcfg-firewall --enableservice ntpClient \{case sensitive}
chkconfig --level 345 ntpd on
service ntpd start
hwclock --systohc
clock \[to check time pre post]
ntpdate -q \[ip] to query timesource
from my brief notes on it
So what if you don't have an NTP server and are using the DC for time, do i follow all the steps use the DC's information instead of NTP?
I have used the PDC emulator in the past and it has worked just fine.
Thank you Algernon!
How would I point my ESX 3 box to use the PDC as a time source?
Here what I did:
1. /etc/ntp.conf[/b]: Add the following
restrict Windows Server IP Address[/i] mask 255.255.255.255 nomodify notrap noquery
server Windows Server FQDN[/i]
2. /etc/ntp/step-tickers[/b]: Add
server Windows Server FQDN[/i]
3. /etc/hosts[/b]: add entry for your Windows time source
4. At console: service ntpd restart
5. At console: chkconfig --level 345 ntpd on
6. At console: /sbin/hwclock --systohc
7. At console: watch ntpq -p
For #7 wait until the asterisk goes beside your PDC emulator or the time source you have specified. It may not be right away and I've had it take a while.
Thanks -- I'll try this.
I wrote a script this afternoon to help setup NTP on my ESX servers. There are basically 3 ways to run it:
Interactively - you will be prompted for every NTP server name / IP.
Semi-automatic - specify a file that has a list of NTP servers, you are shown the servers and then you must confirm that they are correct.
Fully automatic - specify a file with a list of NTP servers and they are added with out prompting.
This follows VMware's KB article on setting up NTP with the exception of the hosts file modification (my NTP server is an IP address), if there is a request for that then I can add that as well.
Anyway you can download it here:
http://www.vmcolonel.net/wp-content/uploads/2007/05/set_ntp.zip
Or if you want to read more about it look here:
http://www.vmcolonel.net/?p=13
As I just wrote it this afternoon there has not been extensive testing so use it at your own risk. If you come across any bugs or anything else pelase let me know.
Hello dsanders,
Your script worked like a charm, Thanks a ton for this.
Adi-
Awesome script, thanks VMC
Awesome script dsanders! Thank you for your time and effort.
My notes from the VMWare Tech Support yesterday:
Change lines in etc/ntp.conf:
#Prohibit general access to this service.
restrict default kod nomodify notrap
Comment out:
\# authenticate yes
\# keys /etc/ntp/keys
From Vcenter ESX HOST ->configuration -> security Profile
Check off NTP, click OK
Done..
He didn't mention anything about changing any other files??
Alse he used a command: watch "ntpq -p"
to see the time sync.
Killer
Thanks a ton dsanders
Dude you totally rock. Between you, Algernon and Eric and a few other people on here, we don't need VM Ware anymore.. you guys are good!
Thanks a bunch, worked like a charm !
There was a typo in my script. I have modified the code and corrected it. You will want to download the script and run it again. Thanks to Mark Slatem for pointing out the bug. For those interested the type was on the folllowing line:
echo restrict default kod nomodify notrap >> ntp.conf.tmp[/code]
I had misspelled nomodify.
Do the VMs etc. need to be shut down to re-run this script??
Any other preparatory things??
Thank you, Tom
Nothing should be need to be shutdown. This only modifieds the ntp.conf file which just affects the host.