2

I have a ESXi host running ~20 virtual machines (mostly EL6, but also one or two Windows Server 2008 R2).

What is the best practice for timekeeping on virtual machines?

I'm thinking about 3 different ways to do it, but I'm having trouble to find pros or cons on the internet for such methods.

1) ESXi syncs with 0.pool.ntp.org and then sets the BIOS time on each VM

2) Each guest OS syncs with 0.pool.ntp.org

3) Each guest OS syncs with ntp.localdomain (a VM on my ESXi server acting as a cached proxy to 0.pool.ntp.org)

I think the third option would be the better one since it reduces outgoing network traffic from my WAN interface, and it provides a precise time between all VMs.

Could you tell me if there is a better alternative?

squillman
  • 37,883
  • 12
  • 92
  • 146
user195176
  • 21
  • 1
  • 2
  • [Q&A concerning running NTP in an ESXi VM](http://serverfault.com/questions/106501/what-are-the-limits-of-running-ntp-servers-in-virtual-machines) and why it's generally a bad idea unless necessary. – Chris S Oct 16 '13 at 15:10
  • Avoid option 3. If you are really concerned about WAN traffic then configure NTP on the ESXi host and use the ESXi host as an NTP server for your VMs. See this guide: http://www.v-front.de/2012/01/howto-use-esxi-5-as-ntp-server-or-howto.html – VFrontDe Oct 18 '13 at 21:36

1 Answers1

4

You'd better read this guide: Guide to configure NTP on ESX servers (1003063) and this complete reference: http://www.vmware.com/pdf/vmware_timekeeping.pdf

Here's common practice:

  1. configure your ESXi to sync clock time by NTP via external time sources.
  2. install VMware VMtools inside all your VMs to sync time of VM with ESXi. Notice that you can toggle the time sync feature by configuring the entry tools.syncTime = true in vm_name.vmx file of your VM.

So that you have only one NTP client runs on ESXi server, all other VMs sync time with ESXi only.

shawnzhu
  • 653
  • 4
  • 10
  • Thanks for your answer. I've already read the PDF but I heard people saying it was better to use the ntp client inside the guest machine to avoid relying on VMware Tools and because "it's more precise like that". I'm a bit confused. – user195176 Oct 16 '13 at 13:50
  • 1
    It's arguable topic on the time source choices for guest OS in virtualized environment. According to VMware, it's recommended that using NTP as time sync instead of VMtools time sync. see [Timekeeping best practices for Linux guests](http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006427). If your ESXi uses NTP to sync time, all your VMs already got the synced time via VMtools. It just tells relying VMtools less. – shawnzhu Oct 16 '13 at 14:10
  • @user195176 Whether with VMware or HyperV, I've always setup NTP on the hosts and synced the guests to the hosts, but that's just me. What I would say is that whatever you do, pick one method and be consistent with it. – Rob Moir Oct 16 '13 at 14:20