Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1664490

Summary: VM's time and TZ changes to GMT Standard Time after moving VM to another cluster.
Product: Red Hat Enterprise Virtualization Manager Reporter: Bimal Chollera <bcholler>
Component: ovirt-engineAssignee: Steven Rosenberg <srosenbe>
Status: CLOSED ERRATA QA Contact: Liran Rotenberg <lrotenbe>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.7CC: bcholler, daniel-oliveira, lrotenbe, mavital, michal.skrivanek, mkalinin, rbarry, Rhev-m-bugs, sborella, srosenbe
Target Milestone: ovirt-4.3.3Keywords: Rebase
Target Release: 4.3.0Flags: lsvaty: testing_plan_complete-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.3.1 Doc Type: Enhancement
Doc Text:
This release enhancement preserves a virtual machine's time zone setting of a virtual machine when moving the virtual machine from one cluster to a different cluster.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-08 12:39:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bimal Chollera 2019-01-09 01:14:32 UTC
Description of problem:

VM time is set to GMT Standard Time after changing the VM Cluster.

Also the RHV-M GUI will then reflect GMT Standard Time whereas the TZ within the VM is different.


Version-Release number of selected component (if applicable):

~~~
ovirt-engine-4.2.7.5-0.1.el7ev.noarch
~~~

How reproducible:

100%

Steps to Reproduce:

1.	Data Center with 2 Clusters and 2 hosts.

2.  	Running VM configured with correct time and US EST TZ.

~~~
RHV-M GUI -> Compute -> Virtual Machine => {VM-Name}

Hardware Clock Time Offset:  US Eastern Standard Time
~~~

3.	From the RHV-M DB.

~~~
# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT time_zone FROM vm_static WHERE vm_name = 'win10-test';"
-[ RECORD 1 ]-----------------------
time_zone | US Eastern Standard Time
~~~

	VM timezone is EST
	
~~~
# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT utc_diff, guest_timezone_offset, guest_timezone_name, boot_time FROM vm_dynamic WHERE vm_guid = (SELECT vm_guid FROM vm_static WHERE vm_name ='win10-test');"
-[ RECORD 1 ]---------+---------------------------
utc_diff              | 0
guest_timezone_offset | -300
guest_timezone_name   | Eastern Standard Time
boot_time             | 2019-01-08 19:03:51.606-05
~~~

4.	Shutdown the VM

5.	Change the Cluster of the VM

~~~
RHV-M GUI -> Compute -> Virtual Machine => {VM-Name}
Edit VM -> General > Change the Cluster  
Click OK
~~~

	You can also change the Cluster from the System menu.

~~~
RHV-M GUI -> Compute -> Virtual Machine => {VM-Name}
Edit VM -> System > Change the Cluster  
Notice the Hardware Clock Time Offset will change to "default: (GMT) GMT Standard Time"
Click OK
~~~

6.	Now check the VM and notice the GMT Standard Time.

~~~
RHV-M GUI -> Compute -> Virtual Machine => {VM-Name}

Hardware Clock Time Offset:  GMT Standard Time
~~~

	RHV-M DB now shows GMT Standard Time
	
~~~
# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT time_zone FROM vm_static WHERE vm_name = 'win10-test';"
-[ RECORD 1 ]----------------
time_zone | GMT Standard Time
~~~

7.  Start the VM:

Login into the VM and the time will be GMT but the timezone within the VM will be Eastern Standard Time

We also see this in the RHV-M DB.

~~~
/usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT utc_diff, guest_timezone_offset, guest_timezone_name, boot_time FROM vm_dynamic WHERE vm_guid = (SELECT vm_guid FROM vm_static WHERE vm_name ='win10-test');"
-[ RECORD 1 ]---------+---------------------------
utc_diff              | 0
guest_timezone_offset | -300
guest_timezone_name   | Eastern Standard Time
boot_time             | 2019-01-08 19:25:40.243-05
~~~


Actual results:

VM time will be reported in GMT instead of the correct before changing the VM Cluster.

"Hardware Clock Time Offset:" in the RHV-M GUI changes to default GMT.

Expected results:

VM time and "Hardware Clock Time Offset:" in the RHV-M GUI should not change when VM Cluster.

Additional info:

Comment 3 Bimal Chollera 2019-01-09 01:27:57 UTC
As a workaround, you can change the Cluster from the System Menu instead from first General Menu.
From there you can also change the "Hardware Clock Time Offset" to correct settings.

~~~
RHV-M GUI -> Compute -> Virtual Machine => {VM-Name}
Edit VM -> System > 
> Change the Cluster
> Change "Hardware Clock Time Offset" to correct settings
Click OK
~~~

