schmandini
Contributor
Contributor

ESX 3.5 Installation via Kickstart - ntp config does not work

hi all,

i have searched the forums and the web for my problem but i found no solution.

so here is my kickstart postinstall script part fort ntp:

  1. ntpClient configuration

echo "ntpserver1" >> /tmp/ntp.conf.tmp

echo "ntpserver2" >> /tmp/ntp.conf.tmp

echo "ntpserver3" >> /tmp/ntp.conf.tmp

cp -f /tmp/ntp.conf.tmp /etc/ntp.conf

esxcfg-firewall -e ntpClient

chkconfig --level 345 ntpd on

service ntpd restart

after the installation finished my ntp.conf ist correct configured but when i start the infrastructure client there are no entries for ntp servers in configuration tab -> time configruation -> properties -> options -> ntp settings

but the ntp client is enabled.

i have no idea what goes wrong.... Smiley Sad

another hint, during installation i found a section when ntpd tries to shutdown but failed. on the other hand starting ntpd afterwards succedes....

anyone an idea where to look for mistakes or what to fix? is it in general possible to configure ntp client via kickstart? (so that entries from ntp.conf are in ic too)

thx in advance

greetings schmandini

0 Kudos
4 Replies
lamw
Community Manager
Community Manager

You'll also want to specify a driftfile within your ntp.conf "driftfile /var/lib/ntp/drift", and make sure that directory exists by doing mkdir -p /var/lib/ntp and then after you've enabled ntpClient from ESX firewall and updated chkconfig, you'll actually want to run the following comands and restart ntpd afterwards:

/usr/sbin/ntpdate (ntpserver1)

/sbin/hwclock --systohc --utc

service ntpd restart

espi3030
Expert
Expert

This is the NTP setup portion of my .cfg file

echo "restrict 127.0.0.1" > /etc/ntp.conf

echo "restrict default kod nomodify notrap" >> /etc/ntp.conf

echo "server mickey.mouse.disney.com" >> /etc/ntp.conf

echo "driftfile /var/lib/ntp/drift" >> /etc/ntp.conf

echo "mickey.mouse.disney.com" > /etc/ntp/step-tickers

service ntpd restart

chkconfig --level 345 ntpd on

hwclock --systohc

schmandini
Contributor
Contributor

first of all thx a lot for the answers.

i am not sure if i implemented your advice correctly.

this is my new ntp config part:

echo "restrict kod nomodify notrap noquery nopeer" >> /tmp/ntp.conf.tmp

echo "restrict 127.0.0.1" >> /tmp/ntp.conf.tmp

echo "ntpserver1" >> /tmp/ntp.conf.tmp

echo "ntpserver2" >> /tmp/ntp.conf.tmp

echo "ntpserver3" >> /tmp/ntp.conf.tmp

echo "driftfile /var/lib/ntp/drift" >> /tmp/ntp.conf.tmp

cp -f /tmp/ntp.conf.tmp /etc/ntp.conf

esxcfg-firewall -e ntpClient

chkconfig --level 345 ntpd on

/usr/sbin/ntpdate ntpserver1

/sbin/hwclock --systohc -utc

service ntpd restart

i find /var/lib/ntp/drift and my ntp.conf has the path to this driftfile!

i checked my /var/log/messages and now i am not sure if my ntp part is correct because in there i find hints that my esx server uses a different ntp server or none...

1.) are /var/log/messages and/or /var/log/boot.log the files i have to look problems during installation?

2.) hm how do i check which ntpservers my esx server uses?

3.) how should a correct working ntp.conf file look like?

mine looks like:

restrict kod nomodify notrap noquery nopeer

restrict 127.0.0.1

ntpserver1

ntpserver2

ntpserver3

driftfile /var/lib/ntp/drift

thanks in advance.

greetings

schmandini

0 Kudos
espi3030
Expert
Expert

Here is the documen that I used to configure my .cfg file with.

Hope this helps!

0 Kudos