Bug 1871792

Summary: Importing VM using virt-v2v fails if service ovirt-engine restarted during AddDisk operation.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ameya Charekar <achareka>
Component: ovirt-engineAssignee: Liran Rotenberg <lrotenbe>
Status: CLOSED NEXTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.3.10CC: ahadas, emarcus, emesika, gveitmic, lrotenbe, mavital, michal.skrivanek, mperina
Target Milestone: ovirt-4.4.4   
Target Release: 4.4.4   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.4 Doc Type: Bug Fix
Doc Text:
Previously, when importing a Virtual Machine using virt-v2v and the ovirt-engine service restarted, the import failed. In this release, the import continues as long there is an async command running, allowing the import to complete successfully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-13 16:01:37 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 Ameya Charekar 2020-08-24 10:21:36 UTC
Description of problem:
Importing VM using virt-v2v fails if service ovirt-engine restarted during AddDisk operation as compensation runs for the command, deleting a few things that were created, including vm_static resulting in failure of virt-v2v operation.

Version-Release number of selected component (if applicable):
virt-v2v-1.40.2-9.el7.x86_64
rhvm-4.3.10.4-0.1.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Import VM using virt-v2v.
2. Restart service during AddDisk operation
3.

Actual results:
VM import fails with error:-
~~~
Command 'org.ovirt.engine.core.bll.exportimport.UpdateConvertedVmCommand' failed: CallableStatementCallback; SQL [{call insertvmdevice(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}ERROR: insert or update on table "vm_device" violates foreign key constraint "fk_vm_device_vm_static"
~~~

Expected results:
Operation should succeed without any errors.

Additional info:
The VM import is successful on host and no issues are reported in import logs.

Comment 2 Michal Skrivanek 2020-08-25 04:07:54 UTC
If you restart during import, why is it surprising that it fails? Does it have any ill side effects or it can be just re-imported?

Comment 3 Germano Veit Michel 2020-08-25 04:15:07 UTC
Michal, it's not terribly bad, but I think the ask here is for compensation on engine-restart to not mess up the import. This is all async anyway and may take several hours to run. 
Perhaps it should survive a restart like some other operations do. Don't think there were side effects besides the obvious failure.

Comment 5 Arik 2020-08-25 10:10:42 UTC
Shouldn't we skip compensation on startup for commands set are set with compensationPhase = CommandCompensationPhase.END_COMMAND ?

Comment 14 Casper (RHV QE bot) 2020-11-13 16:01:37 UTC
This bug has a low overall severity and passed automated regreession suite, it is not going to be further verified by QE. If you believe a special care is required feel free to re-open to ON_QA status

Comment 19 meital avital 2022-05-19 15:39:12 UTC
Due to QE capacity we are not going to cover this issue in our automation