How to install and configure NTP on VMware ESX host

Posted on January 17, 2008

advertisement

The following article will guide you ‘how to install and configure NTP on VMware ESX host’

1. SSH on to VMware ESX host service console as the root user
2. Make a backup copy of existing files.
[root@esxhost]#cp /etc/ntp.conf /etc/ntp.conf.orig
[root@esxhost]#cp /etc/ntp/step-tickers etc/ntp/step-tickers.orig

3. Edit /etc/ntp.conf
[root@esxhost]#vi /etc/ntp.conf
#Insert the following details as example below:
restrict ntp1.planetmy.com kod nomodify notrap server
restrict ntp2.planetmy.com kod nomodify notrap server
server ntp1.planetmy.com
server ntp2.planetmy.com
driftfile /var/lib/ntp/drift
authenticate yes

Please refer to here for a full description of these access control commands. The driftfile line indicates the name of the file where the value for the system’s clock drift (frequency error) is stored. For a more complete definition of driftfile, see here.

4. Edit /etc/ntp/step-tickers
[root@esxhost]#vi /etc/ntp/step-tickers
#Insert the following ntp server as example below:
ntp1.planetmy.com
ntp1.planetmy.com

5. Edit /etc/hosts
[root@esxhost]#vi /etc/hosts
#Insert the following details as example below:
10.10.10.1    ntp1.planetmy.com    ntp1
10.10.10.2    ntp2.planetmy.com    ntp2

#Adding this list of NTP servers minimizes the impact of DNS lookup failures during NTP synchronization.

6. Firewall – opens the appropriate ports and enables the NTP daemon to talk with the external server.
[root@esxhost]#esxcfg-firewall –enableService ntpClient

7. Restarting and Monitoring the NTP Service
#To restart the service now, run:
[root@esxhost]#service ntpd restart

#To enable the NTP daemon to autostart when the server is rebooted, run:
[root@esxhost]#chkconfig ntpd on

#Set the local hardware clock to the NTP synchronized local system time, run:
[root@esxhost]#hwclock –systohc

#Monitor the NTP service
#See the offset (in seconds) between the local clock and the source clock, run:
[root@esxhost]#ntpdate -q NTP_time_server_name_or_ip_address

#To watch the status of the ntpd process, run:
[root@esxhost]#watch “ntpq -p”
#Press Ctrl-c to stop watching the process.

#start time synchronization  without rebooting, run:
[root@esxhost]#/etc/rc.d/init.d/ntpd start
#The time drift corrects after a while.

#please wait few minutes andlist the current status
[root@esxhost]#ntpq -p

8. Manually synchronization
[root@esxhost]#/etc/init.d/ntpd stop
[root@esxhost]#/etc/init.d/ntpd status
ntpd is stopped
[root@esxhost]#ntpdate -u ntp1.planetmy.com
17 Jul 20:20:12 ntpdate[22944]: step time server 10.10.10.1 offset -8671.09148 sec

9. Adjust Time Zone
[root@esxhost]#cp /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
[root@esxhost]#date
Thu Jan 17 20:00:56 MYT 2007

Congratulations! You’re done!

Source: VMware KB

Possibly Related Posts:


Comments

One Response to “How to install and configure NTP on VMware ESX host”

  1. Planet Malaysia on August 26th, 2008 11:44 pm

Leave a Reply




Planet Malaysia

  • Follow us on Twitter


  • web www.planetmy.com