Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1647634

Summary: Cannot preview snapshot, it fails and VM remains locked.
Product: [oVirt] ovirt-engine Reporter: Germano Veit Michel <gveitmic>
Component: BLL.VirtAssignee: shani <sleviim>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Pedut <pchocron>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.7CC: bugs, gveitmic, jcoscia, mkalinin, rbarry, sleviim, tnisan
Target Milestone: ovirt-4.2.8Flags: rule-engine: ovirt-4.2?
rbarry: ovirt-4.3?
gveitmic: planning_ack?
gveitmic: devel_ack?
gveitmic: testing_ack?
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1731590 (view as bug list) Environment:
Last Closed: 2018-11-21 06:25:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1731590    

Description Germano Veit Michel 2018-11-08 00:28:21 UTC
Description of problem:

Attempting to preview a VM snapshot in 4.2.7 fails, the VM remains locked and the task never finishes.

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.7.4-1.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create VM
2. Add 2 or 3 snapshots
3. Add a second disk to the VM
4. Preview one of the old snapshots, select:
"Include in the previewed VM only the disks that are included in the snapshot."

Actual results:
Preview never finishes, VM is locked.

Expected results:
Preview to work

Additional info:
Reproduced twice:
- See correlation id b9bb08ab-8067-48da-8e50-64b71c20dcd6 for 1st VM
- See correlation id 3305375f-45dd-4e7c-bfb0-40c72d714793 for 2nd VM
- It gets stuck after the Snapshot part, then a little bit later throws this:
2018-11-08 10:20:20,299+10 ERROR [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (EE-ManagedThreadFactory-engine-Thread-44) [] [within thread]: endAction for action type TryBackToAllSnapshotsOfVm threw an exception.: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.deviceCanBeRemoved(SnapshotsManager.java:475) [bll.jar:]
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.attempToRestoreVmConfigurationFromSnapshot(SnapshotsManager.java:427) [bll.jar:]
        at org.ovirt.engine.core.bll.snapshots.TryBackToAllSnapshotsOfVmCommand.restoreVmConfigFromSnapshot(TryBackToAllSnapshotsOfVmCommand.java:211) [bll.jar:]
        at org.ovirt.engine.core.bll.snapshots.TryBackToAllSnapshotsOfVmCommand.endSuccessfully(TryBackToAllSnapshotsOfVmCommand.java:170) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.internalEndSuccessfully(CommandBase.java:688) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endActionInTransactionScope(CommandBase.java:643) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1954) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:137) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:105) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endAction(CommandBase.java:508) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.DecoratedCommand.endAction(DecoratedCommand.java:17) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CoCoAsyncTaskHelper.endAction(CoCoAsyncTaskHelper.java:353) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.endAction(CommandCoordinatorImpl.java:347) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandAsyncTask.endCommandAction(CommandAsyncTask.java:160) [bll.jar:]
        at org.ovirt.engine.core.bll.tasks.CommandAsyncTask.lambda$endActionIfNecessary$0(CommandAsyncTask.java:112) [bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:96) [utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_181]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_181]
        at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_181]
        at org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl$ManagedThread.run(ManagedThreadFactoryImpl.java:250) [javax.enterprise.concurrent-1.0.jar:]
        at org.jboss.as.ee.concurrent.service.ElytronManagedThreadFactory$ElytronManagedThread.run(ElytronManagedThreadFactory.java:78)

Comment 2 Michal Skrivanek 2018-11-08 06:11:40 UTC
deviceCanBeRemoved is about disk devices, looks like diskDao.get returns null in:
  return vmDevice.getSnapshotId() == null && diskDao.get(vmDevice.getDeviceId()).isAllowSnapshot();

Comment 5 Germano Veit Michel 2018-11-21 06:25:21 UTC
Shani asked me to get database dumps before and after the problem. But I cannot reproduce this anymore.

All I can think of is that I upgraded the hosts, but not sure how it could be related.

Closing the bug, will re-open if I see it again.