echothrust/howtos

A list of OpenBSD (mostly) material

View on GitHub

Notes for OpenBSD ntpd under VMware ESXi

This is quite outdated by now. We havent tried any of those things for quite some time…

The following document outlines information required in order to properly configure our ESXi hypervisor and OpenBSD guest systems to correctly keep track of time and time changes through OpenNTPD.

Please note that the following is based on our own experiments/experiences and outlines what seems to be working best on our environment and setup, your mileage may vary.

Introduction

Virtualization allows to run multiple operating systems at the same time on a single host (hypervisor), however we often forget that this comes at a cost. The cost in our case is the queuing and scheduling of certain events, and one of those is the ntp get and set time operations.

On a hypervisor running multiple guests the ntp operations might be queued up, causing constant increments of the deviation and eventually starving the system by overloading the hypervisor with sync requests.

hypervisor configuration

Starting the the hypervisor we need to make sure ESXi is configured in the following way.

ESXi can provide periodical syncing of time of the guests with the hypervisor through the use of the VMware Tools. In order to check the status of this periodic sync we have to check the following parameter from the guest vmx configuration file.

For instance for our server named example.echothrust.com VMware tools are NOT configured to periodically sync time:

grep syncTime /vmfs/volumes/datastore1/example.echothrust.com/*vmx

tools.syncTime = "FALSE"

Even if this synchronization is disabled, by default VMware Tools synchronizes the virtual machine’s time after a few specific events.

This one-time synchronization is done by VMware Tools for specific events such as:

ESXi vSphere Client

Make sure that the system that runs the vSphere client is configured to use UTC as timezone, otherwise your hypervisor will “change” time for you hypervisor when it connects and also for your guest systems as well.

Copy paste the following into a file named UTC.reg and import into your system, in order to change the timezone into UTC.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
“RealTimeIsUniversal”=dword:00000001

OpenBSD guest configuration

Configuration of an OpenBSD guest is quite easy and straightforward.

Configure ntpd to use the existing vmt devices as time-delta source by using the following /etc/ntpd.conf.

sensor vmt0

Activate ntpd and we configure it to start with the ability to skip as much time as it needs in order to sync the clock upon init.

rcctl enable ntpd
rcctl set ntpd flags "-s"

Start the service

/etc/rc.d/ntpd start

Notes

VMT(4)

vmt will log notifications that the guest has been suspended or resumed by the host. It also provides access to the host machine’s clock as a timedelta sensor.

A vmwh helper program is available via packages(7).

NOTE: The vmwh utility will segfault on a system that isn’t run as guest on the ESXi.

References