Description of problem: I deleted a snapshot on a vm with multiple disks (which caused a collaps action on teh chain) and then removed one of the disks. the disk I removed remains in the snapshot which causes a NPE and failure when trying to preview the snapshot Version-Release number of selected component (if applicable): si4 How reproducible: 100% Steps to Reproduce: 1. create a vm with several disks 2. create 2 snapshots 3. delete the first snapshot (merge) 4. remove one of the disks Actual results: if we expend the snapshot to see the images we can see that we still have 3 disks in the snapshot -> if we try to preview the snapshot we will fail with NPE Expected results: we should remove the disk image from the snapshot Additional info: vdsm and backend logs 2012-06-01 15:31:56,088 ERROR [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-10-thread-43) EntityAsyncTask::EndCommandAction [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm threw an exception: java.lang.NullPointe rException at org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots(ImagesHandler.java:332) [engine-bll.jar:] at org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm(VmCommand.java:198) [engine-bll.jar:] at org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm(VmCommand.java:179) [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:465) [engine-bll.jar:] at org.ovirt.engine.core.bll.CommandBase.endActionInTransactionScope(CommandBase.java:420) [engine-bll.jar:] at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1157) [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:366) [engine-bll.jar:] at org.ovirt.engine.core.bll.Backend.endAction(Backend.java:355) [engine-bll.jar:] at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source) [:1.6.0_24] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24] at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24] at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee.jar:7.1.1.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.GeneratedMethodAccessor15.invoke(Unknown Source) [:1.6.0_24] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24] at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24] at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:123) [jboss-as-ee.jar:7.1.1.Final- redhat-1]
Created attachment 589136 [details] logs
after preview fails we also cannot remove vm/disks/snapshots because snapshot remains in image locked.
Agree the test fails, but this should not be a test blocker - please specify what flows it blocks or remove TestBlocker comment. Also, we need to discuss the correct behavior here. Removing a disk across all the snapshots does not sound like the behavior we'd want.
patch uploaded to gerrit: http://gerrit.ovirt.org/#/c/5831/ Changing the overall behavior of removing a disk may be too difficult/risky at this stage, but that's no reason you shouldn't be able to run a VM :-)
reopening - after further review, this is not how we want to handle this issue.
After discussions, we decided to remove the disk from all the snapshots, instead of leaving illegals. patch in gerrit: http://gerrit.ovirt.org/#/c/6025/
Patch was merged. Steps to Reproduce: 1. create a vm with several disks 2. create 2 snapshots 3. delete the first snapshot (merge) 4. remove one of the disks You will see the disk /removed/ from the snapshot.
disks were removed from snapshot only when located on the same domain. when I created a vm with disks located on different domains one of the disks in snapshot became illegal but was not removed snapshot remains in image locked. log attached + screen shot reproduce: 1. create a vm with several disks located on two different SD 2. create 2 snapshots 3. delete the first snapshot 4. remove disks from both domains
Created attachment 601280 [details] log and screen shot
Created attachment 601285 [details] log operation finally ended with failure with same exception: 2012-07-30 17:13:42,095 ERROR [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-41) EntityAsyncTask::EndCommandAction [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm threw an exception: java.lang.NullPointe rException at org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots(ImagesHandler.java:344) [engine-bll.jar:] at org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm(VmCommand.java:182) [engine-bll.jar:] at org.ovirt.engine.core.bll.VmCommand.UpdateVmInSpm(VmCommand.java:164) [engine-bll.jar:] at org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.restoreVmConfigFromSnapshot(TryBackToAllSnapshotsOfVmCommand.java:96) [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(ManagedReferenceLifecycleMethodInterceptorFactory.java:123) [jboss-as-ee.jar:7.1.2.Final -redhat-1] new log attached
Tested with commit hash cb6eea48bc31cd63caeb840eaec6f0abf133df93, was unable to recreate the issue. Need QE's help to reproduce, or at least undestand how my reproduction is wrong.
I wrote the reproduction in comment 15. we are working with si12 and vdsm-4.9.6-24.0.el6_3.x86_64
(In reply to comment #19) > I wrote the reproduction in comment 15. > we are working with si12 and vdsm-4.9.6-24.0.el6_3.x86_64 moving back to assigned per comment 19 - there was no fix provided by R&D and bug was failed QA. please resolve.
Error was reproduced. I believe the problem reproducing (see comment #18) was that I did not attempt to remove the disks simoltaniously, thus not encountering the race condition in snapshot updating. Working on a solution.
submitted the following patch as fix : http://gerrit.ovirt.org/#/c/7482/
merged change id Iccb44f1aa9d204477955343167133849a4146753
verified on si17