Bug 844169 - ovirt-engine-backend [Direct Lun]:cannot remove the snapshot created for a disk when running vm as stateless with direct lun+regular disk even when removing the regular disk
Summary: ovirt-engine-backend [Direct Lun]:cannot remove the snapshot created for a di...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.1.0
Hardware: x86_64
OS: Linux
urgent
high
Target Milestone: ---
: 3.1.0
Assignee: Maor
QA Contact: Dafna Ron
URL:
Whiteboard: storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-29 14:13 UTC by Dafna Ron
Modified: 2016-02-10 17:07 UTC (History)
12 users (show)

Fixed In Version: SI15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log (131.70 KB, application/x-xz)
2012-07-29 14:13 UTC, Dafna Ron
no flags Details

Description Dafna Ron 2012-07-29 14:13:08 UTC
Created attachment 601033 [details]
log

Description of problem:

I created a vm with 1 direct lun disk and one regular disk as stateless

we are running the vm and creating a snapshot but when I stop the vm we get an error that we failed to stop the vm (although the vm is stopped). 
looking at the engine log I can see java.lang.IndexOutOfBoundsException on RestoreAllSnapshotsCommand. 

we cannot remove the snapshot (even when I perminatly removed the disk from the vm) and can no longer run the vm. 

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

si12

How reproducible:

100%

Steps to Reproduce:
1. create a vm with one direct lun + 1 disk
2. run vm as stateless 
3. stop vm
  
Actual results:

we get an alert that we failed to stop the vm but vm stops 
snapshot cannot be deleted manually
we cannot run vm because if a stateless snapshot exist we try to delete it again and fail
even when manually removing the disk the snapshot remains under the vm 
when I detach the direct lun, the vm remains with no disks at all but with an existing snapshot

Expected results:

we should be able to remove the snapshot


Additional info:complete engine log

Comment 1 Itamar Heim 2012-07-29 14:16:25 UTC
this is not a regression from 3.0 where there was no direct lun

Comment 2 Dafna Ron 2012-07-29 14:31:59 UTC
regression is added since statless + direct lun worked in si6 (when I last tested) and is not working on si12

Comment 3 Dafna Ron 2012-07-29 14:35:41 UTC
I checked direct lun + regular disk with preview (not stateless snapshot) and we are getting the same: 

2012-07-29 17:37:16,743 ERROR [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-47) EntityAsyncTask::EndCommandAction [within thread]: EndAction for action type TryBac
kToAllSnapshotsOfVm threw an exception: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:604) [rt.jar:1.7.0_05-icedtea]
        at java.util.ArrayList.get(ArrayList.java:382) [rt.jar:1.7.0_05-icedtea]
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.removeDisksNotInSnapshot(SnapshotsManager.java:379) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.synchronizeDisksFromSnapshot(SnapshotsManager.java:367) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.snapshots.SnapshotsManager.attempToRestoreVmConfigurationFromSnapshot(SnapshotsManager.java:218) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.restoreVmConfigFromSnapshot(TryBackToAllSnapshotsOfVmCommand.java:92) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.EndSuccessfully(TryBackToAllSnapshotsOfVmCommand.java:76) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.InternalEndSuccessfully(CommandBase.java:476) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endActionInTransactionScope(CommandBase.java:431) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1243) [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.EndAction(CommandBase.java:377) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.endAction(Backend.java:355) [engine-bll.jar:]
        at sun.reflect.GeneratedMethodAccessor423.invoke(Unknown Source) [:1.7.0_05-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_05-icedtea]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_05-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.GeneratedMethodAccessor9.invoke(Unknown Source) [:1.7.0_05-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_05-icedtea]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_05-icedtea]
        at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMet
hodInterceptorFactory.java:123) [jboss-as-ee.jar:7.1.2.Final-redhat-1]

Comment 5 Maor 2012-07-30 17:25:21 UTC
proposed solution is at: http://gerrit.ovirt.org/#/c/6768/

Comment 6 Maor 2012-08-02 10:46:51 UTC
Merged to upstream at commit #d5227631e4231eb21186ff22172e67d2d68c8060

Comment 9 Haim 2012-08-23 11:23:04 UTC
verified on si15. started a vm with 1 external disk and 1 direct lun as stateless and then stopped it. snapshot was deleted as a part of stop action.


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