Comment 5 Ryan Barry 2019-01-16 15:43:30 UTC
Moving back to ASSIGNED while waiting for the needinfo so it isn't FailedQA if it doesn't work

Comment 7 Liran Rotenberg 2019-01-16 19:31:42 UTC
Did not reproduce by the steps given.
Tested on:
ovirt-engine-4.2.8.2-0.1.el7ev.noarch
ovirt-engine-4.3.0-0.8.rc2.el7.noarch

Comment 8 Ryan Barry 2019-01-17 20:39:46 UTC
Bimal, this isn't reproducible by engineering or QE on 4.2.8 or 4.3. Can you try on one of those, or provide exact steps to a reproducer?

Comment 9 Ryan Barry 2019-01-21 14:53:33 UTC
Re-targeting to 4.3.1 since it is missing a patch, an acked blocker flag, or both

Comment 13 Bimal Chollera 2019-02-11 23:07:59 UTC
Hi,

During the demo of the problem to Steven, we noticed this problem also happens if you just change the "Operating System".

~~~
RHV-M UI -> Virtual Machine -> Edit VM -> System tab.
~~~

The "Hardware Clock Time Offset" will change to "default GMT Standard Timezone" as well.

Thanks
Bimal.

Comment 14 Michal Skrivanek 2019-02-20 10:11:13 UTC
(In reply to Bimal Chollera from comment #13)
> During the demo of the problem to Steven, we noticed this problem also
> happens if you just change the "Operating System".

yes, because the set of TZs is different. But that's not the point of this bug, is it?
Here in this bug it is just that it shouldn't be reset on a Cluster change

Comment 15 Bimal Chollera 2019-02-20 19:29:54 UTC
(In reply to Michal Skrivanek from comment #14)
> (In reply to Bimal Chollera from comment #13)
> > During the demo of the problem to Steven, we noticed this problem also
> > happens if you just change the "Operating System".
> 
> yes, because the set of TZs is different. But that's not the point of this
> bug, is it?
> Here in this bug it is just that it shouldn't be reset on a Cluster change


Yes, this correct, when the BZ was added the problem was reproducible with Cluster Change.
But during the demo to Steven, we noticed the TZ also changes when changing the "Operating System".
Regardless, Cluster change or OS change - the TZ shouldn't change.

Comment 20 Liran Rotenberg 2019-04-03 07:10:01 UTC
Verified on:
ovirt-engine-4.3.3.1-0.1.el7.noarch

Steps:
1. Data Center with 2 Clusters and 2 hosts.
2. Running VM configured with correct time and US EST TZ.
~~~
RHV-M GUI -> Compute -> Virtual Machine => {VM-Name}

Hardware Clock Time Offset:  US Eastern Standard Time (Indiana)
~~~
3. From the RHV-M DB.
# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT time_zone FROM vm_static WHERE vm_name = '{VM-Name}';"
-[ RECORD 1 ]-------------------
time_zone | America/Indianapolis

# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT utc_diff, guest_timezone_offset, guest_timezone_name FROM vm_dynamic WHERE vm_guid = (SELECT vm_guid FROM vm_static WHERE vm_name ='{VM-Name}');"
-[ RECORD 1 ]---------+---------------------------
utc_diff              | 0
guest_timezone_offset | -240
guest_timezone_name   | EDT

4. Check timezone inside the guest VM:
# timedatectl
                Time zone: America/New_York (EDT, -0400)


4. Shutdown the VM
5. Change the Cluster of the VM (Try to do so when looking in the VM->System tab)
6. See that changing the cluster didn't change the time zone.
7. Check engine's DB again:
# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT time_zone FROM vm_static WHERE vm_name = '{VM-Name}';"
-[ RECORD 1 ]-------------------
time_zone | America/Indianapolis

# /usr/share/ovirt-engine/dbscripts/engine-psql.sh -x -c "SELECT utc_diff, guest_timezone_offset, guest_timezone_name FROM vm_dynamic WHERE vm_guid = (SELECT vm_guid FROM vm_static WHERE vm_name ='{VM-Name}');"
-[ RECORD 1 ]---------+---------------------------
utc_diff              | 0
guest_timezone_offset | -240
guest_timezone_name   | EDT

8. Start the VM
9. Check VM timezone:
# timedatectl
                Time zone: America/New_York (EDT, -0400)

Comment 22 errata-xmlrpc 2019-05-08 12:39:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:1085

Comment 23 Daniel Gur 2019-08-28 13:14:33 UTC
sync2jira

Comment 24 Daniel Gur 2019-08-28 13:19:36 UTC
sync2jira