Martin Betak has posted comments on this change.

Change subject: engine: Incorrect VM TimeZone handling
......................................................................


Patch Set 3: -Verified

(2 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
Line 639:     }
Line 640: 
Line 641:     // set the timezone to use the engine default if trying to run VM 
with incorrect TZ set
Line 642:     private void handleTimeZone() {
Line 643:         TimeZoneType timeZoneType = 
OsRepositoryImpl.INSTANCE.isWindows(getVm().getOs()) ? 
TimeZoneType.WINDOWS_TIMEZONE : TimeZoneType.GENERAL_TIMEZONE;
Done
Line 644:         if (getVm().getTimeZone() != null && 
!timeZoneType.getTimeZoneList().containsKey(getVm().getTimeZone())) {
Line 645:             log.warnFormat("ResourceManager::{0}::Attempting to run 
VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.",
Line 646:                     getClass().getName(),
Line 647:                     getVmId().toString(),


Line 646:                     getClass().getName(),
Line 647:                     getVmId().toString(),
Line 648:                     getVm().getTimeZone());
Line 649:             getVm().getStaticData().setTimeZone(null);
Line 650:             getVmStaticDAO().update(getVm().getStaticData());
Ok, we need to handle the runOnce case and it will be possible as soon as 
http://gerrit.ovirt.org/#/c/17481/ is merged, but we really need this to be 
performed on runVM because this field can be set in the database to some 
invalid value - either by the user or by us - as you can see in this bug, in 
VMs created with older versions of engine there was the default timezone 
represented using empty string which was later changed to null. This as a 
result causes frontend bug where the edit vm dialog tries to select the empty 
string, it fails and selects 'null' which causes the backend to think you are 
editing the VM timezone (which is prohibited while the VM is running). This is 
why we need to prevent such VMs to be run in the first place.
Line 651:         }
Line 652:     }
Line 653: 
Line 654:     protected boolean getVdsToRunOn() {


-- 
To view, visit http://gerrit.ovirt.org/17524
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifd36656bd4f0288e86b1cbd46d702fa68051e28b
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbe...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Martin Betak <mbe...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to