Bug 988259 - [Admin Portal] Cannot update VM properties - Field timeZone can not be updated when status is Up
Summary: [Admin Portal] Cannot update VM properties - Field timeZone can not be update...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-webadmin-portal
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 3.3.0
Assignee: Martin Betak
QA Contact: Pavel Novotny
URL:
Whiteboard: virt
: 974985 996183 1000853 1002616 (view as bug list)
Depends On:
Blocks: 974985 987906 1000034
TreeView+ depends on / blocked
 
Reported: 2013-07-25 08:20 UTC by Jiri Belka
Modified: 2018-12-03 19:47 UTC (History)
13 users (show)

Fixed In Version: is18
Doc Type: Bug Fix
Doc Text:
Older versions of the Manager set the virtual machine's default time zone to an empty string, but this field is now set to a null value. This update adds a database migration script to handle this change, so users can update the time zone on running virtual machines.
Clone Of:
: 1000034 (view as bug list)
Environment:
Last Closed: 2014-01-21 17:34:51 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
engine.log,vm_static.txt,vm_dynamic.txt (590.00 KB, application/x-tar)
2013-07-25 08:20 UTC, Jiri Belka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 465813 0 None None None 2018-12-03 19:47:42 UTC
Red Hat Product Errata RHSA-2014:0038 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Virtualization Manager 3.3.0 update 2014-01-21 22:03:06 UTC
oVirt gerrit 17524 0 None MERGED engine: Incorrect VM TimeZone handling 2020-11-19 20:21:57 UTC
oVirt gerrit 17672 0 None MERGED core: Normalize default VM time zone representation 2020-11-19 20:21:36 UTC
oVirt gerrit 19929 0 None MERGED frontend: Correct default time-zone rendering 2020-11-19 20:21:35 UTC

Description Jiri Belka 2013-07-25 08:20:04 UTC
Created attachment 778107 [details]
engine.log,vm_static.txt,vm_dynamic.txt

Description of problem:
I have old Windows VMs on my setup (installed on some old 3.2 version, 2013-06-04 17:05:23+02), when running on sf18.3 version I cannot update any properties of the VMs, it means I get same dialog even when clicking on 'OK' button without touching anythig.

2013-07-25 09:37:49,028 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (ajp-/127.0.0.1:8702-12) [56ede4b8] Lock Acquired to object EngineLock [exclusiveLocks= key: jb-wxp value: VM_NAME
, sharedLocks= ]
2013-07-25 09:37:49,028 ERROR [org.ovirt.engine.core.utils.ObjectIdentityChecker] (ajp-/127.0.0.1:8702-12) [56ede4b8] Field timeZone can not be updated when status is Up
2013-07-25 09:37:49,028 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (ajp-/127.0.0.1:8702-12) [56ede4b8] ObjectIdentityChecker.IsUpdateValid:: Not updatable field 'timeZone' was updated
2013-07-25 09:37:49,028 WARN  [org.ovirt.engine.core.bll.UpdateVmCommand] (ajp-/127.0.0.1:8702-12) [56ede4b8] CanDoAction of action UpdateVm failed. Reasons:VAR__ACTION__UPDATE,VAR__TYPE__VM,VM_CANNOT_UPDATE_ILLEGAL_FIELD
2013-07-25 09:37:49,028 INFO  [org.ovirt.engine.core.bll.UpdateVmCommand] (ajp-/127.0.0.1:8702-12) [56ede4b8] Lock freed to object EngineLock [exclusiveLocks= key: jb-wxp value: VM_NAME
, sharedLocks= ]

This issue does not occur when using newly created VMs (on is6). So it looks it is something related to older TZ handling.

Workaround: stop VM, change manually to specific TZ, start it up, then one can update vm properties without problem when the VM is running.

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

How reproducible:
hardly

Steps to Reproduce:
1. old VMs from 3.2 setup
2. have then runing on sf18.3
3. update vm properties

Actual results:
error

Expected results:
should work

Additional info:
Time Zone: default: (GMT) GMT Standard Time

the field is not grey but white which seems to be changeable when a VM is running.
Isn't this issue related to this field and how it is handled?

Comment 6 Martin Betak 2013-07-30 08:32:13 UTC
Michal: yes it should be grayed out but this change 7bf5df627c1748b8851b5cc48c62e44b5cf49f17 incorrectly greys it "if and only if the VM is linux" so a running windows VM has this listbox enabled (white).

