ESXi host time settings
From Notes_Wiki
Home > VMWare platform > VMWare vSphere or ESXi > ESXi host time settings
Better option is to configuer NTP as explained at Configure NTP from cli or UI instead of correcting time manually.
It is critical for ESXi host to have correct time. Problem with ESXi host time can also manifest as wrong time in VMs esp. vCenter. This may lead to issues with distributed vSAN storage and also lead to issues with log times being wrong. Hence to ensure that ESXi host has correct time, perhaps do the following:
- Configure NTP at OOBE level such as IMM / iDRAC / iLO / XClarity etc. In this case ensure that timezone is set to UTC. Note that ESXi host time is always in UTC and cannot be changed. We can set appropriate timezone in vCenter, if we want to see this converted to local time at vCenter UI level.
- Configure NTP at ESXi level using ESXi host or vCenter. Ideally this should lead to correct time. However, if host time was in future then ESXi may not correct it immediately using NTP else events that happened a few seconds ago (past) would end up looking like they happened in future. To avoid this the clock could slow down (Count only 30 seconds every 60 seconds) or speed up (count 120 seconds every 60 seconds, etc.)
- If we do want the clock to auto-correct gradually or if there is no NTP and we want to set correct time manually use:
- esxcli hardware clock set -d 23 -H 09 -m 59 -M 03 -y 2021
- esxcli system time set -d 23 -H 09 -m 59 -M 03 -y 2021
- Where
- hardware clock
- Refers to BIOS /CMOS hardware clock
- System time
- Refers to currently running system software clock
- -y
- Refers to year
- -M
- Refers to month
- -d
- Refers to day of month
- -H
- Refers to hour
- -m
- Refers to minute
- Note the inconsistency where captial M is for month and small m is for minute. While capital H is for hour and small d for day.
- After this check the time using 'date' command or using Web UI
Refer:
Home > VMWare platform > VMWare vSphere or ESXi > ESXi host time settings