VMware Cloud Community
BurtTheNerd
Contributor
Contributor

Howto update Bios hardware clock on regular basis using NTP?

Hi,

I'm using Vmware esxi4.0 and esxi4.1 on HP ProLiant servers ML350, ML370 and DL370 and Veeam Monitor to monitor them.

As I understand from the documentation, when you start up the physical server, esxi initially takes the hardware clock to use while NTP hasn't kicked in yet. My problem is that if the hardware clock is not synchronised with NTP, this will give false readings.

Is there a way to automatically sync the bios hardware clock using NTP in Vmware esxi?

The only results I've found was to use hwclock-w or hwclock--hwtosys.

But as vmware esxi4.1 is using vmkvsitools the options are not available.

There is only a link to vmkvsitools hwclock which has hwclock -t or hwclock -d to respectively set time and date.

Thanks in advance,

Bart Garrein

Tags (3)
0 Kudos
5 Replies
SimonStrutt
Enthusiast
Enthusiast

The hardware clock gets synced during a normal shutdown - so should be as accurate as possible when your ESX starts back up.  Similarly, any VM's that you have that are critically dependant on time should sync to NTP as well (not the host ESX), and will sync on startup.

The host's clock will also be updated 'periodically'.  No idea how often this is - I think the normal ntpd implementation would be for it be dynamic and adjust to suit the normal drift of your host's clock.

"The greatest challenge to any thinker is stating the problem in a way that will allow a solution." - Bertrand Russell
0 Kudos
BurtTheNerd
Contributor
Contributor

Hi,

I've done some tests by changing the clock using the hwclock command (what I suppose changes the hardware clock) but I still need to do some more.

So far I've changed the clock 1 minute off of NTP time. One hour later it was synced with NTP wihout doing anything.

Today I going to try changing it a day off.

Kind regards,

Burt

0 Kudos
rickardnobel
Champion
Champion

BurtTheNerd wrote:

So far I've changed the clock 1 minute off of NTP time. One hour later it was synced with NTP wihout doing anything.

Today I going to try changing it a day off.

Keep in mind that some NTP implemenations will not change the time if it is too large difference.

My VMware blog: www.rickardnobel.se
0 Kudos
BurtTheNerd
Contributor
Contributor

Regarding the big time difference using NTPD, while googling I've found an extra line to put in /etc/ntp.conf file.

tinker panic 0

This would make the NTP ignore the big differences. Is this good practice?

0 Kudos
SimonStrutt
Enthusiast
Enthusiast

Really depends on your perspective as to what might go wrong, but I'd suggest you should only do it for testing purposes.

Generally for small changes in time, an NTP client with  adjust the interval between the server's ticks, which is kind to  applications as they don't notice.  If the client notices a big  difference, it will just change the clock (because it would take too  long to correct the clock gradually), which can cause unexpected things  in an application.  The tinker panic stops the sudden clock change from  being too big (and causing more problems than it fixes).

By not allowing large adjustments, if something bizzare happens to your NTP source(s), your NTP clients won't update to insanely different time.  If something had happened to the NTP client for it to be over X hours out, then you are probably aware of that, and are in a position to manually fix it.  Where as if your NTP server half-fails overnight, you don't want it to have a catostrophic impact on the rest of your infrastructure by causing huge time changes.

"The greatest challenge to any thinker is stating the problem in a way that will allow a solution." - Bertrand Russell
0 Kudos