dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
7152
batsona
Maryland
join:2004-04-17
Ellicott City, MD

batsona

Member

ESXi 5.0 Question: NTP....

I bet this is simple... I can't keep my freeBSD virtual machine in the right timezone. I manually set the clock & it's correct, but when I reboot, the clock is perfectly 4h in the future! Here's more info:

----Time on ESXi srvr set by NTP, and is in UTC timezone

----Time on win7 host running ESX Vsphere Client (that I use to control ESXi) is set by ActiveDirectory, and is in Eastern timezone

----Time on freeBSD has been set manually, and is configured for "UTC" as well.

Is there something funky going on regarding my workstation, which is 4h behind the ESXi srvr, in the eastern timezone, that causes the freeBSD guest to be 4h ahead of UTC?

Drex
Beer...The other white meat.
Premium Member
join:2000-02-24
Not There

Drex

Premium Member

Don't know if this will be of any benefit, but I found a couple articles:
»support.ntp.org/bin/view ··· MWareNTP

»www.vmware.com/files/pdf ··· ines.pdf

»kb.vmware.com/selfservic ··· =1003063

Can't say I've done much configuring of NTP in the VMware environment though.

netboy34
Premium Member
join:2001-08-29
Kennesaw, GA

netboy34 to batsona

Premium Member

to batsona
Here is a good read for you

»www.vmware.com/files/pdf ··· ines.pdf

exocet_cm
Writing
Premium Member
join:2003-03-23
Brooklyn, NY

exocet_cm to batsona

Premium Member

to batsona
Click for full size
You mentioned upon reboot, is this option set/not set?

Modus
I hate smartassery on forums
Premium Member
join:2005-05-02
us

Modus

Premium Member

said by exocet_cm:

You mentioned upon reboot, is this option set/not set?

Yep that is best practice right there. Maybe sure the time is correct on the host
batsona
Maryland
join:2004-04-17
Ellicott City, MD

batsona to exocet_cm

Member

to exocet_cm
Thanks! I'll have a look at this & post with what I found. Question: Does this cause VMtools on the guest to periodically sync the time, or is the time synced upon starting the guest os? I ask, because some of the guests on this ESXi server are Linux, and will be running 'ntpdate' against an NTP host all on their own, after boot.

I read thru the docs linked earlier in this post, thanks! It would seem that ESXi will present the guest OS with a 'clock' that it will use to set the OS clock upon boot. As long as ESXi itself is set by NTP (which mine is), that I should have a fairly accurate time @ boot, even before 'ntpdate' takes over time-sync inside Linux...

exocet_cm
Writing
Premium Member
join:2003-03-23
Brooklyn, NY

exocet_cm

Premium Member

said by batsona:

Thanks! I'll have a look at this & post with what I found. Question: Does this cause VMtools on the guest to periodically sync the time, or is the time synced upon starting the guest os? I ask, because some of the guests on this ESXi server are Linux, and will be running 'ntpdate' against an NTP host all on their own, after boot.

I read thru the docs linked earlier in this post, thanks! It would seem that ESXi will present the guest OS with a 'clock' that it will use to set the OS clock upon boot. As long as ESXi itself is set by NTP (which mine is), that I should have a fairly accurate time @ boot, even before 'ntpdate' takes over time-sync inside Linux...

Let us know if this solved your problem.
exocet_cm

exocet_cm to batsona

Premium Member

to batsona
Time keeping best practice with Linux distros on ESXi:
»kb.vmware.com/selfservic ··· =1006427
batsona
Maryland
join:2004-04-17
Ellicott City, MD

batsona to exocet_cm

Member

