Bug 1238536 - vdsm before_vm_hibernate hook failure leaves vm in the wrong state (paused)
Summary: vdsm before_vm_hibernate hook failure leaves vm in the wrong state (paused)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: General
Version: ---
Hardware: All
OS: All
high
low
Target Milestone: ovirt-4.1.0-alpha
: 4.19.2
Assignee: Shmuel Melamud
QA Contact: Israel Pinto
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-02 05:52 UTC by Marcin Mirecki
Modified: 2017-02-01 14:55 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:55:56 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
michal.skrivanek: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 47527 0 master MERGED virt: Allow _recover() to call vm.cont() in any VM state 2016-06-16 10:06:21 UTC

Description Marcin Mirecki 2015-07-02 05:52:14 UTC
Description of problem:
When a before_vm_hibernate hook fails (exit code 2), the resulting vm state is "paused". To be consistant with other hooks, the hook should leave the vm in the state it was before the action was started (running).

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


How reproducible:
100%

Steps to Reproduce:
1. Run vm
2. Place a hook script with a 2 exit code in before_vm_hibernate hook dir
3. Suspend vm
4. The vm will go into the paused state.

Actual results:
VM is paused

Expected results:
VM should go back to running, or alternatively should never be paused.

Additional info:
Cause:
After hook failure, vm.cont() is called to continue the vm, but the state of the vm (Saving State) does not allow for this, exiting the method (error message: cannot cont while Saving State). VM state needs to be changed before calling vm.cont (I tried removing the if statement which checks the state solves the problem).

Probably a better solution would be to change the place where the hook is executed. Currently it is done inside migrate.SourceThread, only after the vm state has been paused. Could it be called before migrate.SourceThread is even started?

Comment 1 Red Hat Bugzilla Rules Engine 2015-10-21 18:25:51 UTC
This bug is not marked for z-stream, yet the milestone is for a z-stream version, therefore the milestone has been reset.
Please set the correct milestone or add the z-stream flag.

Comment 2 Yaniv Lavi 2015-10-29 12:19:10 UTC
In oVirt testing is done on single release by default. Therefore I'm removing the 4.0 flag. If you think this bug must be tested in 4.0 as well, please re-add the flag. Please note we might not have testing resources to handle the 4.0 clone.

Comment 3 Mike McCune 2016-03-28 23:36:13 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 4 Sandro Bonazzola 2016-05-02 10:08:23 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 5 Yaniv Lavi 2016-05-23 13:23:00 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 6 Yaniv Lavi 2016-05-23 13:25:21 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 7 Michal Skrivanek 2016-06-09 07:27:46 UTC
we're past RC, this is not a blocker

Comment 8 Sandro Bonazzola 2016-12-12 14:00:05 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 9 Israel Pinto 2017-01-11 11:30:26 UTC
Verify with:
Engine: 4.2.0-0.0.master.20170104114928.git5490b36.el7.centos
Host: 
OS Version:RHEL - 7.3 - 7.el7
OS Description:Red Hat Enterprise Linux Server 7.3 (Maipo)
Kernel Version:3.10.0 - 514.el7.bug1404060_20.x86_64
KVM Version:2.6.0 - 28.el7_3.3
LIBVIRT Version:libvirt-2.0.0-10.el7_3.2
VDSM Version:vdsm-4.20.0-128.git7001c0a.el7.centos

Steps:
1. Run vm
2. Place a hook script with a 2 exit code in before_vm_hibernate hook dir
3. Case 1: Suspend vm
4. Remove hook script 
5. Case 2: Suspend vm

Results:
Case 1: VM did not suspended, vm in running.
Case 2: VM move to suspend state


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