Bug 1438188 - Failed to create template from snapshot (At most one USB controller expected)
Summary: Failed to create template from snapshot (At most one USB controller expected)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.1.1.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.1.2
: 4.1.2.1
Assignee: jniederm
QA Contact: Israel Pinto
URL:
Whiteboard:
: 1436247 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-01 18:59 UTC by Israel Pinto
Modified: 2019-11-14 01:21 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Long running VMs (started in engines 3.6 or earlier) and snapshots from that time didn't specify usb controller model. Engine 4.1 required usb controllers to have model specified. Consequence: Fix: Engine 4.1 can handle VMs and snapshots that doesn't have usb controller model specified. Result:
Clone Of:
Environment:
Last Closed: 2017-05-23 08:16:08 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1?
rule-engine: blocker?
ipinto: planning_ack?
rule-engine: devel_ack+
ipinto: testing_ack+


Attachments (Terms of Use)
logs (983.65 KB, application/zip)
2017-04-01 18:59 UTC, Israel Pinto
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 75133 0 'None' MERGED core: make the unmanaged usb controller to be managed 2020-12-03 16:49:50 UTC
oVirt gerrit 75713 0 'None' MERGED core: make the unmanaged usb controller to be managed 2020-12-03 16:49:50 UTC

Description Israel Pinto 2017-04-01 18:59:50 UTC
Created attachment 1268167 [details]
logs

Description of problem:
On upgrade environment from 3.5: 
Failed to create template from VM snapshot (with/without memory)


Version-Release number of selected component (if applicable):
4.1.1.6-0.1.el7

Steps to Reproduce:
1. On Running VM form 3.5 create snapshot with and without memory
2. On each snapshot create Template as a Template Sub Version and copy user permissions

Actual results:
Action failed with Server Internal Error

Expected results:
Template will created

Additional info:
Engine log:
2017-04-01 20:37:41,454+02 INFO  [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (org.ovirt.thread.pool-6-thread-12) [89e83135-d1c7-44a9-be0b-c06ab581e982] CommandAsyncTask::endCommandAction [within thread] context: Attempting to endAction 'AddVmTemplateFromSnapshot',
2017-04-01 20:37:41,455+02 ERROR [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (org.ovirt.thread.pool-6-thread-12) [89e83135-d1c7-44a9-be0b-c06ab581e982] [within thread]: endAction for action type AddVmTemplateFromSnapshot threw an exception.: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.tasks.CoCoAsyncTaskHelper.endAction(CoCoAsyncTaskHelper.java:335) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.endAction(CommandCoordinatorImpl.java:340) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandAsyncTask.endCommandAction(CommandAsyncTask.java:154) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandAsyncTask.lambda$endActionIfNecessary$0(CommandAsyncTask.java:106) [bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:92) [utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_121]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_121]

2017-04-01 20:37:41,457+02 INFO  [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (org.ovirt.thread.pool-6-thread-12) [89e83135-d1c7-44a9-be0b-c06ab581e982] CommandAsyncTask::HandleEndActionResult: endAction for action type 'AddVmTemplateFromSnapshot' threw an unrecoverable RuntimeException the task will be cleared.

Comment 1 Yaniv Kaul 2017-04-02 05:58:36 UTC
Arik, can you take a look?

Comment 2 Tomas Jelinek 2017-04-03 10:53:07 UTC
the root cause looks like:

"
Caused by: java.lang.IllegalStateException: At most one USB controller expected for VM=STAYING_ALIVE
"

So very related to https://bugzilla.redhat.com/show_bug.cgi?id=1430009

Seems the case of adding a vm from snapshot is not handled, checking.

Comment 3 Tomas Jelinek 2017-04-04 06:16:19 UTC
This is the flow which causes the issue:

- a VM is started on an older (pre 4.0 engine)
- in this engines, if the USB is configured as disabled, no USB device is sent to VDSM
- libvirt reacts by creating a new unmanaged USB controller
- this controller appears in engine as an unmanaged device
- after updating the engine, update of all VMs is called to modify the devices according to the need of the new engine
- this code adds a managed USB controller
- in this stage, this VM has 2 USB controllers, one managed and one unmanaged
- from this point, anytime the USB devices are about to be touched (e.g. creating a new template from this VM or from a snapshot of the VM) a sanity check checking that there is only 1 USB controller fails throwing an exception

There is a workaround to turn the VM off, switch the USB to enabled, save the VM, than back to disabled.

Comment 4 Tomas Jelinek 2017-04-04 06:18:19 UTC
*** Bug 1436247 has been marked as a duplicate of this bug. ***

Comment 5 Nikolai Sednev 2017-04-04 11:36:50 UTC
1436247 was reported on 2017-03-27 09:49 EDT by Nikolai Sednev and was opened earlier than 1438188 (this bug), latest was opened on 2017-04-01 14:59 EDT by Israel Pinto.
Please close 1438188 as duplicate of 1436247 and not vice versa.

Comment 6 Michal Skrivanek 2017-04-04 13:38:23 UTC
I don't think it matters, this bug has a concise root cause analysis in comment #3 so keeping the most relevant bug open

Comment 7 Red Hat Bugzilla Rules Engine 2017-04-04 13:38:30 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 8 Israel Pinto 2017-05-22 19:34:10 UTC
Verify with:
RHVM Version: 4.1.2.2-0.1.el7
Host:
OS Version:RHEL - 7.3 - 7.el7
Kernel Version:3.10.0 - 327.28.3.el7.x86_64
KVM Version:2.6.0 - 28.el7_3.9
LIBVIRT Version:libvirt-2.0.0-10.el7_3.5
VDSM Version:vdsm-4.19.15-1.el7ev

Steps:
1. On Running VM form 3.5 create snapshot with and without memory
2. On each snapshot create Template as a Template Sub Version and copy user 
Results:
Template created.


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