How to install and configure NTP on VMware ESX host
Tags: ESX, ntp, VMware, xntp
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:
- Set a Good Password Policy On SuSE Linux
- How To Check Which Port Is Listern or Open on Linux
- How To Force User Change Password At Next Login on Linux
- How to Disable CTRL-ALT-DEL shutdown key on Linux server
- Basic vmware-cmd VM Management tips
August 26th, 2008 at 11:44 pm
http://malaysiavm.com/blog/time-synchronize-on-vm-and-esx/