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

Bug 872945

Summary: engine: cannot remove snapshot that was created on a vm with an edited shared disk
Product: Red Hat Enterprise Virtualization Manager Reporter: Dafna Ron <dron>
Component: ovirt-engineAssignee: Daniel Erez <derez>
Status: CLOSED CURRENTRELEASE QA Contact: Leonid Natapov <lnatapov>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.1.0CC: abaron, amureini, dyasny, hateya, iheim, lpeer, mgoldboi, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: si24.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 19:59:49 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:
Attachments:
Description Flags
logs
none
log none

Description Dafna Ron 2012-11-04 14:14:02 UTC
Created attachment 638014 [details]
logs

Description of problem:

merge will cause snapshot to be broken after live migrate a disk on a vm with several disks when one of the disks is a disk that was edited to be a shared disk 

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

si23

How reproducible:

100%

Steps to Reproduce:
1. create a vm with several disks
2. edit one of the disks to be a shared disk
3. run vm -> move one of the disks
  
Actual results:

Internal oVirt Engine Error: java.lang.IndexOutOfBoundsException

Expected results:

we should succeed to delete the snapshot

Additional info: logs

2012-11-04 16:02:47,853 ERROR [org.ovirt.engine.core.bll.RemoveSnapshotCommand] (ajp-/127.0.0.1:8702-3) [730340ff] Command org.ovirt.engine.core.bll.RemoveSnapshotCommand throw exception: java.lang.IndexOutOfBoundsException: Index: 0, S
ize: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:604) [rt.jar:1.7.0_09-icedtea]
        at java.util.ArrayList.get(ArrayList.java:382) [rt.jar:1.7.0_09-icedtea]
        at org.ovirt.engine.core.bll.RemoveSnapshotCommand.executeCommand(RemoveSnapshotCommand.java:106) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:875) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:972) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1371) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:204) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:142) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:109) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:990) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:291) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:350) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.RunAction(Backend.java:299) [engine-bll.jar:]
        at sun.reflect.GeneratedMethodAccessor199.invoke(Unknown Source) [:1.7.0_09-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09-icedtea]
        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.ovirt.engine.core.utils.ThreadLocalSessionCleanerInterceptor.injectWebContextToThreadLocal(ThreadLocalSessionCleanerInterceptor.java:11) [engine-utils.jar:]
        at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source) [:1.7.0_09-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]

Comment 1 Allon Mureinik 2012-11-07 15:42:27 UTC
could not reproduce in commit hash 5dafdcd.
After confering with Dafna, decided to set status to MODIFIED, to be re-QA in the next build.

Comment 2 Allon Mureinik 2012-11-07 16:17:44 UTC
sorry, si24 is out - should be ON_QA

Comment 3 Dafna Ron 2012-11-12 09:31:44 UTC
I can reproduce in si24.1

there are actually two scenarios and they happen with snapshot while the vm is down (not just live migration). 

scenario #1: 

1. create a vm with 1 thin provision disk
2. add a second preallocated disk
3. edit the second (preallocated) disk to be a shared disk
4. create a snapshot
5. delete the snapshot

results: we will get a CanDoAction: 

Cannot remove Snapshot. Removing the VM active Snapshot is not allowed.

scenario #2: 

1. create a vm with 1 preallocated disk 
2. add a second disk which is also preallocated
3. edit the second disk to be a shared disk
4. create a snapshot
5. delete the snapshot

results: we get Internal oVirt Engine Error with exception in logs. 

I will attach the new logs.

Comment 4 Dafna Ron 2012-11-12 09:32:29 UTC
Created attachment 643336 [details]
log

Comment 5 Allon Mureinik 2012-11-13 10:41:39 UTC
Note regarding comments 1 and 3 - I suspect that the reason I was not able to reproduce the bug is that I crearted the disk as shareable by mistake, whereas Dafna's step call for created a non-shareable disk and THEN modifying it to shareable.

Comment 6 Daniel Erez 2012-11-13 19:17:41 UTC
patch sent:
http://gerrit.ovirt.org/#/c/9231/
Change-Id: I259759658c1baea8001fa151a5e861cecd8e794a

Comment 7 Allon Mureinik 2012-11-14 11:21:08 UTC
Merged I259759658c1baea8001fa151a5e861cecd8e794a

Comment 8 Dafna Ron 2012-11-18 15:17:35 UTC
verified on si24.2