Page 1 of 1

Rebooting vm resets time to wrong zone...

Posted: Sat Feb 13, 2016 10:01 am
by SnakeByte
QNAP TS-670 Pro
4.2.0 2016/01/19
Virtualization Station: 2.0.3924

I'm having a strange issue with my Centos 7 VM where when it reboots, the time is 8 hours earlier than it should be.

QNAP Host -> System Settings -> General Settings -> Time, has the correct time zone (GMT-08:00) Pacfic Time
and the Current Date and time in that tab correctly shows the correct time and date.

It is also set to syncronize via ntp to us.pool.ntp.org

The VM has a symbolic link if /etc/localtime pointing to /usr/share/timezone/America/Los_Angeles

If I run "date" I see PST as part of the time, however the time is still wrong by 8 hours in the past.

ntpdate us.pool.ntp.org states "no server suitable for synchronization found"

however ntpdate -d us.poo.ntp.org shows that it can communicate with the server -- it's just that the time difference is too great to apparently do anything?

Code: Select all

server 132.163.4.102, port 123
stratum 1, precision -29, leap 00, trust 000
refid [ACTS], delay 0.07625, dispersion 0.00128
transmitted 4, in filter 4
reference time:    da690a79.39e128ac  Fri, Feb 12 2016 17:50:49.226
originate timestamp: da690aa0.f5c78865  Fri, Feb 12 2016 17:51:28.960
transmit timestamp:  da689a20.3487970d  Fri, Feb 12 2016  9:51:28.205
filter delay:  0.07947  0.07625  0.08154  0.08531
         0.00000  0.00000  0.00000  0.00000
filter offset: 28800.72 28800.72 28800.72 28800.72
         0.000000 0.000000 0.000000 0.000000
delay 0.07625, dispersion 0.00128
offset 28800.720530

12 Feb 09:51:28 ntpdate[3466]: step time server 132.163.4.102 offset 28800.720530 sec


The strange thing is this:

Code: Select all

[root@localhost etc]# timedatectl status
      Local time: Fri 2016-02-12 09:53:13 PST
  Universal time: Fri 2016-02-12 17:53:13 UTC
        RTC time: Fri 2016-02-12 17:53:13
       Time zone: America/Los_Angeles (PST, -0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2015-11-01 01:59:59 PDT
                  Sun 2015-11-01 01:00:00 PST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2016-03-13 01:59:59 PST
                  Sun 2016-03-13 03:00:00 PDT


According to this, what the VM thinks is UTC is actually PST.. which shouldn't be the case. My time zone is being applied twice.

As a test, I changed the timezone of the QNAP host to GMT and then restarted my VM -- the VM now shows the correct time.

Is there a way to tell the virtualization station not to adopt the qnap host's timezone, or otherwise fix this? I can't keep the qnap in GMT because it screws up everything that runs on the host, and I cant change the timezone to GMT in the VM because I need accurate time stamps (it's a vm for surveillance).

Re: Rebooting vm resets time to wrong zone...

Posted: Fri May 06, 2016 6:44 pm
by davidlballenger
Did you find the solution to this? I'm having the same problem.

Re: Rebooting vm resets time to wrong zone...

Posted: Fri May 17, 2019 9:25 pm
by PGN-1111
/share/CACHEDEV2_DATA/.qpkg/QKVM/usr/bin/virsh edit VM_UUID
<clock offset='localtime'/> has to be changed to <clock offset='utc'/>
I couldn't figure out a way yet to make this through non-interactive command line like:
sed -i "s/clock offset='localtime'/clock offset='utc'/gI" "${VM_TEMPLATE}"
This doesn't work.