to exocet_cm
OP Here: I think I got it. The way ESXi deals with its time is weird & confusing. The time you see thru the VSphere Client is translated to the local time of that VSphere client. In my case this is eastern time, or GMT-5 (not the 4hr difference I saw earlier in this thread -- I can't count..) So let's say:

eastern time: 13:00
UTC: 18:00 (the time I set for the ESX server via the VSphere client)

My guest OS would boot up & its time would be 23:00

So, I set "13:00" as the current time on my ESXi server, via the VSphere client. (weird, I noticed when I did this, the time turned from red to black). NTP didn't yell at me at all when I set the time to something different than what it was hearing via NTP, but maybe the color of the time was telling me something.

With my ESXi time set to 13:00, I rebooted my guest, and sure enough I now have correct UTC on the guest (18:00) Setting the time-sync to on vs. off in the "VMware Tools" section of the properties didn't do anything to affect what was going on during boot. BUT: I have a question:

If the time-sync with the guest is turned on, does that mean the guest OS will receive a time-sync thru VMware-Tools, a la NTP? if so, I don't want that. I do understand that the OS (windows, mac, Linux....) will receive a time-sync upon boot, because the OS will look to the HW clock to set its own. However, once the OS is up, I'd like ESXi to NOT communicate time to the guest; and I'd like it set purely via 'ntpdate' in Linux (run by root's Cron)

exocet_cm
Writing
Premium Member
join:2003-03-23
Brooklyn, NY

exocet_cm

Premium Member

said by batsona:

OP Here: I think I got it. The way ESXi deals with its time is weird & confusing. The time you see thru the VSphere Client is translated to the local time of that VSphere client. In my case this is eastern time, or GMT-5 (not the 4hr difference I saw earlier in this thread -- I can't count..) So let's say:

eastern time: 13:00
UTC: 18:00 (the time I set for the ESX server via the VSphere client)

My guest OS would boot up & its time would be 23:00

So, I set "13:00" as the current time on my ESXi server, via the VSphere client. (weird, I noticed when I did this, the time turned from red to black). NTP didn't yell at me at all when I set the time to something different than what it was hearing via NTP, but maybe the color of the time was telling me something.

With my ESXi time set to 13:00, I rebooted my guest, and sure enough I now have correct UTC on the guest (18:00) Setting the time-sync to on vs. off in the "VMware Tools" section of the properties didn't do anything to affect what was going on during boot. BUT: I have a question:

If the time-sync with the guest is turned on, does that mean the guest OS will receive a time-sync thru VMware-Tools, a la NTP? if so, I don't want that. I do understand that the OS (windows, mac, Linux....) will receive a time-sync upon boot, because the OS will look to the HW clock to set its own. However, once the OS is up, I'd like ESXi to NOT communicate time to the guest; and I'd like it set purely via 'ntpdate' in Linux (run by root's Cron)

I'm not very familiar with the sync time option in the guest settings. I personally don't use it because all of my guest VMs that require NTP are Windows-based machines and I sync them with my LAN's NTP server. My Linux VMs are for testing various things and time synchronization isn't an issue.

Have a read of the VMware KB article that I posted about Linux distro time synchronization whenever you have a spare hour.
batsona
Maryland
join:2004-04-17
Ellicott City, MD

1 recommendation

batsona

Member

OP: Problem solved.. The documentation should print wording in bold letters to the effect: When setting ESXi time via the VSphere client, make sure you use the local time in your time-zone, even if you want to use UTC throughout your environment. If local time is 13:00 and UTC is 18:00, tell the ESXi server that it's 13:00, and you'll be fine.
gavindcht
join:2013-03-31

gavindcht to exocet_cm

Member

to exocet_cm
So just to verify, the Server and client must have the same time set?
AsherN
Premium Member
join:2010-08-23
Thornhill, ON

AsherN to batsona

Premium Member

to batsona
The time sync option on the tools is only active while the guest is active. Upon reboot, the tools will sync time with the host. I had one host that did not have NTP configured and whenever I rebooted a guest, the time changed.
ke4pym
Premium Member
join:2004-07-24
Charlotte, NC

ke4pym to batsona

Premium Member

to batsona
I would second the call to not use tools to set the time of your guest.

Firstly, if you have a Windows machine that is on a domain, it is going to get its time from the domain. It is important that the on-domain Windows guest have a time matching domain time. Unless you want things like kerberos to break.

Any other guests not on the domain should either use the built in time sync tools (Windows 7/2008(r2) has very decent time sync tools now and the older OSen can be fin-ag-eled into proper time configs) or a NTP client pointing to your time sources (or the AD controllers at the very least).

One behavior you will see in VMWare on freshly imported guests is their time is off. That'll usually work itself out after a reboot or two. But you may have to manually reset the time on the guest.

Finally, for the record, NTP only talks UTC. It's up to the client to deal with TZ issues.

Source: Me, I'm a corporate time-keeper and manage a handful of GPS based NTP clocks.