VMware Cloud Community
GlenMarquis2
Enthusiast
Enthusiast

NTP Time Source

Hi,

I have a few differnet NTP time servers that broadcast and can allow connections to update the time, I would like to see how others do this.

What do you use for correct time on your ESX boxes?

Thanks

Glen.

Reply
0 Kudos
2 Replies
dkfbp
Expert
Expert

We have a couple of internal ntp servers in our company. We use them to syncronize time on our ESX servers. I don't

know if that answers your question.

Best regards Frank Brix Pedersen blog: http://www.vfrank.org
Reply
0 Kudos
LasseHT
Enthusiast
Enthusiast

I use our main AD domain server (who looks after the time for AD), since most of my VM's are in AD, I found it to be the best way for us.

HERE IS THE HOW-TO I CREATED:

Note: The following works for ESX 3.0.2

How to set date & time:

login as root

type date (will show you servers current date/time)

to change type date mmddhhmmyyyy

mm = month

dd = day

hh = hour

mm = minute

yyyy = year

example:

10 August 2007 @ 15:45

date 081015452007

How to set timezone:

Steps to update the ESX Server to use BST.

(1) Edit /etc/sysconfig/clock:

ZONE="Europe/London" (or where ever you are!!!)

UTC=false

ARC=false

(2) Copy the time zone file to /etc/localtime.

cp /usr/share/zoneinfo/Europe/London /etc/localtime

(3) Confirm that /etc/localtime has been updated with the correct zoneinfo

data using the following steps:

diff /etc/localtime /usr/share/zoneinfo/Europe/London

After updating /etc/localtime with the correct zoneinfo data, confirm the

system and hardware clocks are correct.

Use the Linux date command to check and set the correct time if necessary.

Set the hardware clock to match the correct system time.

(5) Set the system clock to the local date and time: (Note: Not really needed if your already have configured for NTP or are going to)

date MMDDhhmmYYYY

(6) Update the hardware clock with current time of the system clock:

/sbin/hwclock --systohc

How to configure NTP to sync with xxxx-dcm01: (The AD Domain controller)

Use WinSCP3 to browse to the following files and use the Edit function to update them:

Note: vmwaredr1 host used in the following examples, please replace with the host name your configuring:

(1) update /etc/ntp.conf

restrict 127.0.0.1

restrict default kod nomodify notrap

server xxxx-dcm01.main.eig.internal

driftfile /var/lib/ntp/drift

(2) update /etc/ntp/step-tickers

xxxx-dcm01.main.eig.internal

(3) update /etc/hosts

ONLY add the IP entry for sv-glos-dcm01.....

  1. Do not remove the following line, or various programs

  1. that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

10.xxx.xxx.xxx vmwaredr1.main.eig.internal

10.xxx.x.xxx sv-glos-dcm01.main.eig.internal

(4) using putty or similar to goto the console, login as root and run the following command. This opens the appropriate ports and enables the NTP daemon to talk with the external server.

# esxcfg-firewall --enableService ntpClient (Note: its 2x minus sign before enableService....)

(5) Restart the NTP service.

# service ntpd restart

(6) To enable the NTP daemon to autostart when the server is rebooted, run:

# chkconfig --level 345 ntpd on

(7) Now you can set the local hardware clock to the NTP synchronized local system time. Run:

# hwclock --systohc

*

Two Knowledge Base articles of interest:

*

- Adjusting ESX Server Time Zone: http://kb.vmware.com/kb/1436

- Installing and Configuring NTP on VMware ESX Server: http://kb.vmware.com/kb/1339

Reply
0 Kudos