Bug 1500163

Summary: Error while executing action CloneVm: Internal Engine Error (when VM is configured with cloud-init)
Product: [oVirt] ovirt-engine Reporter: Shamam <shamamamir2017>
Component: BLL.VirtAssignee: jniederm
Status: CLOSED CURRENTRELEASE QA Contact: Vladimir <vshypygu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.5.2CC: 754267513, ahadas, bugs, tjelinek
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
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: Environment:
Last Closed: 2018-02-22 09:58:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shamam 2017-10-10 06:06:00 UTC
Description of problem:

We are using oVirt release Version 4.1.5.2.  I was trying to make a clone of a VM but I got the following message "Error while executing action CloneVm: Internal Engine Error", I found that when cloud-init is used in the vm's edit section, this error occurs, but when the vm is configured without cloud init, the clone was completed successfully. 
Version-Release number of selected component (if applicable):
4.1.5.2

How reproducible:
100%

Steps to Reproduce:
1.create a centos VM and use cloud-init configuration in the Edit Section of this VM
2.choose the VM while it is down and click Clone, in order to make a clone of this VM.

Actual results:
Error while executing action CloneVm: Internal Engine Error

Expected results:
A clone must be completed without such error.

Additional info:
The log file is https://paste.fedoraproject.org/paste/f~sHprL93BNZ-iJzoFDyww

Comment 1 Arik 2017-10-10 08:43:56 UTC
Additional insights:
The template that the original VM is based on is not configured with VM-init.
This leads to an NPE on add-vm:
2017-10-03 14:35:11,863+03 ERROR [org.ovirt.engine.core.bll.CloneVmCommand] (default task-165) [] Exception: java.lang.NullPointerException
	at org.ovirt.engine.core.bll.AddVmCommand.addVmInit(AddVmCommand.java:1155) [bll.jar:]
	at org.ovirt.engine.core.bll.AddVmCommand.lambda$executeVmCommand$3(AddVmCommand.java:933) [bll.jar:]
	at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]
	at org.ovirt.engine.core.bll.AddVmCommand.executeVmCommand(AddVmCommand.java:925) [bll.jar:]
	at org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.executeVmCommand(AddVmAndCloneImageCommand.java:295) [bll.jar:]

Comment 2 Red Hat Bugzilla Rules Engine 2017-10-10 08:44:01 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 3 Vladimir 2018-02-12 14:06:38 UTC
Verified on  4.1.9.2-0.1.el7

Verified scenarios:
1. Create Vm from template without cloud-init configured, clone it, run cloned vm - PASS
2. Create Vm from template with cloud-init configured, clone it, run cloned vm - PASS
3. Clone pool vm with cloud-init configured - PASS
4. Clone pool VM without cloud-init configured - PASS

Comment 4 Vladimir 2018-02-12 14:10:20 UTC
Also verified mentioned scenarios on 4.2.1.6-0.1.el7

Comment 5 Sandro Bonazzola 2018-02-22 09:58:22 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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