Comment 7 Michal Skrivanek 2013-08-13 10:57:36 UTC
*** Bug 996183 has been marked as a duplicate of this bug. ***

Comment 8 Michal Skrivanek 2013-08-14 07:36:38 UTC
*** Bug 974985 has been marked as a duplicate of this bug. ***

Comment 11 Michal Skrivanek 2013-08-26 08:21:15 UTC
*** Bug 1000853 has been marked as a duplicate of this bug. ***

Comment 12 Itamar Heim 2013-08-30 06:52:31 UTC
*** Bug 1002616 has been marked as a duplicate of this bug. ***

Comment 13 Julio Entrena Perez 2013-08-30 10:36:03 UTC
Since bug 1002616 has been closed as a duplicate of this bug please take into account that Windows domain should not be populated in the database when importing Linux VMs exported from RHEV 2.2, please see bug 1002616 for more details.

Comment 14 Jiri Belka 2013-10-02 12:21:03 UTC
Imported a VM from 3.2 env. DB on 3.3 (is17) shows:

select vm_name,time_zone from vm_static where vm_name ilike '%test-tz%' and time_zone is not NULL;
 vm_name | time_zone 
---------+-----------
 test-tz | 
(1 row)

After starting this imported VM while clicking on 'OK' button in VM properties:

-%-
Error while executing action:

test-tz:

    There was an attempt to change VM values while the VM is not down. Please shut down the VM in order to modify these properties.
-%-

2013-10-02 14:19:21,942 ERROR [org.ovirt.engine.core.utils.ObjectIdentityChecker] (ajp-/127.0.0.1:8702-21) Field timeZone can not be updated when status is Up
2013-10-02 14:19:21,942 WARN  [org.ovirt.engine.core.utils.ObjectIdentityChecker] (ajp-/127.0.0.1:8702-21) ObjectIdentityChecker.IsUpdateValid:: Not updatable field 'timeZone' was updated

mbetak@ said that import should replace empty string in 'time_zone' with NULL as well.

Comment 15 Pavel Novotny 2013-10-16 15:22:11 UTC
Verified in rhevm-3.2.4-0.44.el6ev.noarch (sf21).

Verification steps:
1) In older RHEVM 3.2 (3.2.0 aka sf17.5 in this case) create new VM with Windows OS type.
2) In DB, simulate the old behavior via seting the time_zone to empty string :
{{{
# psql -U engine engine
engine=> \pset null <NULL>
engine=> UPDATE vm_static SET time_zone = '' where vm_name = 'my-win7-sf17_5';
UPDATE 1
engine=> SELECT vm_guid, vm_name, time_zone from vm_static;
               vm_guid                |    vm_name     | time_zone 
--------------------------------------+----------------+-----------
 00000000-0000-0000-0000-000000000000 | Blank          | <NULL>
 993f9143-1a45-4f69-a739-34be9f62f049 | my-win7        | 
}}}
3) Run the VM in webadmin and try to edit for example the description -> you should get an error pop-up. Stop the VM.
4) Upgrade to RHEVM 3.2.4 (sf21)
5) Repeat step 3 -> now it should be possible to change the description.
6) Check the time_zone value in DB:
{{{
# psql -U engine engine
engine=> \pset null <NULL>
engine=> SELECT vm_guid, vm_name, time_zone from vm_static;
               vm_guid                |    vm_name     | time_zone 
--------------------------------------+----------------+-----------
 00000000-0000-0000-0000-000000000000 | Blank          | <NULL>
 993f9143-1a45-4f69-a739-34be9f62f049 | my-win7        | <NULL>
}}}

