Bug 1573421 - An exception is thrown when creating a template from snapshot with less disks then the active VM
Summary: An exception is thrown when creating a template from snapshot with less disks...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.3.0
: 4.3.0
Assignee: Eyal Shenitzky
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks: 1623818
TreeView+ depends on / blocked
 
Reported: 2018-05-01 07:45 UTC by Eyal Shenitzky
Modified: 2019-02-13 07:48 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.3.0_alpha
Clone Of:
: 1623818 (view as bug list)
Environment:
Last Closed: 2019-02-13 07:48:01 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.3+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 90801 0 master MERGED core: use snapshot VM configuration when creating a template from snapshot 2018-05-10 08:58:46 UTC
oVirt gerrit 94034 0 ovirt-engine-4.2 MERGED core: use snapshot VM configuration when creating a template from snapshot 2018-08-30 09:34:36 UTC

Description Eyal Shenitzky 2018-05-01 07:45:06 UTC
Description of problem:

When having a VM with a snapshot that contains fewer disks
then the active-snapshot an exception is thrown and the operation failed


Version-Release number of selected component (if applicable):
master-4.3.0 - from commit 56af10f17ad1ed06611c99abec486fe03e91dd3e

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with disk
2. Create a snapshot of the VM from step 1
3. Add another disk to the VM
4. Try to create a template from the snapshot in step 2

Actual results:
An exception is thrown

Expected results:
The template should create successfully

Additional info:

Part of the engine log-

2018-05-01 10:37:08,444+03 ERROR [org.ovirt.engine.core.bll.storage.disk.image.CreateImageTemplateCommand] (default task-59) [6bf12d96-0ba7-4dee-abdb-a47cfe45907f] Transaction rolled-back for command 'org.ovirt.engine.core.bll.storage.disk.image.CreateImageTemplateCommand'.
2018-05-01 10:37:08,444+03 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (default task-59) [6bf12d96-0ba7-4dee-abdb-a47cfe45907f] transaction rolled back
2018-05-01 10:37:08,445+03 ERROR [org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksFromSnapshotCommand] (default task-59) [6bf12d96-0ba7-4dee-abdb-a47cfe45907f] Command 'org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksFromSnapshotCommand' failed: 1
2018-05-01 10:37:08,445+03 ERROR [org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksFromSnapshotCommand] (default task-59) [6bf12d96-0ba7-4dee-abdb-a47cfe45907f] Exception: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksCommand.addVmTemplateImage(CreateAllTemplateDisksCommand.java:134) [bll.jar:]
	at org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksCommand.lambda$addVmTemplateImages$1(CreateAllTemplateDisksCommand.java:129) [bll.jar:]
	at java.util.ArrayList.forEach(ArrayList.java:1257) [rt.jar:1.8.0_161]
	at org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksCommand.addVmTemplateImages(CreateAllTemplateDisksCommand.java:129) [bll.jar:]
	at org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksCommand.lambda$executeCommand$0(CreateAllTemplateDisksCommand.java:83) [bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]
	at org.ovirt.engine.core.bll.storage.disk.CreateAllTemplateDisksCommand.executeCommand(CreateAllTemplateDisksCommand.java:82) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1133) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1286) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1935) [bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:164) [utils.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:103) [utils.jar:]
	at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1346) [bll.jar:]
	at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:400) [bll.jar:]
	at org.ovirt.engine.core.bll.executor.DefaultBackendActionExecutor.execute(DefaultBackendActionExecutor.java:13) [bll.jar:]
	at org.ovirt.engine.core.bll.Backend.runAction(Backend.java:450) [bll.jar:]
	at org.ovirt.engine.core.bll.Backend.runActionImpl(Backend.java:432) [bll.jar:]
	at org.ovirt.engine.core.bll.Backend.runInternalAction(Backend.java:638) [bll.jar:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_161]
	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_161]
	at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
	at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
	at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:78)
	at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:88)
	at org.jboss.as.weld.interceptors.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:101)
	at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
	at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-11.0.0.Final.jar:11.0.0.Final]

Comment 1 Eyal Shenitzky 2018-05-01 07:46:35 UTC
Description of problem:

When having a VM with a snapshot that contains fewer disks
then the active-snapshot, an exception is thrown when trying to create a template from the snapshot and the operation failed.

Comment 2 Tal Nisan 2018-05-01 12:38:51 UTC
Eyal, does that reproduce in 4.2.z as well?

Comment 3 Eyal Shenitzky 2018-05-01 12:45:57 UTC
(In reply to Tal Nisan from comment #2)
> Eyal, does that reproduce in 4.2.z as well?

I didn't check but I am pretty sure that this is reproduced also in 4.2.z according to the fix.

Comment 4 Elad 2018-08-19 15:29:48 UTC
Steps to Reproduce:
1. Create a VM with disk
2. Create a snapshot of the VM from step 1
3. Add another disk to the VM
4. Try to create a template from the snapshot in step 2

Result: Template is being created successfully.


Used:
ovirt-engine-4.3.0-0.0.master.20180815091554.gitd5455ea.el7.noarch

Comment 5 shani 2018-08-30 07:51:41 UTC
Same issue for ovirt-engine-4.2.

Comment 6 Sandro Bonazzola 2018-11-02 14:28:53 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

Comment 7 Sandro Bonazzola 2018-11-02 14:59:48 UTC
Closed by mistake, moving back to qa -> verified

Comment 8 Sandro Bonazzola 2019-02-13 07:48:01 UTC
This bugzilla is included in oVirt 4.3.0 release, published on February 4th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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