Hi, i have several vm's running on KVM hosts. Recently i found out that the time in the log-files of the guests (/var/log/libvirt/qemu/xxx.log) is wrong. The time on the guest itself is right, just the time in the log-files is one hour back. Windows and linux vm's are affected. Also on another host the same. Changing the clock offset does not have any influence, still the wrong time in the log file. Any ideas ? Bernd -- Bernd Lentes Systemadministration Institut für Entwicklungsgenetik Gebäude 35.34 - Raum 208 HelmholtzZentrum münchen bernd.lentes@helmholtz-muenchen.de phone: +49 89 3187 1241 fax: +49 89 3187 2294 http://www.helmholtz-muenchen.de/idg Die Freiheit wird nicht durch weniger Freiheit verteidigt Helmholtz Zentrum München Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH) Ingolstädter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir´in Bärbel Brumme-Bothe Geschäftsführer: Prof. Dr. Günther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht München HRB 6466 USt-IdNr: DE 129521671
On Tue, Oct 28, 2014 at 05:08:45PM +0100, Lentes, Bernd wrote:> Hi, > > i have several vm's running on KVM hosts. Recently i found out that the > time in the log-files of the guests (/var/log/libvirt/qemu/xxx.log) is > wrong. The time on the guest itself is right, just the time in the log-files > is one hour back. Windows and linux vm's are affected. Also on another host > the same. Changing the clock offset does not have any influence, still the > wrong time in the log file. > Any ideas ?The timestamps in libvirt log files should always be in UTC, never local timezone. We had to roll our own code for generating timestamps since the standard glibc formatting turned out to not be re-entrant safe, and as a results we unfortunately cannot do localtime conversion. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
On 10/28/2014 10:08 AM, Lentes, Bernd wrote:> Hi,[can you convince your mailer to wrap long lines?]> > i have several vm's running on KVM hosts. Recently i found out that the time in the log-files of the guests (/var/log/libvirt/qemu/xxx.log) is wrong. The time on the guest itself is right, just the time in the log-files is one hour back. Windows and linux vm's are affected. Also on another host the same. Changing the clock offset does not have any influence, still the wrong time in the log file.The time in libvirt logs is ALWAYS tied to UTC, precisely because that is unambiguous (any log that outputs timestamps in local time risks being misinterpreted if the log is read from a different timezone, especially if the timezone name is not included as part of the timestamp). Based on you email address, it looks like your problem is that Germany is coincident with UTC in the summer, but one hour off in the winter, and that your "problem" (which is not a bug) was made manifest because Germany left daylight savings this week. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Eric wrote:> -----Ursprüngliche Nachricht----- > Von: Eric Blake [mailto:eblake@redhat.com] > Gesendet: Dienstag, 28. Oktober 2014 17:18 > An: Lentes, Bernd; libvirt-ML (libvirt-users@redhat.com) > Betreff: Re: [libvirt-users] wrong time in guest logs > > On 10/28/2014 10:08 AM, Lentes, Bernd wrote: > > Hi, > > [can you convince your mailer to wrap long lines?] > > > > > i have several vm's running on KVM hosts. Recently i found out that the > time in the log-files of the guests (/var/log/libvirt/qemu/xxx.log) is wrong. > The time on the guest itself is right, just the time in the log-files is one hour > back. Windows and linux vm's are affected. Also on another host the same. > Changing the clock offset does not have any influence, still the wrong time in > the log file. > > The time in libvirt logs is ALWAYS tied to UTC, precisely because that is > unambiguous (any log that outputs timestamps in local time risks being > misinterpreted if the log is read from a different timezone, especially if the > timezone name is not included as part of the timestamp). Based on you > email address, it looks like your problem is that Germany is coincident with > UTC in the summer, but one hour off in the winter, and that your "problem" > (which is not a bug) was made manifest because Germany left daylight > savings this week. >Nearly. In summer we have in germany UTC+2, in winter UTC+1. Bernd Helmholtz Zentrum München Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH) Ingolstädter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir´in Bärbel Brumme-Bothe Geschäftsführer: Prof. Dr. Günther Wess, Dr. Nikolaus Blum, Dr. Alfons Enhsen Registergericht: Amtsgericht München HRB 6466 USt-IdNr: DE 129521671