VMware Cloud Community
chickenandchips
Contributor
Contributor

How to change the NTP server name

Dear All,

Could someone advise on how I can change the NTP server name on a physical host ?

We are running VMWare Vsphere 4.1. I have added a second physical host to the environment however the in correct

NTP server was added on the physical host during the install.

I cant see a way of changing the NTP server for the host from VSphere. I am guessing this can only be done from the

console ? if so how can this be done ?

Many thanks

0 Kudos
9 Replies
Troy_Clavell
Immortal
Immortal

using the vSphere Client connect to the ESXi Host in question, go to the configuration tab, under Software choose Time Configuration--Properties.  You should be able to make the changes there.

0 Kudos
cho9045
Enthusiast
Enthusiast

In vSphere client connected vCenter Server,

1. Select ESX host you want to configure NTP server setting

2. Select "Summary" tab from right pane

3. Choose "Time Configuration" under Software section

4. Click "Properties" from the upper-right corner of screen, and "Time Configuration" window pop-ups

5. Click "Options..." button in NTP coniguration area

6. Select "NTP Setting" in left pane

7. Now you can see NTP servers list. And you can "Add...","Edit...","Remove" by clicking corresponding button.

8. check "Restart NTP service to apply changes" check box.

9. Click "OK" button

KB Article: 1003063(http://kb.vmware.com/kb/1003063) Refer this for command line method 

KB Article: 2012069(http://kb.vmware.com/kb/2012069) Refer this for vSphere client method

0 Kudos
Nikhil_Patwa
Expert
Expert

Hello,

Select the ESXi Host Configuration tab and Under Software box select the second option Time configuration.

You will see the Date and Time, NTP client and NTP server if configured, if not then click on Properties on the top right hand corner and you will be able to provide NTP configurations. Click on the option tab and add the NTP servers.

Hope this information is useful

Nikhil

0 Kudos
tigerdeccan
Enthusiast
Enthusiast

THE BELOW WILL ONLY WORK ON ESX !!!

You can Follow this it will be quick

Setting time on your ESX host:

  1. Connect to an ESX host using an SSH client.
  2. Log in with an user having administrative privileges.
  3. To open up the ntpClient port in the internal ESX host firewall, run the commands:

    esxcfg-firewall -q ntpClient
    esxcfg-firewall -e ntpClient
    esxcfg-firewall -q ntpClient

    Note: The first line tells the status of the ntpClient port. The second line enables the ntpClient port. The third line shows you that it is open.
  4. Now set the system time to the right time. If your ESX host has ntp access to the Internet, you can just issue the ntpdate command, with the -u switch, and point it at an ntp server. If your ESX host is blocked by your corporate firewall, you have to point it at an internal ntp server. If you do not have one, you have to set one up. Any of these ntpdate command should work:

    ntpdate -u 194.72.7.137
  5. Service ntpd restart
0 Kudos
tigerdeccan
Enthusiast
Enthusiast

You can also use power cli

Get-VMHost |Sort Name|Select Name, @{N=“NTPServer“;E={$_ |Get-VMHostNtpServer}}, @{N=“ServiceRunning“;E={(Get-VmHostService -VMHost $_ |Where-Object {$_.key-eq “ntpd“}).Running}}

This will give you a nice table letting you know the state of your hosts time, if you do happen to have a host with an incorrect NTP server then you can set it like this:

Add-VMHostNtpServer -VMHost MYHost -NtpServer ‘ntp.mydomain.com‘

Or if one of the services has stopped you can start it again with the following:

Get-VmHostService -VMHost MyHost | Where-Object {$_.key -eq “ntpd“} | Start-VMHostService

0 Kudos
Troy_Clavell
Immortal
Immortal

tigerdeccan -

Your solution is not valid for ESXi

0 Kudos
tigerdeccan
Enthusiast
Enthusiast

@ troy 

What about the powercli post I've posted ?

0 Kudos
Troy_Clavell
Immortal
Immortal

my suggestion would be, if you are going to copy and paste solutions, first confirm they work.

0 Kudos
tigerdeccan
Enthusiast
Enthusiast

This solution defenitely worked for me . hence i've pasted .

I've looked on cho9045 comment which is related to esx and then responed . my intention was to help someone  with my experience .

0 Kudos