Highlighted
Contributor
Contributor

Time synchronization with host internal clock

In VSphere 5.0 ESXi we can not set time synchronization with a NTP server because the ESXi host is on a private network with no Internet access, so we have to rely on the internal server clock.
I noticed that if I set the right time in the CMOS clock, VSphere client sets time 1 hour forward. On the other hand If I adjust time setting in VSphere, at reboot CMOS clock is automatically set 1 hour back. Perhaps this behaviour depends on the fact that our zone is GMT +1, but I can not understand where VSphere takes this information, and mostly if I have to set time from BIOS, or directly in VSphere client.

Thank you all.

Victor

0 Kudos
13 Replies
Highlighted
Virtuoso
Virtuoso

ESXi uses UTC time and does not support changing time zones.

vSphere Client uses the time zone settings of the system on which it is installed to adjust the displayed time.

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful |Blog: http://aravindsivaraman.com/ | Twitter : ss_aravind
0 Kudos
Highlighted
Contributor
Contributor

Can someone please help me in explaining me in a detail way regarding this issue? why the time is going 1 hour back or 1 hour forward?

Am in IST - indian standard time (http://www.timeanddate.com/library/abbreviations/timezones/)

Thanks

khamru

0 Kudos
Highlighted
Contributor
Contributor

Ok, VSphere takes information about time zone from the system on which is installed, but then why doesn't take from it also hours, minutes and seconds informations? There is always a difference of about ten seconds between time on VSphere and time on my system...

Thank you for your answer.

0 Kudos
Highlighted
Enthusiast
Enthusiast

You can follow the below steps to set the time zone, let us know if you find any difficulties

Note: It is not necessary to reboot the ESX host after following this procedure.

  1. Log into the ESX service console as root.
  2. Find the desired time zone under the directory /usr/share/zoneinfo . Some regions have multiple files in a subdirectory. For example, US contains several files, each representing a time zone.

    Note: The example below uses /usr/share/zoneinfo/US/Pacific as the new time zone file.
  3. Use nano ( or another text editor) to open /etc/sysconfig/clock . At the command prompt, type:

    nano /etc/sysconfig/clock

    Edit this file to show the relative path to the file representing the new time zone, and ensure that UTC and ARC are set as shown:

    ZONE="US/Pacific"
    UTC=false
    ARC=false
  4. Copy or link the desired time zone file to /etc/localtime . Continuing the example using US/Pacific :
    • To copy, run:

      cp /usr/share/zoneinfo/US/Pacific /etc/localtime
    • To link, run:

      ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime

      Note: If you receive a overwrite `/etc/localtime'? prompt, answer y to replace the file representing the old time zone. Again, it is not necessary to reboot the ESX host after updating /etc/localtime .
  5. Confirm that /etc/localtime has been updated with the correct zoneinfo data:
    1. Reference the zoneinfo file used in step 2 and compare it to / etc/localtime using the diff command:

      [root@esxhost]# diff /etc/localtime /usr/share/zoneinfo/US/Pacific

      If the files are identical, your prompt returns without any output.


    2. If /etc/localtime is not the same as the /usr/share/zoneinfo/<your location> , the output from the diff command appears similar to:

      Binary files /etc/localtime and /usr/share/zoneinfo/US/Pacific differ

      If the files are not the same, repeat step 4.

After updating /etc/localtime with the correct zoneinfo data, confirm the system and hardware clocks are correct. Use the Linux date command to check and set the correct time if necessary. Set the hardware clock to match the correct system time:

  1. Set the system clock to the local date and time:

    date MMDDhhmmYYYY
  2. Update the hardware clock with current time of the system clock:

    /sbin/hwclock --systohc
0 Kudos
Highlighted
Contributor
Contributor

0 Kudos
Highlighted
Contributor
Contributor

Hi anyone had a fix on this , we are using UK time zone and seems to have the same issue.

The ESX server are all 1 hour behind the v center server

0 Kudos
Highlighted

I would say, use NTP settings on ESXi5.0

Regards, ABFS
0 Kudos
Highlighted
Enthusiast
Enthusiast

I would second NTP Server suggestion.

If this helps answer your question please consider awarding points!
0 Kudos
Highlighted
Contributor
Contributor

@ Beck,

The NTP settings on Vsphere(under time configuration)shows the NTP servers are configured and displays correct time,however when i log on to esxi using SSh and check the time it is 1 hour behind.

Thanks for any help

0 Kudos
Highlighted
Contributor
Contributor

Thanks

0 Kudos
Highlighted

zonunpuia wrote:

@ Beck,

The NTP settings on Vsphere(under time configuration)shows the NTP servers are configured and displays correct time,however when i log on to esxi using SSh and check the time it is 1 hour behind.

Thanks for any help

okie, can you restart the ntp services and make sure all the ports and all opened between your NTP server and its working perfectly. If there is proper NTP settings for ESXi, it should take the time from NTP when you start the services.

Regards, ABFS
0 Kudos
Highlighted

port 123( udp), unfortunately you can't telnet udp ports.

Regards, ABFS
0 Kudos
Highlighted
Enthusiast
Enthusiast

ESXi uses UTC time and does not support changing time zones.

As such, you need to set the time on your vSphere Hosts' BIOS to the current UTP time. NTP will then configure the time correctly in vSphere

0 Kudos