Omer Frenkel has submitted this change and it was merged.
Change subject: core: make ClearNonResponsiveVdsVms non-transactive
......................................................................
core: make ClearNonResponsiveVdsVms non-transactive
ClearNonResponsiveVdsVmsCommand basically do the following things:
1. Change all the VMs that ran on the host to DOWN
2. Update the VDS attributes as if no VM is running on the host
3. Run HA VMs that ran on the host
Since this command used to be transactive, the DOWN state on the VMs was
not committed at stage #3. The RunVmCommands triggered in stage #3 still
worked because we were doing the canDoAction checks in the same
transaction (in the multiple action runner). If on the other hand we were
just executing the command one-by-one it would not work because
RunVmCommand is non-transactive so in the canDoAction checks we were
thinking the VMs are in UNKNOWN state - and this is wrong.
There is no real reason for this command to be transactive since after
the user confirmed that the host has been booted, we assume the VMs are
DOWN anyway so the right thing to do is changed their status to DOWN.
The only problematic case of changing the status of the VMs outside of a
transaction scope will be if the host was powered off and we didn't
reach stage #3 (run the HA VMs) after doing stage #1 (this is very
unlikely to happen though) - The VMs will be DOWN and their runningOnVds
field will be blank so VURTI won't try to rerun them when the host will
go up. The good side is that the user will be able to run them manually
if the host is not going to restart (as opposed to keep them in UNKNOWN
state).
So for a conclusion: this patch is not ideal, it solved an issue and
creates another minor issue which is very not likely to happen, and
should probably be fixed by another mechanism that will rerun HA VMs
which are DOWN because of an error and AutoStartVmsRunner didn't try
to rerun.
Change-Id: Ia8728e56f21ff6dcf6e103b1d450eecfaa36e809
Bug-Url:
https://bugzilla.redhat.com/1080961
Signed-off-by: Arik Hadas <ahadas(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ClearNonResponsiveVdsVmsCommand.java
1 file changed, 10 insertions(+), 11 deletions(-)
Approvals:
Omer Frenkel: Looks good to me, approved
Arik Hadas: Verified
--
To view, visit
http://gerrit.ovirt.org/26153
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8728e56f21ff6dcf6e103b1d450eecfaa36e809
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server