Comment 16 Pavel Novotny 2013-10-16 15:28:31 UTC
(In reply to Pavel Novotny from comment #15)
> Verified in rhevm-3.2.4-0.44.el6ev.noarch (sf21).
> 
> Verification steps:
> 1) In older RHEVM 3.2 (3.2.0 aka sf17.5 in this case) create new VM with
> Windows OS type.
> 2) In DB, simulate the old behavior via seting the time_zone to empty string
> :
> {{{
> # psql -U engine engine
> engine=> \pset null <NULL>
> engine=> UPDATE vm_static SET time_zone = '' where vm_name =
> 'my-win7-sf17_5';
> UPDATE 1
> engine=> SELECT vm_guid, vm_name, time_zone from vm_static;
>                vm_guid                |    vm_name     | time_zone 
> --------------------------------------+----------------+-----------
>  00000000-0000-0000-0000-000000000000 | Blank          | <NULL>
>  993f9143-1a45-4f69-a739-34be9f62f049 | my-win7        | 
> }}}
> 3) Run the VM in webadmin and try to edit for example the description -> you
> should get an error pop-up. Stop the VM.
> 4) Upgrade to RHEVM 3.2.4 (sf21)
> 5) Repeat step 3 -> now it should be possible to change the description.
> 6) Check the time_zone value in DB:
> {{{
> # psql -U engine engine
> engine=> \pset null <NULL>
> engine=> SELECT vm_guid, vm_name, time_zone from vm_static;
>                vm_guid                |    vm_name     | time_zone 
> --------------------------------------+----------------+-----------
>  00000000-0000-0000-0000-000000000000 | Blank          | <NULL>
>  993f9143-1a45-4f69-a739-34be9f62f049 | my-win7        | <NULL>
> }}}


Replied to wrong BZ, ^^^ this belongs to bug 1000034. Moving back to ON_QA.

Comment 17 Pavel Novotny 2013-10-21 13:37:00 UTC
FailedQA in rhevm-3.3.0-0.25.beta1.el6ev.noarch (is18).

The SQL upgrade script that handles the time zone fileld coversion to null is present but it's not executed during the RHEVM upgrade process:
{{{
# cat /usr/share/ovirt-engine/dbscripts/upgrade/03_03_0780_convert_empty_timezone_to_null.sql
-- update VMs from old engine version that used
-- empty string to represent 'default' time_zome
update vm_static
set time_zone = NULL
where time_zone = '';
# egrep -i 'set\s*time_zone'  /var/log/ovirt-engine/setup/ovirt-engine-setup-20131021151317.log || echo "nothing"
nothing
}}}

After update from is17 to is18 the VM's time_zone value is still an empty string:
{{{
# psql -U engine engine
engine=> \pset null <NULL>
Null display is "<NULL>".
engine=> SELECT vm_guid, vm_name, time_zone from vm_static order by 2;
               vm_guid                | vm_name  | time_zone 
--------------------------------------+----------+-----------
 00000000-0000-0000-0000-000000000000 | Blank    | <NULL>
 419407cd-a466-4199-a8ae-e04f1676990f | no_tz-vm | 
(2 rows)
}}}

Comment 18 Pavel Novotny 2013-10-22 10:21:49 UTC
Correction - after discussion with @mbetak, the SQL upgrade script is executed only during RHEVM update from older version than 3.3 (i.e., 3.2.x, 3.1, ...) to 3.3 version. 
Therefore the verification process in comment 17 is irrelevant as there were used two testing builds, both RHEVM 3.3.0.

Moving back to ON_QA.

Comment 19 Pavel Novotny 2013-10-22 15:17:37 UTC
Verified in rhevm-3.3.0-0.27.beta1.el6ev.noarch (is19).

Verification steps:
1) In RHEVM 3.2 (3.2.0 aka sf17.5 in this case) create new VM with Windows OS type.
2) In DB, simulate the old behavior via seting the time_zone to empty string :
{{{
# psql -U engine engine
engine=> \pset null <NULL>
engine=> UPDATE vm_static SET time_zone = '' where vm_name = 'my-vm';
UPDATE 1
engine=> SELECT vm_guid, vm_name, time_zone from vm_static;
               vm_guid                |    vm_name     | time_zone 
--------------------------------------+----------------+-----------
 00000000-0000-0000-0000-000000000000 | Blank          | <NULL>
 46bcdafc-8b44-4082-afbb-6ac9aaa5a48d | my-vm          | 
}}}
3) Upgrade to RHEVM 3.3 (is19)
4) Check the time_zone value in DB:
{{{
# psql -U engine engine
engine=> \pset null <NULL>
engine=> SELECT vm_guid, vm_name, time_zone from vm_static;
               vm_guid                |    vm_name     | time_zone 
--------------------------------------+----------------+-----------
 00000000-0000-0000-0000-000000000000 | Blank          | <NULL>
 46bcdafc-8b44-4082-afbb-6ac9aaa5a48d | my-vm          | <NULL>
}}}

Comment 20 errata-xmlrpc 2014-01-21 17:34:51 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.

http://rhn.redhat.com/errata/RHSA-2014-0038.html


Note You need to log in before you can comment on or make changes to this bug.