[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] what does localtime=1 actually do?



Hello,

Am Montag 08 November 2010 17:53:28 schrieb Mark Adams:
> > > 2008 R2 domU. The dom0 was rebooted, and when it came up the domU was
> > > 1 hour behind the time of dom0. It had to be changed in windows to the
> > > correct time.
...
> > Have you started daylight savings in the last few days? I've seen this
> > before and my theory is that when the domain is created, xend figures
> > out what the offset is from UTC and remembers it. If the DomU is
> > rebooted it uses the same offset which means if it was created before
> > DST started and then rebooted after, the offset will be wrong.
...
> Yes, we've just come off daylight savings so this is likely the issue. A
> bug that should be looked into maybe?

Talk to Microsoft to allow Windows to use a RTC running in UTC?

The problem (as far as I understand it) is the following: Most UNIXes use a 
real-time-clock (RTC) running in UTC. The time-zone you configured is used  
to convert from UTC to local time each time to you ask your computer for the 
local time, so its 'trivial' to correctly implement daylight saving: Your 
time-zone data contains a database which tells the C-library to add/substrace 
N+x hours in summer and N hours in winter.
For most countries the dates for daylight-switching and the number of hours x 
are mostly fixed, but in some other countries they change from year to year; 
that's why on Linux you often get updates to the timezone-database.

Windows on the other hand assumes the RTC is running in local time. To 
correctly switch to and from daylight-saving, Windows needs to store the time 
of last-shutdown and a flag which indicates, if the daylight-saving is on or 
off. Each time Windows boots it checks the date and flag to see, if the 
daylight-saving-switch-time has happended. If yes, if reads the RTC, adds or 
subtracts the daylight-saving-delta-time, stores the time back to RTC and 
record that is has done the switch.

Now what probably happend in your case: Your Linux switched from summer to 
winter and exported the already corrected local time to Windows  Windows than 
detected the change from its internal flags as well and subtractes one 
additional hour to fix its view of the RTC from summer to winter.

To fix the problem, you either can tell Xen to not export the local time to 
Windows, but a time UTC±x, where x can be cahnged by Windows and is remebered 
by Xen on shutdown. That way Windows can do its voodoo itself and Xen just 
exports a fixed-offset-RTC to Windows.
Or you can try to switch Windows to UTC by searhcing for
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001

Sincerely
Philipp Hahn
-- 
Philipp Hahn           Open Source Software Engineer      hahn@xxxxxxxxxxxxx   
Univention GmbH        Linux for Your Business        fon: +49 421 22 232- 0
Mary-Somerville-Str.1  28359 Bremen                   fax: +49 421 22 232-99
                                                    http://www.univention.de

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.