Score:1

What's the correct way to set the time on ESXI hosts?

cn flag

I tried doing it through cli with the following command:

esxcli system time set -d 3 -M 11 -y 2021 -H 14 -m 10 -s 0

But after restarting a guest OS (Windows), the time on it resets to the wrong one again (1 hour late in this case).

cn flag
Windows guests usually aren't configured to synchronize time with the host.
peterh avatar
pk flag
Sometimes time-related tools miss the time zone info, or they use it badly.
Score:2
ru flag

The proper way is to continuously synchronize your host with an SNTP server.

You should always have an exact time on your host to ensure that any guest that is 'stunned' (pause, snapshot, ...) is resynchronized correctly. If the host's time is off, it'll push that time to any stunned guests (regardless of the synchronize guest time with host setting!), potentially causing time to jump. You surely don't want that.

In vSphere Client, go to Host -> Manage -> System -> Time & Date -> Edit SNTP settings. Set NTP service startup policy to Start and stop with host and enter a trusted SNTP server. In Services start the ntpd service.

For the guest itself you can choose whether you generally want to synchronize with the host or (better) with your trusted SNTP server directly. Most often, Windows clients and servers are synced through AD - either a domain controller or a dedicated SNTP 'master'.

IDEtoSATA avatar
cn flag
That's exactly what I needed, thanks. Although the path to NTP looks like this on my vSphere Client (version 7.0.2.00400): Host -> Configure -> System -> Time Configuration -> Network Time Protocol -> Edit.
Zac67 avatar
ru flag
Yes, that's likely the path with a vCenter connection - my lab VCSA's currently dead, so I connected to the host directly. ;-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.